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

Unified Diff: chrome/browser/tab_contents/render_view_host_manager_unittest.cc

Issue 67201: Fix the process creation problem. This forces transitions between... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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: chrome/browser/tab_contents/render_view_host_manager_unittest.cc
===================================================================
--- chrome/browser/tab_contents/render_view_host_manager_unittest.cc (revision 0)
+++ chrome/browser/tab_contents/render_view_host_manager_unittest.cc (revision 0)
@@ -0,0 +1,49 @@
+// Copyright (c) 2009 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 "chrome/browser/renderer_host/test_render_view_host.h"
+#include "chrome/common/url_constants.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class RenderViewHostManagerTest : public RenderViewHostTestHarness {
+
+};
+
+// Tests that when you navigate from the New TabPage to another page, and
+// then do that sam ething in another tab, that the two resulting pages have
Charlie Reis 2009/04/16 22:00:56 Typo: same thing
+// different SiteInstances, BrowsingInstances, and RenderProcessHosts. This is
+// a regression test for bug 9364.
+TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
+ GURL ntp(chrome::kChromeUINewTabURL);
+ GURL dest("http://www.google.com/");
+
+ // Navigate our first tab to the new tab page and then to the destination.
+ NavigateAndCommit(ntp);
+ NavigateAndCommit(dest);
+
+ // Make a second tab.
+ WebContents* contents2 = new TestWebContents(profile_.get(), NULL);
+ NavigationController* controller2 =
+ new NavigationController(contents2, profile_.get());
+ contents2->set_controller(controller2);
+
+ // Load the two URLs in the second tab. Note that the first situation create
Charlie Reis 2009/04/16 22:00:56 "situation create" -> "navigation creates" (I was
+ // a RVH that's not pending (since there is no cross-site transition), so
+ // we use the committed one, but the second one is the opposite.
+ contents2->controller()->LoadURL(ntp, GURL(), PageTransition::LINK);
+ static_cast<TestRenderViewHost*>(contents2->render_manager()->
+ current_host())->SendNavigate(100, ntp);
+ contents2->controller()->LoadURL(dest, GURL(), PageTransition::LINK);
+ static_cast<TestRenderViewHost*>(contents2->render_manager()->
+ pending_render_view_host())->SendNavigate(101, dest);
+
+ // The two RVH's should be different in every way.
+ EXPECT_NE(rvh()->process(), contents2->render_view_host()->process());
+ EXPECT_NE(rvh()->site_instance(),
+ contents2->render_view_host()->site_instance());
+ EXPECT_NE(rvh()->site_instance()->browsing_instance(),
+ contents2->render_view_host()->site_instance()->browsing_instance());
+
+ contents2->CloseContents();
+}
Property changes on: chrome\browser\tab_contents\render_view_host_manager_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698