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

Unified Diff: content/browser/web_contents/test_web_contents.cc

Issue 10171018: Create swapped-out opener RVHs after a process swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove parameter comments. Created 8 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
Index: content/browser/web_contents/test_web_contents.cc
diff --git a/content/browser/web_contents/test_web_contents.cc b/content/browser/web_contents/test_web_contents.cc
index 69e22e43348f96f4ba01bb2ba7b57538ddf440bf..c5bf1fbea4109018d5add3c2422a71d2dfd3a59a 100644
--- a/content/browser/web_contents/test_web_contents.cc
+++ b/content/browser/web_contents/test_web_contents.cc
@@ -12,6 +12,9 @@
#include "content/browser/site_instance_impl.h"
#include "content/browser/web_contents/navigation_entry_impl.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/notification_source.h"
+#include "content/public/browser/notification_types.h"
#include "content/public/common/page_transition_types.h"
#include "content/test/mock_render_process_host.h"
#include "webkit/forms/password_form.h"
@@ -21,7 +24,8 @@ namespace content {
TestWebContents::TestWebContents(BrowserContext* browser_context,
SiteInstance* instance)
- : WebContentsImpl(browser_context, instance, MSG_ROUTING_NONE, NULL, NULL),
+ : WebContentsImpl(browser_context, instance, MSG_ROUTING_NONE, NULL, NULL,
+ NULL),
transition_cross_site(false),
delegate_view_override_(NULL),
expect_set_history_length_and_prune_(false),
@@ -83,10 +87,10 @@ WebPreferences TestWebContents::TestGetWebkitPrefs() {
}
bool TestWebContents::CreateRenderViewForRenderManager(
- RenderViewHost* render_view_host) {
+ RenderViewHost* render_view_host, int opener_route_id) {
// This will go to a TestRenderViewHost.
static_cast<RenderViewHostImpl*>(
- render_view_host)->CreateRenderView(string16(), -1);
+ render_view_host)->CreateRenderView(string16(), opener_route_id, -1);
return true;
}
@@ -156,6 +160,14 @@ RenderViewHostDelegate::View* TestWebContents::GetViewDelegate() {
return WebContentsImpl::GetViewDelegate();
}
+void TestWebContents::SetOpener(TestWebContents* opener) {
+ // This is normally only set in the WebContents constructor, which also
+ // registers an observer for when the opener gets closed.
+ opener_ = opener;
+ registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
+ content::Source<WebContents>(opener_));
+}
+
void TestWebContents::ExpectSetHistoryLengthAndPrune(
const SiteInstance* site_instance,
int history_length,
« no previous file with comments | « content/browser/web_contents/test_web_contents.h ('k') | content/browser/web_contents/web_contents_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698