server.setProcessStarter(starter);
MockTestRunListener listener = new MockTestRunListener();
server.addTestRunListener(listener);
Browser browser = new Browser(DummyConfigurationSource.BROWSER_FILE_NAME, 0);
server.launchBrowserTestRun(new BrowserLaunchSpecification(browser));
assertTrue(listener.browserTestRunStartedCalled);
assertTrue(listener.browserTestRunFinishedCalled);
assertTrue(listener.result.failedToLaunch());
assertFalse(server.isWaitingForBrowser(browser));
assertEquals(new Browser("iexplore.exe", 0), listener.browser);
assertEquals("iexplore.exe", listener.result.getBrowser().getStartCommand());
assertSame(listener.result, server.lastResult());
server.setProcessStarter(new MockProcessStarter());
listener.reset();
browser = new Browser("mybrowser2.exe", 1);
server.launchBrowserTestRun(new BrowserLaunchSpecification(browser));
assertTrue(server.isWaitingForBrowser(browser));
assertTrue(listener.browserTestRunStartedCalled);
assertFalse(listener.browserTestRunFinishedCalled);
assertEquals(browser, listener.browser);
}