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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « content/shell/common/layout_test.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <clocale> 10 #include <clocale>
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 WebURL BlinkTestRunner::RewriteLayoutTestsURL(const std::string& utf8_url, 362 WebURL BlinkTestRunner::RewriteLayoutTestsURL(const std::string& utf8_url,
363 bool is_wpt_mode) { 363 bool is_wpt_mode) {
364 if (is_wpt_mode) { 364 if (is_wpt_mode) {
365 WebURL rewritten_url = RewriteAbsolutePathInCsswgTest(utf8_url); 365 WebURL rewritten_url = RewriteAbsolutePathInCsswgTest(utf8_url);
366 if (!rewritten_url.isEmpty()) 366 if (!rewritten_url.isEmpty())
367 return rewritten_url; 367 return rewritten_url;
368 return WebURL(GURL(utf8_url)); 368 return WebURL(GURL(utf8_url));
369 } 369 }
370 370
371 const char kGenPrefix[] = "file:///gen/";
372 const int kGenPrefixLen = arraysize(kGenPrefix) - 1;
373
374 // Map "file:///gen/" to "file://<build directory>/gen/".
375 if (!utf8_url.compare(0, kGenPrefixLen, kGenPrefix, kGenPrefixLen)) {
376 base::FilePath gen_directory_path =
377 test_config_->build_directory.Append(FILE_PATH_LITERAL("gen/"));
378 std::string new_url = std::string("file://") +
379 gen_directory_path.AsUTF8Unsafe() +
380 utf8_url.substr(kGenPrefixLen);
381 return WebURL(GURL(new_url));
382 }
383
371 const char kPrefix[] = "file:///tmp/LayoutTests/"; 384 const char kPrefix[] = "file:///tmp/LayoutTests/";
372 const int kPrefixLen = arraysize(kPrefix) - 1; 385 const int kPrefixLen = arraysize(kPrefix) - 1;
373 386
374 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) 387 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen))
375 return WebURL(GURL(utf8_url)); 388 return WebURL(GURL(utf8_url));
376 389
377 base::FilePath replace_path = 390 base::FilePath replace_path =
378 LayoutTestRenderThreadObserver::GetInstance()->webkit_source_dir() 391 LayoutTestRenderThreadObserver::GetInstance()->webkit_source_dir()
379 .Append(FILE_PATH_LITERAL("LayoutTests/")); 392 .Append(FILE_PATH_LITERAL("LayoutTests/"));
380 std::string utf8_path = replace_path.AsUTF8Unsafe(); 393 std::string utf8_path = replace_path.AsUTF8Unsafe();
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 void BlinkTestRunner::ReportLeakDetectionResult( 1048 void BlinkTestRunner::ReportLeakDetectionResult(
1036 const LeakDetectionResult& report) { 1049 const LeakDetectionResult& report) {
1037 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1050 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1038 } 1051 }
1039 1052
1040 void BlinkTestRunner::OnDestruct() { 1053 void BlinkTestRunner::OnDestruct() {
1041 delete this; 1054 delete this;
1042 } 1055 }
1043 1056
1044 } // namespace content 1057 } // namespace content
OLDNEW
« 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