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

Unified Diff: content/shell/browser/layout_test/blink_test_controller.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 | « no previous file | content/shell/common/layout_test.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/layout_test/blink_test_controller.cc
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
index 26fa29fd0fc6fafe0159db72446658f10ae7171b..9065a72f514140b0deb5c00c200e286cbf3c0f19 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -16,6 +16,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
@@ -55,6 +56,10 @@
#include "content/shell/renderer/layout_test/blink_test_helpers.h"
#include "ui/gfx/codec/png_codec.h"
+#if defined(OS_MACOSX)
+#include "base/mac/foundation_util.h"
+#endif
+
namespace content {
namespace {
@@ -62,6 +67,21 @@ namespace {
const int kTestSVGWindowWidthDip = 480;
const int kTestSVGWindowHeightDip = 360;
+base::FilePath GetBuildDirectory() {
+ base::FilePath result;
+ base::PathService::Get(base::DIR_EXE, &result);
+
+#if defined(OS_MACOSX)
+ if (base::mac::AmIBundled()) {
+ // The bundled app executables (Chromium, TestShell, etc) live three
+ // levels down from the build directory, eg:
+ // Chromium.app/Contents/MacOS/Chromium
+ result = result.DirName().DirName().DirName();
+ }
+#endif
+ return result;
+}
+
} // namespace
// BlinkTestResultPrinter ----------------------------------------------------
@@ -618,6 +638,7 @@ void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) {
params->allow_external_pages = false;
params->current_working_directory = current_working_directory_;
params->temp_path = temp_path_;
+ params->build_directory = GetBuildDirectory();
params->test_url = test_url_;
params->enable_pixel_dumping = enable_pixel_dumping_;
params->allow_external_pages =
« no previous file with comments | « no previous file | content/shell/common/layout_test.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698