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

Unified Diff: content/shell/browser/layout_test/secondary_test_window_observer.cc

Issue 1890223002: Explicitly initialize secondary renderers for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 4 years, 8 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/browser/layout_test/secondary_test_window_observer.h ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/layout_test/secondary_test_window_observer.cc
diff --git a/content/shell/browser/layout_test/notify_done_forwarder.cc b/content/shell/browser/layout_test/secondary_test_window_observer.cc
similarity index 35%
rename from content/shell/browser/layout_test/notify_done_forwarder.cc
rename to content/shell/browser/layout_test/secondary_test_window_observer.cc
index b9213938da28cd98a06617ea698c5e323e782699..b7bb567bb6e9357d443407c23ae56794ca496abe 100644
--- a/content/shell/browser/layout_test/notify_done_forwarder.cc
+++ b/content/shell/browser/layout_test/secondary_test_window_observer.cc
@@ -1,24 +1,26 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/browser/layout_test/notify_done_forwarder.h"
+#include "content/shell/browser/layout_test/secondary_test_window_observer.h"
#include "content/shell/browser/layout_test/blink_test_controller.h"
#include "content/shell/common/shell_messages.h"
namespace content {
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(NotifyDoneForwarder);
+DEFINE_WEB_CONTENTS_USER_DATA_KEY(SecondaryTestWindowObserver);
-NotifyDoneForwarder::NotifyDoneForwarder(WebContents* web_contents)
+SecondaryTestWindowObserver::SecondaryTestWindowObserver(
+ WebContents* web_contents)
: WebContentsObserver(web_contents) {}
-NotifyDoneForwarder::~NotifyDoneForwarder() {}
+SecondaryTestWindowObserver::~SecondaryTestWindowObserver() {}
-bool NotifyDoneForwarder::OnMessageReceived(const IPC::Message& message) {
+bool SecondaryTestWindowObserver::OnMessageReceived(
+ const IPC::Message& message) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(NotifyDoneForwarder, message)
+ IPC_BEGIN_MESSAGE_MAP(SecondaryTestWindowObserver, message)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinishedInSecondaryRenderer,
OnTestFinishedInSecondaryRenderer)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -26,8 +28,23 @@ bool NotifyDoneForwarder::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void NotifyDoneForwarder::OnTestFinishedInSecondaryRenderer() {
+void SecondaryTestWindowObserver::OnTestFinishedInSecondaryRenderer() {
BlinkTestController::Get()->TestFinishedInSecondaryRenderer();
}
+void SecondaryTestWindowObserver::RenderFrameCreated(
+ RenderFrameHost* render_frame_host) {
+ DCHECK(!BlinkTestController::Get()->IsMainWindow(
+ WebContents::FromRenderFrameHost(render_frame_host)));
+ BlinkTestController::Get()->HandleNewRenderFrameHost(render_frame_host);
+}
+
+void SecondaryTestWindowObserver::RenderFrameHostChanged(
+ RenderFrameHost* old_host,
+ RenderFrameHost* new_host) {
+ DCHECK(!BlinkTestController::Get()->IsMainWindow(
+ WebContents::FromRenderFrameHost(new_host)));
+ BlinkTestController::Get()->HandleNewRenderFrameHost(new_host);
+}
+
} // namespace content
« no previous file with comments | « content/shell/browser/layout_test/secondary_test_window_observer.h ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698