Chromium Code Reviews| 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..8b6a625427e110bb3dfbb758f7df1e58d5e526fa 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 imported/wpt because tests in imported/wpt |
|
qyearsley
2017/01/19 18:00:33
imported -> external
tkent
2017/01/19 23:49:59
Done.
|
| +// 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/")) |
|
qyearsley
2017/01/19 18:00:33
What does this change do?
tkent
2017/01/19 23:49:59
This CL removes LayoutTests/external/wpt/resources
qyearsley
2017/01/20 00:04:46
Ah - so if the input utf8_url is "file:///resource
tkent
2017/01/20 02:14:04
Right.
|
| .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)); |