diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py')
-rw-r--r-- | Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py index b287875..0260dff 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py @@ -41,8 +41,10 @@ import chromium_linux import chromium_mac import chromium_win -class ChromiumDriverTest(unittest.TestCase): +from webkitpy.layout_tests.port import port_testcase + +class ChromiumDriverTest(unittest.TestCase): def setUp(self): mock_port = Mock() mock_port.get_option = lambda option_name: '' @@ -85,8 +87,46 @@ class ChromiumDriverTest(unittest.TestCase): self.driver._proc.stdout.readline = mock_readline self._assert_write_command_and_read_line(expected_crash=True) + def test_stop(self): + self.pid = None + self.wait_called = False + self.driver._proc = Mock() + self.driver._proc.pid = 1 + self.driver._proc.stdin = StringIO.StringIO() + self.driver._proc.stdout = StringIO.StringIO() + self.driver._proc.stderr = StringIO.StringIO() + self.driver._proc.poll = lambda: None + + def fake_wait(): + self.assertTrue(self.pid is not None) + self.wait_called = True + + self.driver._proc.wait = fake_wait + + class FakeExecutive(object): + def kill_process(other, pid): + self.pid = pid + self.driver._proc.poll = lambda: 2 + + self.driver._port._executive = FakeExecutive() + self.driver.KILL_TIMEOUT = 0.01 + self.driver.stop() + self.assertTrue(self.wait_called) + self.assertEquals(self.pid, 1) + + +class ChromiumPortTest(port_testcase.PortTestCase): + def port_maker(self, platform): + return chromium.ChromiumPort + + def test_driver_cmd_line(self): + # Override this test since ChromiumPort doesn't implement driver_cmd_line(). + pass + + def test_baseline_search_path(self): + # Override this test since ChromiumPort doesn't implement baseline_search_path(). + pass -class ChromiumPortTest(unittest.TestCase): class TestMacPort(chromium_mac.ChromiumMacPort): def __init__(self, options): chromium_mac.ChromiumMacPort.__init__(self, |