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

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
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..8cfc5a549b9bd0557789d9f27e07153aae09f212 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 replace_path =
qyearsley 2017/03/20 17:40:00 There might be another slightly better name replac
yzshen1 2017/03/20 18:01:04 Done. I renamed it to "gen_directory_path".
+ test_config_->build_directory.Append(FILE_PATH_LITERAL("gen/"));
+ std::string utf8_path = replace_path.AsUTF8Unsafe();
+ std::string new_url =
+ std::string("file://") + utf8_path + utf8_url.substr(kGenPrefixLen);
+ return WebURL(GURL(new_url));
+ }
+
const char kPrefix[] = "file:///tmp/LayoutTests/";
const int kPrefixLen = arraysize(kPrefix) - 1;
« content/shell/common/layout_test.mojom ('K') | « content/shell/common/layout_test.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698