Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(899)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py

Issue 1783073002: Run auto-formatter on files in webkitpy/layout_tests/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ran yapf -i --style '{based_on_style: pep8, column_limit: 132}' then did manual fix-up Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
index 19a232a4e721312af3dd672af95cc42acbc38749..6f95de01ca32de559a33b6557933319af95534a2 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
@@ -51,6 +51,8 @@ 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
@@ -103,8 +105,8 @@ class MockAndroidDebugBridge:
# Local private methods.
def _get_device_output(self):
- serials = ['123456789ABCDEF0', '123456789ABCDEF1', '123456789ABCDEF2',
- '123456789ABCDEF3', '123456789ABCDEF4', '123456789ABCDEF5']
+ serials = ['123456789ABCDEF0', '123456789ABCDEF1', '123456789ABCDEF2', '123456789ABCDEF3', '123456789ABCDEF4',
+ '123456789ABCDEF5']
output = 'List of devices attached\n'
for serial in serials[:self._device_count]:
output += '%s\tdevice\n' % serial
@@ -204,8 +206,11 @@ 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)
+ self._driver = android.ChromiumAndroidDriver(self._port,
+ worker_number=0,
+ 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,22 @@ 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)
- driver1 = android.ChromiumAndroidDriver(port, worker_number=1, pixel_tests=True,
- driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
+ driver0 = android.ChromiumAndroidDriver(port,
+ worker_number=0,
+ pixel_tests=True,
+ 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)
self.assertEqual(['adb', '-s', '123456789ABCDEF0', 'shell'], driver0.cmd_line(True, []))
self.assertEqual(['adb', '-s', '123456789ABCDEF1', 'shell'], driver1.cmd_line(True, ['anything']))
@@ -237,14 +249,19 @@ 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_driver_flag=['--foo=bar']))
- port1 = android.AndroidPort(MockSystemHost(executive=mock_executive),
- 'android', options=MockOptions(driver_name='content_shell'))
+ port0 = android.AndroidPort(
+ MockSystemHost(executive=mock_executive),
+ 'android',
+ options=MockOptions(additional_driver_flag=['--foo=bar']))
+ port1 = android.AndroidPort(
+ MockSystemHost(executive=mock_executive),
+ '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'))
@@ -258,8 +275,11 @@ class ChromiumAndroidDriverTombstoneTest(unittest.TestCase):
self._mock_executive = MockExecutive2(run_command_fn=self._mock_adb.run_command)
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)
+ self._driver = android.ChromiumAndroidDriver(self._port,
+ worker_number=0,
+ pixel_tests=True,
+ driver_details=android.ContentShellDriverDetails(),
+ android_devices=self._port._devices)
self._errors = []
self._driver._log_error = lambda msg: self._errors.append(msg)
@@ -287,8 +307,7 @@ class ChromiumAndroidDriverTombstoneTest(unittest.TestCase):
# Tests that invalid "ls" output will throw a warning when listing the tombstone files.
def test_invalid_tombstone_list_entry_format(self):
- self._mock_adb.set_tombstone_output('-rw------- 1000 1000 3604 2013-11-19 16:15 tombstone_00\n' +
- '-- invalid entry --\n' +
+ self._mock_adb.set_tombstone_output('-rw------- 1000 1000 3604 2013-11-19 16:15 tombstone_00\n' + '-- invalid entry --\n' +
'-rw------- 1000 1000 3604 2013-11-19 16:16 tombstone_10')
stacktrace = self._driver._get_last_stacktrace()

Powered by Google App Engine
This is Rietveld 408576698