Commit 13e562fd authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Fix bunch of web test failures on Android and Fuchsia

On Android and Fuchsia, all of web tests are accessed via http, and
'LayoutTests' was prepended to their URLs even after the Great Blink mv.
It should be updated to 'web_tests' because some tests find test root
directory by searching for 'web_tests', and test_runner changes its
behavior by checking path names in a URL [1].

[1] https://cs.chromium.org/chromium/src/content/shell/test_runner/test_interfaces.cc?type=cs&sq=package:chromium&g=0&l=35

TBR=qyesrsley@chromium.org

No-Try: true
Bug: 909012
Change-Id: Ia4a45238d55248d2fc6c06b56c3878aa0a38d8a3
Reviewed-on: https://chromium-review.googlesource.com/c/1352118Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611454}
parent 0ff634b6
...@@ -37,6 +37,7 @@ import time ...@@ -37,6 +37,7 @@ import time
from blinkpy.common import exit_codes from blinkpy.common import exit_codes
from blinkpy.common.path_finder import RELATIVE_WEB_TESTS from blinkpy.common.path_finder import RELATIVE_WEB_TESTS
from blinkpy.common.path_finder import WEB_TESTS_LAST_COMPONENT
from blinkpy.common.path_finder import get_chromium_src_dir from blinkpy.common.path_finder import get_chromium_src_dir
from blinkpy.common.system.executive import ScriptError from blinkpy.common.system.executive import ScriptError
from blinkpy.common.system.profiler import SingleFileOutputProfiler from blinkpy.common.system.profiler import SingleFileOutputProfiler
...@@ -112,8 +113,11 @@ KPTR_RESTRICT_PATH = '/proc/sys/kernel/kptr_restrict' ...@@ -112,8 +113,11 @@ KPTR_RESTRICT_PATH = '/proc/sys/kernel/kptr_restrict'
# but we use a file-to-http feature to bridge the file request to host's http # but we use a file-to-http feature to bridge the file request to host's http
# server to get the real test files and corresponding resources. # server to get the real test files and corresponding resources.
# See webkit/support/platform_support_android.cc for the other side of this bridge. # See webkit/support/platform_support_android.cc for the other side of this bridge.
# WEB_TEST_PATH_PREFIX should be matched to the local directory name of
# web_tests because some tests and test_runner find test root directory
# with it.
PERF_TEST_PATH_PREFIX = '/PerformanceTests' PERF_TEST_PATH_PREFIX = '/PerformanceTests'
LAYOUT_TEST_PATH_PREFIX = '/LayoutTests' WEB_TESTS_PATH_PREFIX = '/' + WEB_TESTS_LAST_COMPONENT
# We start netcat processes for each of the three stdio streams. In doing so, # We start netcat processes for each of the three stdio streams. In doing so,
# we attempt to use ports starting from 10201. This starting value is # we attempt to use ports starting from 10201. This starting value is
...@@ -469,7 +473,7 @@ class AndroidPort(base.Port): ...@@ -469,7 +473,7 @@ class AndroidPort(base.Port):
def start_http_server(self, additional_dirs, number_of_drivers): def start_http_server(self, additional_dirs, number_of_drivers):
additional_dirs[PERF_TEST_PATH_PREFIX] = self._perf_tests_dir() additional_dirs[PERF_TEST_PATH_PREFIX] = self._perf_tests_dir()
additional_dirs[LAYOUT_TEST_PATH_PREFIX] = self.layout_tests_dir() additional_dirs[WEB_TESTS_PATH_PREFIX] = self.layout_tests_dir()
super(AndroidPort, self).start_http_server(additional_dirs, number_of_drivers) super(AndroidPort, self).start_http_server(additional_dirs, number_of_drivers)
def create_driver(self, worker_number, no_timeout=False): def create_driver(self, worker_number, no_timeout=False):
......
...@@ -35,6 +35,7 @@ import sys ...@@ -35,6 +35,7 @@ import sys
import threading import threading
from blinkpy.common import exit_codes from blinkpy.common import exit_codes
from blinkpy.common.path_finder import WEB_TESTS_LAST_COMPONENT
from blinkpy.common.path_finder import get_chromium_src_dir from blinkpy.common.path_finder import get_chromium_src_dir
from blinkpy.web_tests.port import base from blinkpy.web_tests.port import base
from blinkpy.web_tests.port import driver from blinkpy.web_tests.port import driver
...@@ -70,9 +71,12 @@ def _import_fuchsia_runner(): ...@@ -70,9 +71,12 @@ def _import_fuchsia_runner():
# Path to the content shell package relative to the build directory. # Path to the content shell package relative to the build directory.
CONTENT_SHELL_PACKAGE_PATH = 'gen/content/shell/content_shell/content_shell.far' CONTENT_SHELL_PACKAGE_PATH = 'gen/content/shell/content_shell/content_shell.far'
# HTTP path prefix for the HTTP server. # HTTP path prefixes for the HTTP server.
# WEB_TEST_PATH_PREFIX should be matched to the local directory name of
# web_tests because some tests and test_runner find test root directory
# with it.
PERF_TEST_PATH_PREFIX = '/PerformanceTests' PERF_TEST_PATH_PREFIX = '/PerformanceTests'
LAYOUT_TEST_PATH_PREFIX = '/LayoutTests' WEB_TESTS_PATH_PREFIX = '/' + WEB_TESTS_LAST_COMPONENT
# Paths to the directory where the fonts are copied to. Must match the path in # Paths to the directory where the fonts are copied to. Must match the path in
# content/shell/app/blink_test_platform_support_fuchsia.cc . # content/shell/app/blink_test_platform_support_fuchsia.cc .
...@@ -245,7 +249,7 @@ class FuchsiaPort(base.Port): ...@@ -245,7 +249,7 @@ class FuchsiaPort(base.Port):
def start_http_server(self, additional_dirs, number_of_drivers): def start_http_server(self, additional_dirs, number_of_drivers):
additional_dirs[PERF_TEST_PATH_PREFIX] = self._perf_tests_dir() additional_dirs[PERF_TEST_PATH_PREFIX] = self._perf_tests_dir()
additional_dirs[LAYOUT_TEST_PATH_PREFIX] = self.layout_tests_dir() additional_dirs[WEB_TESTS_PATH_PREFIX] = self.layout_tests_dir()
super(FuchsiaPort, self).start_http_server( super(FuchsiaPort, self).start_http_server(
additional_dirs, number_of_drivers) additional_dirs, number_of_drivers)
......
Default policy for navigation to 'http://127.0.0.1:8000/LayoutTests/fast/events/blank' is 'new background tab' Default policy for navigation to 'http://127.0.0.1:8000/web_tests/fast/events/blank' is 'new background tab'
Tests that hitting ctrl-enter on a link with target=_blank still opens it in the background Tests that hitting ctrl-enter on a link with target=_blank still opens it in the background
link link
Default policy for navigation to 'http://127.0.0.1:8000/LayoutTests/fast/events/blank' is 'new background tab' Default policy for navigation to 'http://127.0.0.1:8000/web_tests/fast/events/blank' is 'new background tab'
Tests that hitting ctrl-enter on a link with target=_blank still opens it in the background Tests that hitting ctrl-enter on a link with target=_blank still opens it in the background
link link
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment