| Index: content/shell/renderer/layout_test/blink_test_runner.cc
|
| diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
|
| index adee3a939ca936178f05ad598e6f7abff7e8e23b..2fae9f4272effa19482969f8e4d59cd8870bade6 100644
|
| --- a/content/shell/renderer/layout_test/blink_test_runner.cc
|
| +++ b/content/shell/renderer/layout_test/blink_test_runner.cc
|
| @@ -218,12 +218,15 @@ class MockAudioCapturerSource : public media::AudioCapturerSource {
|
| ~MockAudioCapturerSource() override {}
|
| };
|
|
|
| -// Tests in web-platform-tests use absolute path links such as
|
| +// Tests in csswg-test use absolute path links such as
|
| // <script src="/resources/testharness.js">.
|
| // Because we load the tests as local files, such links don't work.
|
| // This function fixes this issue by rewriting file: URLs which were produced
|
| -// from such links so that they point actual files in wpt/.
|
| -WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) {
|
| +// from such links so that they point actual files in LayoutTests/resources/.
|
| +//
|
| +// Note that this isn't applied to external/wpt because tests in external/wpt
|
| +// are accessed via http.
|
| +WebURL RewriteAbsolutePathInCsswgTest(const std::string& utf8_url) {
|
| const char kFileScheme[] = "file:///";
|
| const int kFileSchemeLen = arraysize(kFileScheme) - 1;
|
| if (utf8_url.compare(0, kFileSchemeLen, kFileScheme, kFileSchemeLen) != 0)
|
| @@ -242,7 +245,7 @@ WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) {
|
| base::FilePath new_path =
|
| LayoutTestRenderThreadObserver::GetInstance()
|
| ->webkit_source_dir()
|
| - .Append(FILE_PATH_LITERAL("LayoutTests/external/wpt/"))
|
| + .Append(FILE_PATH_LITERAL("LayoutTests/"))
|
| .AppendASCII(path);
|
| return WebURL(net::FilePathToFileURL(new_path));
|
| }
|
| @@ -355,7 +358,7 @@ WebURL BlinkTestRunner::LocalFileToDataURL(const WebURL& file_url) {
|
| WebURL BlinkTestRunner::RewriteLayoutTestsURL(const std::string& utf8_url,
|
| bool is_wpt_mode) {
|
| if (is_wpt_mode) {
|
| - WebURL rewritten_url = RewriteAbsolutePathInWPT(utf8_url);
|
| + WebURL rewritten_url = RewriteAbsolutePathInCsswgTest(utf8_url);
|
| if (!rewritten_url.isEmpty())
|
| return rewritten_url;
|
| return WebURL(GURL(utf8_url));
|
|
|