Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1097)

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 2759803002: Layout tests: Enable fetching generated files from the build directory (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/common/layout_test.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8e04816bc786ab8ddf5a7674d0119bf7bb314d60..a2766e367af5878d7f7b45373260f91faeb575e3 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -368,6 +368,19 @@ WebURL BlinkTestRunner::RewriteLayoutTestsURL(const std::string& utf8_url,
return WebURL(GURL(utf8_url));
}
+ const char kGenPrefix[] = "file:///gen/";
+ const int kGenPrefixLen = arraysize(kGenPrefix) - 1;
+
+ // Map "file:///gen/" to "file://<build directory>/gen/".
+ if (!utf8_url.compare(0, kGenPrefixLen, kGenPrefix, kGenPrefixLen)) {
+ base::FilePath gen_directory_path =
+ test_config_->build_directory.Append(FILE_PATH_LITERAL("gen/"));
+ std::string new_url = std::string("file://") +
+ gen_directory_path.AsUTF8Unsafe() +
+ utf8_url.substr(kGenPrefixLen);
+ return WebURL(GURL(new_url));
+ }
+
const char kPrefix[] = "file:///tmp/LayoutTests/";
const int kPrefixLen = arraysize(kPrefix) - 1;
« no previous file with comments | « content/shell/common/layout_test.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698