Modified: trunk/Tools/ChangeLog (122250 => 122251)
--- trunk/Tools/ChangeLog 2012-07-10 19:52:36 UTC (rev 122250)
+++ trunk/Tools/ChangeLog 2012-07-10 19:56:37 UTC (rev 122251)
@@ -1,3 +1,23 @@
+2012-07-10 Xianzhu Wang <[email protected]>
+
+ [Chromium-Android] Use setup_test_runner() instead of start_helper() to setup test environment
+ https://bugs.webkit.org/show_bug.cgi?id=90894
+
+ Reviewed by Adam Barth.
+
+ start_helper() is actually start_pixel_test_helper() since r115601 (bug 81729).
+ Should use setup_test_runner() to setup test environment for chromium-android.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.setup_test_run): Renamed from start_helper(). Added cache cleanup code.
+ (ChromiumAndroidPort.clean_up_test_run): Renamed from stop_helper().
+ (ChromiumAndroidPort._path_to_helper): Returns None as we don't have a helper now.
+ (ChromiumAndroidPort):
+ (ChromiumAndroidPort._path_to_forwarder): Original _path_to_helper().
+ (ChromiumAndroidPort._push_executable):
+ (ChromiumAndroidDriver.__init__):
+ (ChromiumAndroidDriver.cmd_line):
+
2012-07-09 Ojan Vafai <[email protected]>
Improve webkit-patch rebaseline to work for more cases
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py (122250 => 122251)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-07-10 19:52:36 UTC (rev 122250)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-07-10 19:56:37 UTC (rev 122251)
@@ -57,7 +57,9 @@
DRT_APP_PACKAGE = 'org.chromium.native_test'
DRT_ACTIVITY_FULL_NAME = DRT_APP_PACKAGE + '/.ChromeNativeTestActivity'
-DRT_APP_FILE_DIR = '/data/user/0/' + DRT_APP_PACKAGE + '/files/'
+DRT_APP_DIR = '/data/user/0/' + DRT_APP_PACKAGE + '/'
+DRT_APP_FILES_DIR = DRT_APP_DIR + 'files/'
+DRT_APP_CACHE_DIR = DIR_APP_DIR + 'cache/'
# This only works for single core devices so far.
# FIXME: Find a solution for multi-core devices.
@@ -235,7 +237,7 @@
# Same as start_http_server().
pass
- def start_helper(self):
+ def setup_test_run(self):
self._run_adb_command(['root'])
self._setup_performance()
# Required by webkit_support::GetWebKitRootDirFilePath().
@@ -249,13 +251,17 @@
self._push_fonts()
self._synchronize_datetime()
+ # Delete the disk cache if any to ensure a clean test run.
+ # This is like what's done in ChromiumPort.setup_test_run but on the device.
+ self._run_adb_command(['shell', 'rm', '-r', DEVICE_APP_CACHE_DIR])
+
# Start the HTTP server so that the device can access the test cases.
chromium.ChromiumPort.start_http_server(self, additional_dirs={TEST_PATH_PREFIX: self.layout_tests_dir()})
_log.debug('Starting forwarder')
- cmd = self._run_adb_command(['shell', '%s %s' % (DEVICE_FORWARDER_PATH, FORWARD_PORTS)])
+ self._run_adb_command(['shell', '%s %s' % (DEVICE_FORWARDER_PATH, FORWARD_PORTS)])
- def stop_helper(self):
+ def clean_up_test_run(self):
# Leave the forwarder and tests httpd server there because they are
# useful for debugging and do no harm to subsequent tests.
self._teardown_performance()
@@ -284,6 +290,9 @@
return self._build_path(configuration, 'DumpRenderTree_apk/DumpRenderTree-debug.apk')
def _path_to_helper(self):
+ return None
+
+ def _path_to_forwarder(self):
return self._build_path(self.get_option('configuration'), 'forwarder')
def _path_to_image_diff(self):
@@ -320,7 +329,7 @@
def _push_executable(self):
drt_host_path = self._path_to_driver()
- forwarder_host_path = self._path_to_helper()
+ forwarder_host_path = self._path_to_forwarder()
host_stamp = int(float(max(os.stat(drt_host_path).st_mtime,
os.stat(forwarder_host_path).st_mtime)))
device_stamp = int(float(self._run_adb_command([
@@ -452,9 +461,9 @@
def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
chromium.ChromiumDriver.__init__(self, port, worker_number, pixel_tests, no_timeout)
- self._in_fifo_path = DRT_APP_FILE_DIR + 'DumpRenderTree.in'
- self._out_fifo_path = DRT_APP_FILE_DIR + 'DumpRenderTree.out'
- self._err_file_path = DRT_APP_FILE_DIR + 'DumpRenderTree.err'
+ self._in_fifo_path = DRT_APP_FILES_DIR + 'DumpRenderTree.in'
+ self._out_fifo_path = DRT_APP_FILES_DIR + 'DumpRenderTree.out'
+ self._err_file_path = DRT_APP_FILES_DIR + 'DumpRenderTree.err'
self._restart_after_killed = False
self._read_fifo_proc = None
@@ -467,7 +476,7 @@
cmd = []
for param in original_cmd:
if param.startswith('--pixel-tests='):
- self._device_image_path = DRT_APP_FILE_DIR + self._port.host.filesystem.basename(self._image_path)
+ self._device_image_path = DRT_APP_FILES_DIR + self._port.host.filesystem.basename(self._image_path)
param = '--pixel-tests=' + self._device_image_path
cmd.append(param)