| Index: content/browser/web_contents/web_contents_impl_unittest.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
|
| index 1a907b1a8bc6c3085c56c6d74ce34ab7e4cea873..3355c1594939262c32ec4d6f278e6cda5898b096 100644
|
| --- a/content/browser/web_contents/web_contents_impl_unittest.cc
|
| +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
|
| @@ -156,9 +156,9 @@ class TestInterstitialPage : public InterstitialPageImpl {
|
| CommandReceived();
|
| }
|
|
|
| - void TestDidNavigate(int page_id, const GURL& url) {
|
| + void TestDidNavigate(const GURL& url) {
|
| FrameHostMsg_DidCommitProvisionalLoad_Params params;
|
| - InitNavigateParams(¶ms, page_id, url, ui::PAGE_TRANSITION_TYPED);
|
| + InitNavigateParams(¶ms, url, ui::PAGE_TRANSITION_TYPED);
|
| DidNavigate(GetRenderViewHostForTesting(), params);
|
| }
|
|
|
| @@ -343,10 +343,10 @@ TEST_F(WebContentsImplTest, UpdateTitle) {
|
| static_cast<NavigationControllerImpl&>(controller());
|
| FrameHostMsg_DidCommitProvisionalLoad_Params params;
|
| InitNavigateParams(
|
| - ¶ms, 0, GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_TYPED);
|
| + ¶ms, GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_TYPED);
|
|
|
| LoadCommittedDetails details;
|
| - cont.RendererDidNavigate(contents()->GetMainFrame(), params, &details);
|
| + cont.RendererDidNavigate(contents()->GetMainFrame(), 0, params, &details);
|
|
|
| contents()->UpdateTitle(contents()->GetMainFrame(), 0,
|
| base::ASCIIToUTF16(" Lots O' Whitespace\n"),
|
| @@ -391,9 +391,9 @@ TEST_F(WebContentsImplTest, NTPViewSource) {
|
| ViewMsg_EnableViewSourceMode::ID));
|
|
|
| FrameHostMsg_DidCommitProvisionalLoad_Params params;
|
| - InitNavigateParams(¶ms, 0, kGURL, ui::PAGE_TRANSITION_TYPED);
|
| + InitNavigateParams(¶ms, kGURL, ui::PAGE_TRANSITION_TYPED);
|
| LoadCommittedDetails details;
|
| - cont.RendererDidNavigate(contents()->GetMainFrame(), params, &details);
|
| + cont.RendererDidNavigate(contents()->GetMainFrame(), 0, params, &details);
|
| // Also check title and url.
|
| EXPECT_EQ(base::ASCIIToUTF16(kUrl), contents()->GetTitle());
|
| }
|
| @@ -1460,7 +1460,7 @@ TEST_F(WebContentsImplTest,
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1507,7 +1507,7 @@ TEST_F(WebContentsImplTest,
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1552,7 +1552,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialNoNewNavigationDontProceed) {
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1603,7 +1603,7 @@ TEST_F(WebContentsImplTest,
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1661,7 +1661,7 @@ TEST_F(WebContentsImplTest,
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1718,7 +1718,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialNoNewNavigationProceed) {
|
| EXPECT_FALSE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == NULL);
|
| // Let's commit the interstitial navigation.
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_TRUE(contents()->ShowingInterstitialPage());
|
| EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
|
| @@ -1755,7 +1755,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialThenNavigate) {
|
| new TestInterstitialPage(contents(), true, url, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url);
|
| + interstitial->TestDidNavigate(url);
|
|
|
| // While interstitial showing, navigate to a new URL.
|
| const GURL url2("http://www.yahoo.com");
|
| @@ -1784,7 +1784,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialThenGoBack) {
|
| &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(2, interstitial_url);
|
| + interstitial->TestDidNavigate(interstitial_url);
|
|
|
| // While the interstitial is showing, go back.
|
| controller().GoBack();
|
| @@ -1819,7 +1819,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialCrashRendererThenGoBack) {
|
| &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(2, interstitial_url);
|
| + interstitial->TestDidNavigate(interstitial_url);
|
|
|
| // Crash the renderer
|
| test_rvh()->OnMessageReceived(
|
| @@ -1865,7 +1865,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialCrashRendererThenNavigate) {
|
| ViewHostMsg_RenderProcessGone(
|
| 0, base::TERMINATION_STATUS_PROCESS_CRASHED, -1));
|
|
|
| - interstitial->TestDidNavigate(2, interstitial_url);
|
| + interstitial->TestDidNavigate(interstitial_url);
|
| }
|
|
|
| // Test navigating to a page that shows an interstitial, then close the
|
| @@ -1880,7 +1880,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialThenCloseTab) {
|
| new TestInterstitialPage(contents(), true, url, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url);
|
| + interstitial->TestDidNavigate(url);
|
|
|
| // Now close the contents.
|
| DeleteContents();
|
| @@ -1902,7 +1902,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialThenCloseAndShutdown) {
|
| new TestInterstitialPage(contents(), true, url, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url);
|
| + interstitial->TestDidNavigate(url);
|
| RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
|
| interstitial->GetRenderViewHostForTesting());
|
|
|
| @@ -1937,7 +1937,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialProceedMultipleCommands) {
|
| new TestInterstitialPage(contents(), true, url2, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
|
|
| // Run a command.
|
| EXPECT_EQ(0, interstitial->command_received_count());
|
| @@ -1972,7 +1972,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialOnInterstitial) {
|
| new TestInterstitialPage(contents(), true, url1, &state1, &deleted1);
|
| TestInterstitialPageStateGuard state_guard1(interstitial1);
|
| interstitial1->Show();
|
| - interstitial1->TestDidNavigate(1, url1);
|
| + interstitial1->TestDidNavigate(url1);
|
|
|
| // Now show another interstitial.
|
| TestInterstitialPage::InterstitialState state2 =
|
| @@ -1983,7 +1983,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialOnInterstitial) {
|
| new TestInterstitialPage(contents(), true, url2, &state2, &deleted2);
|
| TestInterstitialPageStateGuard state_guard2(interstitial2);
|
| interstitial2->Show();
|
| - interstitial2->TestDidNavigate(1, url2);
|
| + interstitial2->TestDidNavigate(url2);
|
|
|
| // Showing interstitial2 should have caused interstitial1 to go away.
|
| EXPECT_EQ(TestInterstitialPage::CANCELED, state1);
|
| @@ -2025,7 +2025,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialProceedShowInterstitial) {
|
| new TestInterstitialPage(contents(), true, url1, &state1, &deleted1);
|
| TestInterstitialPageStateGuard state_guard1(interstitial1);
|
| interstitial1->Show();
|
| - interstitial1->TestDidNavigate(1, url1);
|
| + interstitial1->TestDidNavigate(url1);
|
|
|
| // Take action. The interstitial won't be hidden until the navigation is
|
| // committed.
|
| @@ -2042,7 +2042,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialProceedShowInterstitial) {
|
| new TestInterstitialPage(contents(), true, url2, &state2, &deleted2);
|
| TestInterstitialPageStateGuard state_guard2(interstitial2);
|
| interstitial2->Show();
|
| - interstitial2->TestDidNavigate(1, url2);
|
| + interstitial2->TestDidNavigate(url2);
|
|
|
| // Showing interstitial2 should have caused interstitial1 to go away.
|
| EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2);
|
| @@ -2089,7 +2089,7 @@ TEST_F(WebContentsImplTest, NavigateBeforeInterstitialShows) {
|
| ASSERT_FALSE(deleted);
|
|
|
| // Now let's make the interstitial navigation commit.
|
| - interstitial->TestDidNavigate(1, interstitial_url);
|
| + interstitial->TestDidNavigate(interstitial_url);
|
|
|
| // After it loaded the interstitial should be gone.
|
| EXPECT_EQ(TestInterstitialPage::CANCELED, state);
|
| @@ -2134,7 +2134,7 @@ TEST_F(WebContentsImplTest, TwoQuickInterstitials) {
|
| ASSERT_FALSE(deleted2);
|
|
|
| // Make the interstitial navigation commit it should be showing.
|
| - interstitial2->TestDidNavigate(1, interstitial_url);
|
| + interstitial2->TestDidNavigate(interstitial_url);
|
| EXPECT_EQ(interstitial2, contents()->GetInterstitialPage());
|
| }
|
|
|
| @@ -2161,7 +2161,7 @@ TEST_F(WebContentsImplTest, InterstitialCrasher) {
|
| interstitial =
|
| new TestInterstitialPage(contents(), true, url, &state, &deleted);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url);
|
| + interstitial->TestDidNavigate(url);
|
| // Simulate a renderer crash.
|
| interstitial->TestRenderViewTerminated(
|
| base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
|
| @@ -2190,7 +2190,7 @@ TEST_F(WebContentsImplTest, NewInterstitialDoesNotCancelPendingEntry) {
|
| new TestInterstitialPage(contents(), true, kGURL, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, kGURL);
|
| + interstitial->TestDidNavigate(kGURL);
|
|
|
| // Initiate a new navigation from the browser that also triggers an
|
| // interstitial.
|
| @@ -2203,7 +2203,7 @@ TEST_F(WebContentsImplTest, NewInterstitialDoesNotCancelPendingEntry) {
|
| new TestInterstitialPage(contents(), true, kGURL, &state2, &deleted2);
|
| TestInterstitialPageStateGuard state_guard2(interstitial2);
|
| interstitial2->Show();
|
| - interstitial2->TestDidNavigate(1, kGURL);
|
| + interstitial2->TestDidNavigate(kGURL);
|
|
|
| // Make sure we still have an entry.
|
| NavigationEntry* entry = contents()->GetController().GetPendingEntry();
|
| @@ -2239,7 +2239,7 @@ TEST_F(WebContentsImplTest, NoJSMessageOnInterstitials) {
|
| new TestInterstitialPage(contents(), true, kGURL, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, kGURL);
|
| + interstitial->TestDidNavigate(kGURL);
|
|
|
| // While the interstitial is showing, let's simulate the hidden page
|
| // attempting to show a JS message.
|
| @@ -2272,7 +2272,7 @@ TEST_F(WebContentsImplTest, CopyStateFromAndPruneSourceInterstitial) {
|
| new TestInterstitialPage(contents(), true, url2, &state, &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url2);
|
| + interstitial->TestDidNavigate(url2);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_EQ(2, controller().GetEntryCount());
|
|
|
| @@ -2324,7 +2324,7 @@ TEST_F(WebContentsImplTest, CopyStateFromAndPruneTargetInterstitial) {
|
| &deleted);
|
| TestInterstitialPageStateGuard state_guard(interstitial);
|
| interstitial->Show();
|
| - interstitial->TestDidNavigate(1, url3);
|
| + interstitial->TestDidNavigate(url3);
|
| EXPECT_TRUE(interstitial->is_showing());
|
| EXPECT_EQ(2, other_controller.GetEntryCount());
|
|
|
|
|