@Test
public void testLobbyGameStateChanged() {

	testMedia.updateDeviceList();
	assertEquals(true, testMedia.getActiveCamera() != null);
	
	testLobby.addLobbyStateListener(testMedia);
	testLobby.setGameType(GameType.FREETEST);
	TestRobotProxy robot1 = new TestRobotProxy(testLobby, "TestRobot1");
	testLobby.addUserProxy(user1);
	user1.processChangedReadyState(true);
	
	// Ensure that a game launch triggers the media stream
	user1.processGameLaunch();
	try {
		Thread.sleep(1000);
	} catch (InterruptedException e) {
		e.printStackTrace();
	}
	assertEquals(true, testLobby.gameInProgress());
	assertEquals(true, testMedia.isStreaming());
	
	// Ensure that game termination closes the video stream
	testLobby.endCurrentGame();
	try {
		Thread.sleep(1000);
	} catch (InterruptedException e) {
		e.printStackTrace();
	}
	assertEquals(false, testMedia.isStreaming());
	
	testLobby.removeLobbyStateListener(testMedia);
}