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

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

Issue 2594913002: Replace IPC messages in layout_test_render_frame_observer. (Closed)
Patch Set: Replace ShellTestConfiguration with mojo construct Created 3 years, 11 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 155cff00948f4133540634676bb2e876af421217..c9de12db9852b2a608a339379ba266a3f9487e0b 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -329,7 +329,7 @@ WebString BlinkTestRunner::GetAbsoluteWebStringFromUTF8Path(
base::FilePath path = base::FilePath::FromUTF8Unsafe(utf8_path);
if (!path.IsAbsolute()) {
GURL base_url =
- net::FilePathToFileURL(test_config_.current_working_directory.Append(
+ net::FilePathToFileURL(test_config_->current_working_directory.Append(
FILE_PATH_LITERAL("foo")));
net::FileURLToFilePath(base_url.Resolve(utf8_path), &path);
}
@@ -565,7 +565,7 @@ std::string BlinkTestRunner::PathToLocalResource(const std::string& resource) {
#if defined(OS_WIN)
if (base::StartsWith(resource, "/tmp/", base::CompareCase::SENSITIVE)) {
// We want a temp file.
- GURL base_url = net::FilePathToFileURL(test_config_.temp_path);
+ GURL base_url = net::FilePathToFileURL(test_config_->temp_path);
return base_url.Resolve(resource.substr(sizeof("/tmp/") - 1)).spec();
}
#endif
@@ -645,7 +645,7 @@ void BlinkTestRunner::LoadURLForFrame(const WebURL& url,
}
bool BlinkTestRunner::AllowExternalPages() {
- return test_config_.allow_external_pages;
+ return test_config_->allow_external_pages;
}
std::string BlinkTestRunner::DumpHistoryForWindow(blink::WebView* web_view) {
@@ -893,7 +893,7 @@ void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) {
void BlinkTestRunner::CaptureDumpContinued() {
test_runner::WebTestInterfaces* interfaces =
LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();
- if (test_config_.enable_pixel_dumping &&
+ if (test_config_->enable_pixel_dumping &&
interfaces->TestRunner()->ShouldGeneratePixelResults() &&
!interfaces->TestRunner()->ShouldDumpAsAudio()) {
CHECK(render_view()->GetWebView()->isAcceleratedCompositingActive());
@@ -920,7 +920,7 @@ void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) {
base::MD5Sum(snapshot.getPixels(), snapshot.getSize(), &digest);
std::string actual_pixel_hash = base::MD5DigestToBase16(digest);
- if (actual_pixel_hash == test_config_.expected_pixel_hash) {
+ if (actual_pixel_hash == test_config_->expected_pixel_hash) {
SkBitmap empty_image;
Send(new ShellViewHostMsg_ImageDump(
routing_id(), actual_pixel_hash, empty_image));
@@ -958,27 +958,26 @@ void BlinkTestRunner::OnSetupSecondaryRenderer() {
}
void BlinkTestRunner::OnReplicateTestConfiguration(
- const ShellTestConfiguration& params) {
+ const mojom::ShellTestConfigurationPtr& params) {
test_runner::WebTestInterfaces* interfaces =
LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();
- test_config_ = params;
+ test_config_ = params.Clone();
is_main_window_ = true;
interfaces->SetMainView(render_view()->GetWebView());
interfaces->SetTestIsRunning(true);
- interfaces->ConfigureForTestWithURL(params.test_url,
- params.enable_pixel_dumping);
+ interfaces->ConfigureForTestWithURL(params->test_url,
+ params->enable_pixel_dumping);
}
void BlinkTestRunner::OnSetTestConfiguration(
- const ShellTestConfiguration& params) {
+ const mojom::ShellTestConfigurationPtr& params) {
OnReplicateTestConfiguration(params);
- ForceResizeRenderView(
- render_view(),
- WebSize(params.initial_size.width(), params.initial_size.height()));
+ ForceResizeRenderView(render_view(), WebSize(params->initial_size.width(),
+ params->initial_size.height()));
LayoutTestRenderThreadObserver::GetInstance()
->test_interfaces()
->TestRunner()

Powered by Google App Engine
This is Rietveld 408576698