Title: [124851] trunk/Tools
- Revision
- 124851
- Author
- [email protected]
- Date
- 2012-08-06 22:47:39 -0700 (Mon, 06 Aug 2012)
Log Message
[Chromium]duplicated command line options in Android LayoutTest
https://bugs.webkit.org/show_bug.cgi?id=93233
Patch by Wei James <[email protected]> on 2012-08-06
Reviewed by Tony Chang.
Duplicated options found in Android layout test command line:
--encode-binary and --enable-hardware-gpu.
If there are multiple ChromiumAndroidPort instances,
these two options will be appended for multiple times.
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.additional_drt_flag):
* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidPort.__init__):
(ChromiumAndroidPort.additional_drt_flag):
* Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py:
(ChromiumAndroidTwoPortsTest):
(ChromiumAndroidTwoPortsTest.test_options_with_two_ports):
* Scripts/webkitpy/layout_tests/port/driver.py:
(Driver.cmd_line):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (124850 => 124851)
--- trunk/Tools/ChangeLog 2012-08-07 05:47:25 UTC (rev 124850)
+++ trunk/Tools/ChangeLog 2012-08-07 05:47:39 UTC (rev 124851)
@@ -1,3 +1,27 @@
+2012-08-06 Wei James <[email protected]>
+
+ [Chromium]duplicated command line options in Android LayoutTest
+ https://bugs.webkit.org/show_bug.cgi?id=93233
+
+ Reviewed by Tony Chang.
+
+ Duplicated options found in Android layout test command line:
+ --encode-binary and --enable-hardware-gpu.
+
+ If there are multiple ChromiumAndroidPort instances,
+ these two options will be appended for multiple times.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.additional_drt_flag):
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.__init__):
+ (ChromiumAndroidPort.additional_drt_flag):
+ * Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py:
+ (ChromiumAndroidTwoPortsTest):
+ (ChromiumAndroidTwoPortsTest.test_options_with_two_ports):
+ * Scripts/webkitpy/layout_tests/port/driver.py:
+ (Driver.cmd_line):
+
2012-08-03 Brady Eidson <[email protected]>
Out-of-process plug-ins should support asynchronous initialization
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (124850 => 124851)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-08-07 05:47:25 UTC (rev 124850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-08-07 05:47:39 UTC (rev 124851)
@@ -143,6 +143,9 @@
self._reftest_list = {}
self._results_directory = None
+ def additional_drt_flag(self):
+ return []
+
def default_pixel_tests(self):
# FIXME: Disable until they are run by default on build.webkit.org.
return False
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py (124850 => 124851)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-08-07 05:47:25 UTC (rev 124850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-08-07 05:47:39 UTC (rev 124851)
@@ -155,13 +155,6 @@
def __init__(self, host, port_name, **kwargs):
super(ChromiumAndroidPort, self).__init__(host, port_name, **kwargs)
- if not hasattr(self._options, 'additional_drt_flag'):
- self._options.additional_drt_flag = []
- self._options.additional_drt_flag.append('--encode-binary')
-
- # The Chromium port for Android always uses the hardware GPU path.
- self._options.additional_drt_flag.append('--enable-hardware-gpu')
-
self._operating_system = 'android'
self._version = 'icecreamsandwich'
@@ -172,6 +165,10 @@
else:
self._devices = []
+ def additional_drt_flag(self):
+ # The Chromium port for Android always uses the hardware GPU path.
+ return ['--encode-binary', '--enable-hardware-gpu']
+
def default_timeout_ms(self):
# Android platform has less computing power than desktop platforms.
# Using 10 seconds allows us to pass most slow tests which are not
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py (124850 => 124851)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py 2012-08-07 05:47:25 UTC (rev 124850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py 2012-08-07 05:47:39 UTC (rev 124851)
@@ -39,8 +39,8 @@
from webkitpy.layout_tests.port import chromium_port_testcase
from webkitpy.layout_tests.port import driver
from webkitpy.layout_tests.port import driver_unittest
+from webkitpy.tool.mocktool import MockOptions
-
class MockRunCommand(object):
def __init__(self):
self._mock_logcat = ''
@@ -269,5 +269,21 @@
self.assertEquals(['adb', '-s', mock_run_command._mock_devices[1], 'shell'], cmd_line1)
+class ChromiumAndroidTwoPortsTest(unittest.TestCase):
+ def test_options_with_two_ports(self):
+ options = MockOptions(additional_drt_flag=['--foo=bar', '--foo=baz'])
+ mock_run_command = MockRunCommand()
+ mock_run_command.mock_two_devices()
+ port0 = chromium_android.ChromiumAndroidPort(
+ MockSystemHost(executive=MockExecutive2(run_command_fn=mock_run_command.mock_run_command_fn)),
+ 'chromium-android', options=options)
+ port1 = chromium_android.ChromiumAndroidPort(
+ MockSystemHost(executive=MockExecutive2(run_command_fn=mock_run_command.mock_run_command_fn)),
+ 'chromium-android', options=options)
+ cmd_line = port1.driver_cmd_line()
+ self.assertEquals(cmd_line.count('--encode-binary'), 1)
+ self.assertEquals(cmd_line.count('--enable-hardware-gpu'), 1)
+
+
if __name__ == '__main__':
unittest.main()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py (124850 => 124851)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py 2012-08-07 05:47:25 UTC (rev 124850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py 2012-08-07 05:47:39 UTC (rev 124851)
@@ -294,6 +294,7 @@
# FIXME: We need to pass --timeout=SECONDS to WebKitTestRunner for WebKit2.
cmd.extend(self._port.get_option('additional_drt_flag', []))
+ cmd.extend(self._port.additional_drt_flag())
cmd.extend(per_test_args)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes