| 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 */);
|
|
|
|
|