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

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

Issue 8772041: Remove deprecated TabContentsDelegate::OpenURLFromTab variant (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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/browser/tab_contents/page_navigator.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/render_view_host_manager_unittest.cc
diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc
index 4ab04189a822d81c36a02a22596f618109757a7f..b3692f229b6852feef14ceee92810f8bc85eae2c 100644
--- a/content/browser/tab_contents/render_view_host_manager_unittest.cc
+++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc
@@ -114,7 +114,7 @@ class RenderViewHostManagerTest : public RenderViewHostTestHarness {
// won't have committed yet, so NavigateAndCommit does the wrong thing
// for us.
controller().LoadURL(
- url, GURL(), content::PAGE_TRANSITION_LINK, std::string());
+ url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string());
TestRenderViewHost* old_rvh = rvh();
// Simulate the ShouldClose_ACK that is received from the current renderer
@@ -165,7 +165,8 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
// a RVH that's not pending (since there is no cross-site transition), so
// we use the committed one.
contents2.controller().LoadURL(
- kNtpUrl, GURL(), content::PAGE_TRANSITION_LINK, std::string());
+ kNtpUrl, content::Referrer(), content::PAGE_TRANSITION_LINK,
+ std::string());
TestRenderViewHost* ntp_rvh2 = static_cast<TestRenderViewHost*>(
contents2.render_manager_for_testing()->current_host());
EXPECT_FALSE(contents2.cross_navigation_pending());
@@ -174,7 +175,8 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
// The second one is the opposite, creating a cross-site transition and
// requiring a beforeunload ack.
contents2.controller().LoadURL(
- kDestUrl, GURL(), content::PAGE_TRANSITION_LINK, std::string());
+ kDestUrl, content::Referrer(), content::PAGE_TRANSITION_LINK,
+ std::string());
EXPECT_TRUE(contents2.cross_navigation_pending());
TestRenderViewHost* dest_rvh2 = static_cast<TestRenderViewHost*>(
contents2.render_manager_for_testing()->pending_render_view_host());
@@ -194,7 +196,8 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
NavigateActiveAndCommit(kNtpUrl);
contents2.controller().LoadURL(
- kNtpUrl, GURL(), content::PAGE_TRANSITION_LINK, std::string());
+ kNtpUrl, content::Referrer(), content::PAGE_TRANSITION_LINK,
+ std::string());
dest_rvh2->SendShouldCloseACK(true);
static_cast<TestRenderViewHost*>(contents2.render_manager_for_testing()->
pending_render_view_host())->SendNavigate(102, kNtpUrl);
@@ -223,7 +226,7 @@ TEST_F(RenderViewHostManagerTest, AlwaysSendEnableViewSourceMode) {
// Navigate.
controller().LoadURL(
- kUrl, GURL(), content::PAGE_TRANSITION_TYPED, std::string());
+ kUrl, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string());
// Simulate response from RenderView for FirePageBeforeUnload.
rvh()->TestOnMessageReceived(
ViewHostMsg_ShouldClose_ACK(rvh()->routing_id(), true));
@@ -244,7 +247,7 @@ TEST_F(RenderViewHostManagerTest, AlwaysSendEnableViewSourceMode) {
process()->sink().ClearMessages();
// Navigate, again.
controller().LoadURL(
- kUrl, GURL(), content::PAGE_TRANSITION_TYPED, std::string());
+ kUrl, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string());
// The same RenderViewHost should be reused.
EXPECT_FALSE(pending_rvh());
EXPECT_TRUE(last_rvh == rvh());
@@ -297,7 +300,7 @@ TEST_F(RenderViewHostManagerTest, Navigate) {
// 1) The first navigation. --------------------------
const GURL kUrl1("http://www.google.com/");
NavigationEntry entry1(NULL /* instance */, -1 /* page_id */, kUrl1,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
host = manager.Navigate(entry1);
@@ -316,10 +319,11 @@ TEST_F(RenderViewHostManagerTest, Navigate) {
// 2) Navigate to next site. -------------------------
const GURL kUrl2("http://www.google.com/foo");
- NavigationEntry entry2(NULL /* instance */, -1 /* page_id */, kUrl2,
- kUrl1 /* referrer */, string16() /* title */,
- content::PAGE_TRANSITION_LINK,
- true /* is_renderer_init */);
+ NavigationEntry entry2(
+ NULL /* instance */, -1 /* page_id */, kUrl2,
+ content::Referrer(kUrl1, WebKit::WebReferrerPolicyDefault),
+ string16() /* title */, content::PAGE_TRANSITION_LINK,
+ true /* is_renderer_init */);
host = manager.Navigate(entry2);
// The RenderViewHost created in Init will be reused.
@@ -334,10 +338,11 @@ TEST_F(RenderViewHostManagerTest, Navigate) {
// 3) Cross-site navigate to next site. --------------
const GURL kUrl3("http://webkit.org/");
- NavigationEntry entry3(NULL /* instance */, -1 /* page_id */, kUrl3,
- kUrl2 /* referrer */, string16() /* title */,
- content::PAGE_TRANSITION_LINK,
- false /* is_renderer_init */);
+ NavigationEntry entry3(
+ NULL /* instance */, -1 /* page_id */, kUrl3,
+ content::Referrer(kUrl2, WebKit::WebReferrerPolicyDefault),
+ string16() /* title */, content::PAGE_TRANSITION_LINK,
+ false /* is_renderer_init */);
host = manager.Navigate(entry3);
// A new RenderViewHost should be created.
@@ -381,7 +386,7 @@ TEST_F(RenderViewHostManagerTest, NavigateWithEarlyReNavigation) {
// 1) The first navigation. --------------------------
const GURL kUrl1("http://www.google.com/");
NavigationEntry entry1(NULL /* instance */, -1 /* page_id */, kUrl1,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderViewHost* host = manager.Navigate(entry1);
@@ -407,7 +412,7 @@ TEST_F(RenderViewHostManagerTest, NavigateWithEarlyReNavigation) {
// 2) Cross-site navigate to next site. -------------------------
const GURL kUrl2("http://www.example.com");
NavigationEntry entry2(NULL /* instance */, -1 /* page_id */, kUrl2,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderViewHost* host2 = manager.Navigate(entry2);
@@ -455,7 +460,7 @@ TEST_F(RenderViewHostManagerTest, NavigateWithEarlyReNavigation) {
// 3) Cross-site navigate to next site before 2) has committed. --------------
const GURL kUrl3("http://webkit.org/");
NavigationEntry entry3(NULL /* instance */, -1 /* page_id */, kUrl3,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderViewHost* host3 = manager.Navigate(entry3);
@@ -507,7 +512,7 @@ TEST_F(RenderViewHostManagerTest, WebUI) {
const GURL kUrl(chrome::kTestNewTabURL);
NavigationEntry entry(NULL /* instance */, -1 /* page_id */, kUrl,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderViewHost* host = manager.Navigate(entry);
@@ -546,14 +551,14 @@ TEST_F(RenderViewHostManagerTest, NonWebUIChromeURLs) {
// NTP is a Web UI page.
const GURL kNtpUrl(chrome::kTestNewTabURL);
NavigationEntry ntp_entry(NULL /* instance */, -1 /* page_id */, kNtpUrl,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
// A URL with the Chrome UI scheme, that isn't handled by Web UI.
GURL about_url(kChromeUISchemeButNotWebUIURL);
NavigationEntry about_entry(NULL /* instance */, -1 /* page_id */, about_url,
- GURL() /* referrer */, string16() /* title */,
+ content::Referrer(), string16() /* title */,
content::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
« no previous file with comments | « content/browser/tab_contents/page_navigator.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698