Changeset 122251 in webkit


Ignore:
Timestamp:
Jul 10, 2012 12:56:37 PM (12 years ago)
Author:
wangxianzhu@chromium.org
Message:

[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):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r122234 r122251  
     12012-07-10  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        [Chromium-Android] Use setup_test_runner() instead of start_helper() to setup test environment
     4        https://bugs.webkit.org/show_bug.cgi?id=90894
     5
     6        Reviewed by Adam Barth.
     7
     8        start_helper() is actually start_pixel_test_helper() since r115601 (bug 81729).
     9        Should use setup_test_runner() to setup test environment for chromium-android.
     10
     11        * Scripts/webkitpy/layout_tests/port/chromium_android.py:
     12        (ChromiumAndroidPort.setup_test_run): Renamed from start_helper(). Added cache cleanup code.
     13        (ChromiumAndroidPort.clean_up_test_run): Renamed from stop_helper().
     14        (ChromiumAndroidPort._path_to_helper): Returns None as we don't have a helper now.
     15        (ChromiumAndroidPort):
     16        (ChromiumAndroidPort._path_to_forwarder): Original _path_to_helper().
     17        (ChromiumAndroidPort._push_executable):
     18        (ChromiumAndroidDriver.__init__):
     19        (ChromiumAndroidDriver.cmd_line):
     20
    1212012-07-09  Ojan Vafai  <ojan@chromium.org>
    222
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py

    r121812 r122251  
    5858DRT_APP_PACKAGE = 'org.chromium.native_test'
    5959DRT_ACTIVITY_FULL_NAME = DRT_APP_PACKAGE + '/.ChromeNativeTestActivity'
    60 DRT_APP_FILE_DIR = '/data/user/0/' + DRT_APP_PACKAGE + '/files/'
     60DRT_APP_DIR = '/data/user/0/' + DRT_APP_PACKAGE + '/'
     61DRT_APP_FILES_DIR = DRT_APP_DIR + 'files/'
     62DRT_APP_CACHE_DIR = DIR_APP_DIR + 'cache/'
    6163
    6264# This only works for single core devices so far.
     
    236238        pass
    237239
    238     def start_helper(self):
     240    def setup_test_run(self):
    239241        self._run_adb_command(['root'])
    240242        self._setup_performance()
     
    250252        self._synchronize_datetime()
    251253
     254        # Delete the disk cache if any to ensure a clean test run.
     255        # This is like what's done in ChromiumPort.setup_test_run but on the device.
     256        self._run_adb_command(['shell', 'rm', '-r', DEVICE_APP_CACHE_DIR])
     257
    252258        # Start the HTTP server so that the device can access the test cases.
    253259        chromium.ChromiumPort.start_http_server(self, additional_dirs={TEST_PATH_PREFIX: self.layout_tests_dir()})
    254260
    255261        _log.debug('Starting forwarder')
    256         cmd = self._run_adb_command(['shell', '%s %s' % (DEVICE_FORWARDER_PATH, FORWARD_PORTS)])
    257 
    258     def stop_helper(self):
     262        self._run_adb_command(['shell', '%s %s' % (DEVICE_FORWARDER_PATH, FORWARD_PORTS)])
     263
     264    def clean_up_test_run(self):
    259265        # Leave the forwarder and tests httpd server there because they are
    260266        # useful for debugging and do no harm to subsequent tests.
     
    285291
    286292    def _path_to_helper(self):
     293        return None
     294
     295    def _path_to_forwarder(self):
    287296        return self._build_path(self.get_option('configuration'), 'forwarder')
    288297
     
    321330    def _push_executable(self):
    322331        drt_host_path = self._path_to_driver()
    323         forwarder_host_path = self._path_to_helper()
     332        forwarder_host_path = self._path_to_forwarder()
    324333        host_stamp = int(float(max(os.stat(drt_host_path).st_mtime,
    325334                                   os.stat(forwarder_host_path).st_mtime)))
     
    453462    def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
    454463        chromium.ChromiumDriver.__init__(self, port, worker_number, pixel_tests, no_timeout)
    455         self._in_fifo_path = DRT_APP_FILE_DIR + 'DumpRenderTree.in'
    456         self._out_fifo_path = DRT_APP_FILE_DIR + 'DumpRenderTree.out'
    457         self._err_file_path = DRT_APP_FILE_DIR + 'DumpRenderTree.err'
     464        self._in_fifo_path = DRT_APP_FILES_DIR + 'DumpRenderTree.in'
     465        self._out_fifo_path = DRT_APP_FILES_DIR + 'DumpRenderTree.out'
     466        self._err_file_path = DRT_APP_FILES_DIR + 'DumpRenderTree.err'
    458467        self._restart_after_killed = False
    459468        self._read_fifo_proc = None
     
    468477        for param in original_cmd:
    469478            if param.startswith('--pixel-tests='):
    470                 self._device_image_path = DRT_APP_FILE_DIR + self._port.host.filesystem.basename(self._image_path)
     479                self._device_image_path = DRT_APP_FILES_DIR + self._port.host.filesystem.basename(self._image_path)
    471480                param = '--pixel-tests=' + self._device_image_path
    472481            cmd.append(param)
Note: See TracChangeset for help on using the changeset viewer.