public void testBrowserSessionFactorySetsLastSessionIdOfSeleniumDriverResourceHandler() throws Exception {
final RemoteControlConfiguration configuration;
BrowserLauncherFactory blf = createMock(BrowserLauncherFactory.class);
DummyLauncher launcherMock = createMock(DummyLauncher.class);
configuration = new RemoteControlConfiguration();
configuration.setTimeoutInSeconds(1);
BrowserConfigurationOptions bco = new BrowserConfigurationOptions();
BrowserSessionFactory factory = new BrowserSessionFactory(blf) {
@Override
protected FrameGroupCommandQueueSet makeQueueSet(String sessionId,
int port, RemoteControlConfiguration configuration) {
return createMock(FrameGroupCommandQueueSet.class);
}
@Override
protected FrameGroupCommandQueueSet getQueueSet(String sessionId) {
return createMock(FrameGroupCommandQueueSet.class);
}
};
expect(blf.getBrowserLauncher(isA(String.class), isA(String.class), isA(RemoteControlConfiguration.class))).andReturn(launcherMock);
launcherMock.launchRemoteSession("",true, bco);
expectLastCall().once();
replay(launcherMock);
replay(blf);
factory.createNewRemoteSession("", "", "", bco, true, configuration);