Copy dictionary to the external storage before running layout test on android
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 22:46:57 +0000 (22:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 22:46:57 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111480

Patch by Min Qin <qinmin@chromium.org> on 2013-03-05
Reviewed by Adam Barth.

TestWebKitPlatformSupport now needs to read an external dictionary file.
This file does not exist on the device. We need to copy it before running layout tests.

* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidDriver._setup_md5sum_and_push_data_if_needed):
(ChromiumAndroidDriver._push_platform_resources):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144822 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py

index 16a5d6f..4719033 100644 (file)
@@ -1,3 +1,17 @@
+2013-03-05  Min Qin  <qinmin@chromium.org>
+
+        Copy dictionary to the external storage before running layout test on android
+        https://bugs.webkit.org/show_bug.cgi?id=111480
+
+        Reviewed by Adam Barth.
+
+        TestWebKitPlatformSupport now needs to read an external dictionary file.
+        This file does not exist on the device. We need to copy it before running layout tests.
+
+        * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+        (ChromiumAndroidDriver._setup_md5sum_and_push_data_if_needed):
+        (ChromiumAndroidDriver._push_platform_resources):
+
 2013-03-05  Dirk Pranke  <dpranke@chromium.org>
 
         [chromium] DRT crashes in an Aura/Win build
index ea2e9cb..b095463 100644 (file)
@@ -150,6 +150,11 @@ TEST_RESOURCES_TO_PUSH = [
     'compositing/resources/video.mp4',
 ]
 
+# List of test resources from webkit platform. These resources will be copied to the external storage.
+WEBKIT_PLATFORM_RESOURCES_TO_PUSH = [
+    'third_party/hyphen/hyph_en_US.dic',
+]
+
 MD5SUM_DEVICE_FILE_NAME = 'md5sum_bin'
 MD5SUM_DEVICE_PATH = '/data/local/tmp/' + MD5SUM_DEVICE_FILE_NAME
 
@@ -571,6 +576,7 @@ class ChromiumAndroidDriver(driver.Driver):
         self._push_executable()
         self._push_fonts()
         self._push_test_resources()
+        self._push_platform_resources()
 
     def _setup_test(self):
         if self._has_setup:
@@ -647,6 +653,12 @@ class ChromiumAndroidDriver(driver.Driver):
         for resource in TEST_RESOURCES_TO_PUSH:
             self._push_file_if_needed(self._port.layout_tests_dir() + '/' + resource, DEVICE_LAYOUT_TESTS_DIR + resource)
 
+    def _push_platform_resources(self):
+        self._log_debug('Pushing platform resources')
+        external_storage = self._port._filesystem.join(self._run_adb_command(['shell', 'echo $EXTERNAL_STORAGE']).strip(), 'Source', 'WebKit', 'chromium')
+        for resource in WEBKIT_PLATFORM_RESOURCES_TO_PUSH:
+            self._push_file_if_needed(self._port._chromium_base_dir(self._port._filesystem) + '/' + resource, external_storage + '/' + resource)
+
     def _restart_adb_as_root(self):
         output = self._run_adb_command(['root'])
         if 'adbd is already running as root' in output: