| Index: Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
|
| diff --git a/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
|
| index 9a2fd6165c7408b514178932f8df09dcd02519b4..37facc8aee087b1401d40c592f5b30c317ca03f3 100644
|
| --- a/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
|
| +++ b/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
|
| @@ -51,7 +51,10 @@ INVALID_ENTRIES_TOMBSTONE_TEST_TYPE = 4
|
|
|
| # Any "adb" commands will be interpret by this class instead of executing actual
|
| # commansd on the file system, which we don't want to do.
|
| +
|
| +
|
| class MockAndroidDebugBridge:
|
| +
|
| def __init__(self, device_count):
|
| self._device_count = device_count
|
| self._last_command = None
|
| @@ -112,6 +115,7 @@ class MockAndroidDebugBridge:
|
|
|
|
|
| class AndroidCommandsTest(unittest.TestCase):
|
| +
|
| def setUp(self):
|
| android.AndroidCommands._adb_command_path = None
|
| android.AndroidCommands._adb_command_path_options = ['adb']
|
| @@ -198,6 +202,7 @@ class AndroidPortTest(port_testcase.PortTestCase):
|
|
|
|
|
| class ChromiumAndroidDriverTest(unittest.TestCase):
|
| +
|
| def setUp(self):
|
| self._mock_adb = MockAndroidDebugBridge(1)
|
| self._mock_executive = MockExecutive2(run_command_fn=self._mock_adb.run_command)
|
| @@ -205,7 +210,7 @@ class ChromiumAndroidDriverTest(unittest.TestCase):
|
| android_commands = android.AndroidCommands(self._mock_executive, '123456789ABCDEF0', debug_logging=False)
|
| self._port = android.AndroidPort(MockSystemHost(executive=self._mock_executive), 'android')
|
| self._driver = android.ChromiumAndroidDriver(self._port, worker_number=0,
|
| - pixel_tests=True, driver_details=android.ContentShellDriverDetails(), android_devices=self._port._devices)
|
| + pixel_tests=True, driver_details=android.ContentShellDriverDetails(), android_devices=self._port._devices)
|
|
|
| # The cmd_line() method in the Android port is used for starting a shell, not the test runner.
|
| def test_cmd_line(self):
|
| @@ -221,15 +226,16 @@ class ChromiumAndroidDriverTest(unittest.TestCase):
|
|
|
| class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase):
|
| # Test two drivers getting the right serial numbers, and that we disregard per-test arguments.
|
| +
|
| def test_two_drivers(self):
|
| mock_adb = MockAndroidDebugBridge(2)
|
| mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
|
|
|
| port = android.AndroidPort(MockSystemHost(executive=mock_executive), 'android')
|
| driver0 = android.ChromiumAndroidDriver(port, worker_number=0, pixel_tests=True,
|
| - driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
|
| + driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
|
| driver1 = android.ChromiumAndroidDriver(port, worker_number=1, pixel_tests=True,
|
| - driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
|
| + driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
|
|
|
| self.assertEqual(['adb', '-s', '123456789ABCDEF0', 'shell'], driver0.cmd_line(True, []))
|
| self.assertEqual(['adb', '-s', '123456789ABCDEF1', 'shell'], driver1.cmd_line(True, ['anything']))
|
| @@ -237,14 +243,15 @@ class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase):
|
|
|
| class ChromiumAndroidTwoPortsTest(unittest.TestCase):
|
| # Test that the driver's command line indeed goes through to the driver.
|
| +
|
| def test_options_with_two_ports(self):
|
| mock_adb = MockAndroidDebugBridge(2)
|
| mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
|
|
|
| port0 = android.AndroidPort(MockSystemHost(executive=mock_executive),
|
| - 'android', options=MockOptions(additional_drt_flag=['--foo=bar']))
|
| + 'android', options=MockOptions(additional_drt_flag=['--foo=bar']))
|
| port1 = android.AndroidPort(MockSystemHost(executive=mock_executive),
|
| - 'android', options=MockOptions(driver_name='content_shell'))
|
| + 'android', options=MockOptions(driver_name='content_shell'))
|
|
|
| self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar'))
|
| self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo'))
|
| @@ -259,7 +266,7 @@ class ChromiumAndroidDriverTombstoneTest(unittest.TestCase):
|
|
|
| self._port = android.AndroidPort(MockSystemHost(executive=self._mock_executive), 'android')
|
| self._driver = android.ChromiumAndroidDriver(self._port, worker_number=0,
|
| - pixel_tests=True, driver_details=android.ContentShellDriverDetails(), android_devices=self._port._devices)
|
| + pixel_tests=True, driver_details=android.ContentShellDriverDetails(), android_devices=self._port._devices)
|
|
|
| self._errors = []
|
| self._driver._log_error = lambda msg: self._errors.append(msg)
|
|
|