diff options
author | vkuzkokov <vkuzkokov@chromium.org> | 2015-04-28 05:07:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-28 12:07:04 +0000 |
commit | 49180eb13549e440bbd4f66390e32e84699dcdfd (patch) | |
tree | ea34e50a0a150f491d6cfa5cebcc8f7600628885 /chrome | |
parent | ee9049e5b2e4ddd2c896ba9c9d991b2d59a00977 (diff) | |
download | chromium_src-49180eb13549e440bbd4f66390e32e84699dcdfd.zip chromium_src-49180eb13549e440bbd4f66390e32e84699dcdfd.tar.gz chromium_src-49180eb13549e440bbd4f66390e32e84699dcdfd.tar.bz2 |
Revert of Classify navigations without page id in parallel to the existing classifier. (patchset #35 id:680001 of https://codereview.chromium.org/1002803002/)
Reason for revert:
Very flaky on ChromeOS debug bots. See crbug.com/481910
Original issue's description:
> Classify navigations without page id in parallel to the existing classifier.
>
> For now, this only happens in debug builds.
>
> BUG=369661
> TEST=NavigationControllerBrowserTest.NavigationTypeClassification_*
> TEST=Every other test on the planet.
>
> Committed: https://crrev.com/d8d93348bbd8c646c337bdaa40fc0c64204fc5ff
> Cr-Commit-Position: refs/heads/master@{#327122}
>
> Reverted: https://crrev.com/5348e920f4119aff9a4eb76c0965725dc85a66cc
> Cr-Revert-Position: refs/heads/master@{#327152}
>
> Committed: https://crrev.com/5671403d44971669e4d81aecf3f002188ce0e95f
> Cr-Commit-Position: refs/heads/master@{#327214}
TBR=phajdan.jr@chromium.org,clamy@chromium.org,creis@chromium.org,hajimehoshi@chromium.org,isherman@chromium.org,jeremyim@chromium.org,mattm@chromium.org,mnaganov@chromium.org,mvanouwerkerk@chromium.org,nasko@chromium.org,stevenjb@chromium.org,bengr@chromium.org,cpu@chromium.org,avi@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=369661
Review URL: https://codereview.chromium.org/1110943003
Cr-Commit-Position: refs/heads/master@{#327269}
Diffstat (limited to 'chrome')
9 files changed, 66 insertions, 122 deletions
diff --git a/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc b/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc index 0ff4379..3157246 100644 --- a/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc +++ b/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc @@ -13,7 +13,6 @@ #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "content/public/browser/interstitial_page.h" #include "content/public/browser/navigation_controller.h" -#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "content/public/test/web_contents_tester.h" @@ -65,14 +64,10 @@ class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness { ChromeRenderViewHostTestHarness::TearDown(); } - void Navigate(const char* url, - int page_id, - int nav_entry_id, - bool did_create_new_entry) { - WebContentsTester::For(web_contents()) - ->TestDidNavigate(web_contents()->GetMainFrame(), page_id, nav_entry_id, - did_create_new_entry, GURL(url), - ui::PAGE_TRANSITION_TYPED); + void Navigate(const char* url, int page_id) { + WebContentsTester::For(web_contents())->TestDidNavigate( + web_contents()->GetMainFrame(), page_id, GURL(url), + ui::PAGE_TRANSITION_TYPED); } void ShowInterstitial(const char* url) { @@ -122,7 +117,7 @@ class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness { TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) { SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_DONE); // Start a load. - Navigate(kURL1, 1, 0, true); + Navigate(kURL1, 1); // Load next page. controller().LoadURL(GURL(kURL2), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); @@ -140,7 +135,7 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShownOnTimeout) { base::TimeDelta::FromSeconds(kSessionMergeTimeout + 1)); // Start a load. - Navigate(kURL1, 1, 0, true); + Navigate(kURL1, 1); // Load next page. controller().LoadURL(GURL(kURL2), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); @@ -155,11 +150,10 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) { SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS); // Start a load. - Navigate(kURL1, 1, 0, true); + Navigate(kURL1, 1); // Load next page. controller().LoadURL(GURL(kURL2), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); - int pending_id = controller().GetPendingEntry()->GetUniqueID(); // Simulate the load causing an merge session interstitial page // to be shown. @@ -176,7 +170,7 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) { EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); // Commit navigation and the interstitial page is gone. - Navigate(kURL2, 2, pending_id, true); + Navigate(kURL2, 2); EXPECT_FALSE(GetMergeSessionLoadPage()); } diff --git a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc index 8bf9a98..6261d3c 100644 --- a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc +++ b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc @@ -61,14 +61,10 @@ class OfflineLoadPageTest : public ChromeRenderViewHostTestHarness { user_response_ = CANCEL; } - void Navigate(const char* url, - int page_id, - int nav_entry_id, - bool did_create_new_entry) { - WebContentsTester::For(web_contents()) - ->TestDidNavigate(web_contents()->GetMainFrame(), page_id, nav_entry_id, - did_create_new_entry, GURL(url), - ui::PAGE_TRANSITION_TYPED); + void Navigate(const char* url, int page_id) { + WebContentsTester::For(web_contents())->TestDidNavigate( + web_contents()->GetMainFrame(), page_id, GURL(url), + ui::PAGE_TRANSITION_TYPED); } void ShowInterstitial(const char* url) { @@ -95,7 +91,7 @@ void TestOfflineLoadPage::NotifyBlockingPageComplete(bool proceed) { TEST_F(OfflineLoadPageTest, OfflinePageProceed) { // Start a load. - Navigate(kURL1, 1, 0, true); + Navigate(kURL1, 1); // Load next page. controller().LoadURL(GURL(kURL2), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); @@ -117,14 +113,14 @@ TEST_F(OfflineLoadPageTest, OfflinePageProceed) { EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); // Commit navigation and the interstitial page is gone. - Navigate(kURL2, 2, 0, true); + Navigate(kURL2, 2); EXPECT_FALSE(GetOfflineLoadPage()); } // Tests showing an offline page and not proceeding. TEST_F(OfflineLoadPageTest, OfflinePageDontProceed) { // Start a load. - Navigate(kURL1, 1, 0, true); + Navigate(kURL1, 1); controller().LoadURL(GURL(kURL2), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index 6775087..37e8406 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc @@ -32,7 +32,6 @@ #include "components/infobars/core/infobar.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_details.h" -#include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_service.h" @@ -225,9 +224,8 @@ void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { content::WebContents* new_tab = CreateTestWebContents(); new_tab->GetController().LoadURL( url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); - content::NavigationEntry* entry = new_tab->GetController().GetPendingEntry(); content::RenderFrameHostTester::For(new_tab->GetMainFrame()) - ->SendNavigate(extra_tabs_.size() + 1, entry->GetUniqueID(), true, url); + ->SendNavigate(extra_tabs_.size() + 1, url); // Set up required helpers, and make this be as "tabby" as the code requires. #if defined(ENABLE_EXTENSIONS) diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc index 5539649..0a0f7a2 100644 --- a/chrome/browser/rlz/rlz_unittest.cc +++ b/chrome/browser/rlz/rlz_unittest.cc @@ -270,11 +270,9 @@ void RlzLibTest::SimulateHomepageUsage() { content::RenderFrameHostTester::For(main_rfh()); // Simulate a navigation to homepage first. - rfht->SendNavigateWithTransition( - 0, 0, true, home_url, ui::PAGE_TRANSITION_HOME_PAGE); + rfht->SendNavigateWithTransition(0, home_url, ui::PAGE_TRANSITION_HOME_PAGE); // Then simulate a search from homepage. - rfht->SendNavigateWithTransition( - 1, 0, true, search_url, ui::PAGE_TRANSITION_LINK); + rfht->SendNavigateWithTransition(1, search_url, ui::PAGE_TRANSITION_LINK); } void RlzLibTest::SimulateAppListUsage() { diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc index 0cd880c..9e92f20 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc @@ -25,7 +25,6 @@ #include "components/history/core/browser/history_backend.h" #include "components/history/core/browser/history_service.h" #include "content/public/browser/navigation_controller.h" -#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "content/public/common/referrer.h" #include "content/public/test/test_browser_thread.h" @@ -133,8 +132,6 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness { web_contents()->GetController().LoadURL( url, content::Referrer(referrer, blink::WebReferrerPolicyDefault), type, std::string()); - int pending_id = - web_contents()->GetController().GetPendingEntry()->GetUniqueID(); static int page_id = 0; content::RenderFrameHost* rfh = @@ -144,7 +141,7 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness { } WebContentsTester::For(web_contents())->ProceedWithCrossSiteNavigation(); WebContentsTester::For(web_contents())->TestDidNavigateWithReferrer( - rfh, ++page_id, pending_id, true, url, + rfh, ++page_id, url, content::Referrer(referrer, blink::WebReferrerPolicyDefault), type); } diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index cdc185a..536953a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -120,36 +120,10 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { user_response_ = CANCEL; } - void Navigate(const char* url, - int page_id, - int nav_entry_id, - bool did_create_new_entry) { - NavigateInternal(url, page_id, nav_entry_id, did_create_new_entry, false); - } - - void NavigateCrossSite(const char* url, - int page_id, - int nav_entry_id, - bool did_create_new_entry) { - NavigateInternal(url, page_id, nav_entry_id, did_create_new_entry, true); - } - - void NavigateInternal(const char* url, - int page_id, - int nav_entry_id, - bool did_create_new_entry, - bool is_cross_site) { - // The pending RVH should commit for cross-site navigations. - content::RenderFrameHost* render_frame_host = - is_cross_site - ? content::WebContentsTester::For(web_contents()) - ->GetPendingMainFrame() - : web_contents()->GetMainFrame(); - - content::WebContentsTester::For(web_contents()) - ->TestDidNavigate(render_frame_host, page_id, nav_entry_id, - did_create_new_entry, GURL(url), - ui::PAGE_TRANSITION_TYPED); + void Navigate(const char* url, int page_id) { + WebContentsTester::For(web_contents())->TestDidNavigate( + web_contents()->GetMainFrame(), page_id, GURL(url), + ui::PAGE_TRANSITION_TYPED); } void GoBack(bool is_cross_site) { @@ -165,9 +139,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { WebContentsTester::For(web_contents())->TestDidNavigate( rfh, entry->GetPageID(), - entry->GetUniqueID(), - false, - entry->GetURL(), + GURL(entry->GetURL()), ui::PAGE_TRANSITION_TYPED); } @@ -252,7 +224,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) { // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); base::RunLoop().RunUntilIdle(); @@ -283,11 +256,11 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageProceed) { // Start a load. controller().LoadURL(GURL(kBadURL), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); - int pending_id = controller().GetPendingEntry()->GetUniqueID(); // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Simulate the user clicking "proceed". @@ -296,7 +269,7 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageProceed) { // The interstitial is shown until the navigation commits. ASSERT_TRUE(InterstitialPage::GetInterstitialPage(web_contents())); // Commit the navigation. - Navigate(kBadURL, 1, pending_id, true); + Navigate(kBadURL, 1); // The interstitial should be gone now. ASSERT_FALSE(InterstitialPage::GetInterstitialPage(web_contents())); @@ -315,15 +288,16 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceDontProceed) { prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere. - Navigate(kGoogleURL, 1, 0, true); + Navigate(kGoogleURL, 1); // Navigate somewhere else. - Navigate(kGoodURL, 2, 0, true); + Navigate(kGoodURL, 2); // Simulate that page loading a bad-resource triggering an interstitial. ShowInterstitial(true, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Simulate the user clicking "don't proceed". @@ -351,12 +325,13 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMalwareResourceProceed) { prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere. - Navigate(kGoodURL, 1, 0, true); + Navigate(kGoodURL, 1); // Simulate that page loading a bad-resource triggering an interstitial. ShowInterstitial(true, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Simulate the user clicking "proceed". @@ -385,10 +360,10 @@ TEST_F(SafeBrowsingBlockingPageTest, prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere. - Navigate(kGoogleURL, 1, 0, true); + Navigate(kGoogleURL, 1); // Navigate somewhere else. - Navigate(kGoodURL, 2, 0, true); + Navigate(kGoodURL, 2); // Simulate that page loading a bad-resource triggering an interstitial. ShowInterstitial(true, kBadURL); @@ -398,7 +373,8 @@ TEST_F(SafeBrowsingBlockingPageTest, ShowInterstitial(true, kBadURL2); ShowInterstitial(true, kBadURL3); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Simulate the user clicking "don't proceed". @@ -427,10 +403,10 @@ TEST_F(SafeBrowsingBlockingPageTest, prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere. - Navigate(kGoogleURL, 1, 0, true); + Navigate(kGoogleURL, 1); // Navigate somewhere else. - Navigate(kGoodURL, 2, 0, true); + Navigate(kGoodURL, 2); // Simulate that page loading a bad-resource triggering an interstitial. ShowInterstitial(true, kBadURL); @@ -440,7 +416,8 @@ TEST_F(SafeBrowsingBlockingPageTest, ShowInterstitial(true, kBadURL2); ShowInterstitial(true, kBadURL3); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Proceed through the 1st interstitial. @@ -476,7 +453,8 @@ TEST_F(SafeBrowsingBlockingPageTest, // Tests showing a blocking page for a page that contains multiple malware // subresources and proceeding through the multiple interstitials. -TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) { +TEST_F(SafeBrowsingBlockingPageTest, + PageWithMultipleMalwareResourceProceed) { // Enable malware reports. Profile* profile = Profile::FromBrowserContext( web_contents()->GetBrowserContext()); @@ -484,7 +462,7 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) { prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere else. - Navigate(kGoodURL, 1, 0, true); + Navigate(kGoodURL, 1); // Simulate that page loading a bad-resource triggering an interstitial. ShowInterstitial(true, kBadURL); @@ -494,7 +472,8 @@ TEST_F(SafeBrowsingBlockingPageTest, PageWithMultipleMalwareResourceProceed) { ShowInterstitial(true, kBadURL2); ShowInterstitial(true, kBadURL3); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Proceed through the 1st interstitial. @@ -536,19 +515,19 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) { prefs::kSafeBrowsingExtendedReportingEnabled, true); // Navigate somewhere. - Navigate(kGoodURL, 1, 0, true); + Navigate(kGoodURL, 1); // Now navigate to a bad page triggerring an interstitial. controller().LoadURL(GURL(kBadURL), content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); - int pending_id = controller().GetPendingEntry()->GetUniqueID(); ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Proceed, then navigate back. ProceedThroughInterstitial(sb_interstitial); - Navigate(kBadURL, 2, pending_id, true); // Commit the navigation. + Navigate(kBadURL, 2); // Commit the navigation. GoBack(true); // We are back on the good page. @@ -559,15 +538,13 @@ TEST_F(SafeBrowsingBlockingPageTest, NavigatingBackAndForth) { // Navigate forward to the malware URL. web_contents()->GetController().GoForward(); - pending_id = controller().GetPendingEntry()->GetUniqueID(); ShowInterstitial(false, kBadURL); sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); // Let's proceed and make sure everything is OK (bug 17627). ProceedThroughInterstitial(sb_interstitial); - // Commit the navigation. - NavigateCrossSite(kBadURL, 2, pending_id, false); + Navigate(kBadURL, 2); // Commit the navigation. sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_FALSE(sb_interstitial); ASSERT_EQ(2, controller().GetEntryCount()); @@ -593,7 +570,8 @@ TEST_F(SafeBrowsingBlockingPageTest, ProceedThenDontProceed) { // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); base::RunLoop().RunUntilIdle(); @@ -629,7 +607,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsDisabled) { // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); base::RunLoop().RunUntilIdle(); @@ -663,7 +642,8 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsToggling) { // Simulate the load causing a safe browsing interstitial to be shown. ShowInterstitial(false, kBadURL); - SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + SafeBrowsingBlockingPage* sb_interstitial = + GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); base::RunLoop().RunUntilIdle(); diff --git a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc index 4eb0792..7772956b 100644 --- a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc +++ b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc @@ -840,11 +840,8 @@ TEST_F(TranslateManagerRenderViewHostTest, ReloadFromLocationBar) { NavEntryCommittedObserver nav_observer(web_contents()); web_contents()->GetController().LoadURL( url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); - int pending_id = - web_contents()->GetController().GetPendingEntry()->GetUniqueID(); content::RenderFrameHostTester::For(web_contents()->GetMainFrame()) - ->SendNavigateWithTransition(0, pending_id, false, url, - ui::PAGE_TRANSITION_TYPED); + ->SendNavigateWithTransition(0, url, ui::PAGE_TRANSITION_TYPED); // Test that we are really getting a same page navigation, the test would be // useless if it was not the case. @@ -897,12 +894,12 @@ TEST_F(TranslateManagerRenderViewHostTest, CloseInfoBarInSubframeNavigation) { // Simulate a sub-frame auto-navigating. subframe_tester->SendNavigateWithTransition( - 0, 0, false, GURL("http://pub.com"), ui::PAGE_TRANSITION_AUTO_SUBFRAME); + 0, GURL("http://pub.com"), ui::PAGE_TRANSITION_AUTO_SUBFRAME); EXPECT_TRUE(GetTranslateInfoBar() == NULL); // Simulate the user navigating in a sub-frame. subframe_tester->SendNavigateWithTransition( - 1, 0, true, GURL("http://pub.com"), ui::PAGE_TRANSITION_MANUAL_SUBFRAME); + 1, GURL("http://pub.com"), ui::PAGE_TRANSITION_MANUAL_SUBFRAME); EXPECT_TRUE(GetTranslateInfoBar() == NULL); // Navigate out of page, a new infobar should show. diff --git a/chrome/browser/ui/autofill/generated_credit_card_bubble_controller_unittest.cc b/chrome/browser/ui/autofill/generated_credit_card_bubble_controller_unittest.cc index 41f3950..7454e2a 100644 --- a/chrome/browser/ui/autofill/generated_credit_card_bubble_controller_unittest.cc +++ b/chrome/browser/ui/autofill/generated_credit_card_bubble_controller_unittest.cc @@ -15,8 +15,6 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "components/autofill/core/browser/autofill_test_utils.h" -#include "content/public/browser/navigation_details.h" -#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/web_contents_tester.h" @@ -78,19 +76,9 @@ class GeneratedCreditCardBubbleControllerTest : public testing::Test { BackingCard()); } - void NavigateWithTransition(ui::PageTransition transition) { - content::LoadCommittedDetails details; - content::FrameNavigateParams params; - - // The transition is in two places; fill in both. - scoped_ptr<content::NavigationEntry> navigation_entry( - content::NavigationEntry::Create()); - navigation_entry->SetTransitionType(transition); - params.transition = transition; - details.entry = navigation_entry.get(); - - ASSERT_NE(nullptr, controller()); - controller()->DidNavigateMainFrame(details, params); + void NavigateWithTransition(ui::PageTransition trans) { + content::WebContentsTester::For(test_web_contents_.get())->TestDidNavigate( + test_web_contents_->GetMainFrame(), 1, GURL("about:blank"), trans); } private: diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc index 245c9b9..09f57d5 100644 --- a/chrome/test/base/browser_with_test_window_test.cc +++ b/chrome/test/base/browser_with_test_window_test.cc @@ -165,16 +165,12 @@ void BrowserWithTestWindowTest::CommitPendingLoad( if (controller->GetPendingEntryIndex() >= 0) { test_rfh_tester->SendNavigateWithTransition( controller->GetPendingEntry()->GetPageID(), - controller->GetPendingEntry()->GetUniqueID(), - false, controller->GetPendingEntry()->GetURL(), controller->GetPendingEntry()->GetTransitionType()); } else { test_rfh_tester->SendNavigateWithTransition( controller->GetWebContents()->GetMaxPageIDForSiteInstance( test_rfh->GetSiteInstance()) + 1, - controller->GetPendingEntry()->GetUniqueID(), - true, controller->GetPendingEntry()->GetURL(), controller->GetPendingEntry()->GetTransitionType()); } |