summaryrefslogtreecommitdiffstats
path: root/components/data_reduction_proxy
diff options
context:
space:
mode:
authorvkuzkokov <vkuzkokov@chromium.org>2015-04-28 05:07:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-28 12:07:04 +0000
commit49180eb13549e440bbd4f66390e32e84699dcdfd (patch)
treeea34e50a0a150f491d6cfa5cebcc8f7600628885 /components/data_reduction_proxy
parentee9049e5b2e4ddd2c896ba9c9d991b2d59a00977 (diff)
downloadchromium_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 'components/data_reduction_proxy')
-rw-r--r--components/data_reduction_proxy/content/browser/data_reduction_proxy_debug_blocking_page_unittest.cc95
1 files changed, 32 insertions, 63 deletions
diff --git a/components/data_reduction_proxy/content/browser/data_reduction_proxy_debug_blocking_page_unittest.cc b/components/data_reduction_proxy/content/browser/data_reduction_proxy_debug_blocking_page_unittest.cc
index 64d5076..0effde6 100644
--- a/components/data_reduction_proxy/content/browser/data_reduction_proxy_debug_blocking_page_unittest.cc
+++ b/components/data_reduction_proxy/content/browser/data_reduction_proxy_debug_blocking_page_unittest.cc
@@ -104,56 +104,29 @@ class DataReductionProxyDebugBlockingPageTest
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) {
+ content::WebContentsTester::For(web_contents())->TestDidNavigate(
+ web_contents()->GetMainFrame(), page_id, GURL(url),
+ ui::PAGE_TRANSITION_TYPED);
}
void GoBack(bool is_cross_site) {
- content::NavigationEntry* entry =
- web_contents()->GetController().GetEntryAtOffset(-1);
- ASSERT_TRUE(entry);
- web_contents()->GetController().GoBack();
-
- // 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, entry->GetPageID(),
- entry->GetUniqueID(), false, GURL(entry->GetURL()),
- ui::PAGE_TRANSITION_TYPED);
- }
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetEntryAtOffset(-1);
+ ASSERT_TRUE(entry);
+ web_contents()->GetController().GoBack();
+
+ // 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,
+ entry->GetPageID(),
+ GURL(entry->GetURL()),
+ ui::PAGE_TRANSITION_TYPED);
+ }
void ShowInterstitial(bool is_subresource, const char* url) {
DataReductionProxyDebugUIManager::BypassResource resource;
@@ -256,7 +229,6 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, BypassPageProceed) {
// Start a load.
controller().LoadURL(GURL(kBypassURL), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
- int pending_id = controller().GetPendingEntry()->GetUniqueID();
// Simulate the load causing an interstitial to be shown.
ShowInterstitial(false, kBypassURL);
@@ -272,7 +244,7 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, BypassPageProceed) {
// The interstitial is shown until the navigation commits.
ASSERT_TRUE(GetDataReductionProxyDebugBlockingPage());
// Commit the navigation.
- Navigate(kBypassURL, 1, pending_id, true);
+ Navigate(kBypassURL, 1);
// The interstitial should be gone now.
EXPECT_EQ(OK, user_response());
ASSERT_FALSE(GetDataReductionProxyDebugBlockingPage());
@@ -282,10 +254,10 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, BypassPageProceed) {
// and not proceeding.
TEST_F(DataReductionProxyDebugBlockingPageTest, BypassSubresourceDontProceed) {
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 1);
// Navigate somewhere else.
- Navigate(kOtherURL, 2, 0, true);
+ Navigate(kOtherURL, 2);
// Simulate that page loading a bypass-resource triggering an interstitial.
ShowInterstitial(true, kBypassURL);
@@ -311,7 +283,7 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, BypassSubresourceDontProceed) {
// and proceeding.
TEST_F(DataReductionProxyDebugBlockingPageTest, BypassSubresourceProceed) {
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 1);
// Simulate that page loading a bypass-resource triggering an interstitial.
ShowInterstitial(true, kBypassURL);
@@ -338,15 +310,15 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, BypassSubresourceProceed) {
TEST_F(DataReductionProxyDebugBlockingPageTest,
BypassMultipleSubresourcesDontProceed) {
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 1);
// Navigate somewhere else.
- Navigate(kOtherURL, 2, 0, true);
+ Navigate(kOtherURL, 2);
// Simulate that page loading a bypass-resource triggering an interstitial.
ShowInterstitial(true, kBypassURL);
- // More bypassed resources loading causing more interstitials. The new
+ // More bypassedd resources loading causing more interstitials. The new
// interstitials should be queued.
ShowInterstitial(true, kBypassURL2);
ShowInterstitial(true, kBypassURL3);
@@ -360,7 +332,7 @@ TEST_F(DataReductionProxyDebugBlockingPageTest,
EXPECT_EQ(CANCEL, user_response());
EXPECT_FALSE(GetDataReductionProxyDebugBlockingPage());
- // The user did not proceed, the controller should be back to the first page,
+ // The user did not proceed, the controler should be back to the first page,
// the 2nd one should have been removed from the navigation controller.
ASSERT_EQ(1, controller().GetEntryCount());
EXPECT_EQ(kGoogleURL, controller().GetActiveEntry()->GetURL().spec());
@@ -372,7 +344,7 @@ TEST_F(DataReductionProxyDebugBlockingPageTest,
TEST_F(DataReductionProxyDebugBlockingPageTest,
BypassMultipleSubresourcesProceed) {
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 1);
// Simulate that page loading a bypass-resource triggering an interstitial.
ShowInterstitial(true, kBypassURL);
@@ -399,12 +371,11 @@ TEST_F(DataReductionProxyDebugBlockingPageTest,
// controller entries are OK.
TEST_F(DataReductionProxyDebugBlockingPageTest, NavigatingBackAndForth) {
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 1);
// Now navigate to a bypassed page triggerring an interstitial.
controller().LoadURL(GURL(kBypassURL), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
- int pending_id = controller().GetPendingEntry()->GetUniqueID();
ShowInterstitial(false, kBypassURL);
DataReductionProxyDebugBlockingPage* interstitial =
GetDataReductionProxyDebugBlockingPage();
@@ -412,7 +383,7 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, NavigatingBackAndForth) {
// Proceed through the 1st interstitial.
ProceedThroughInterstitial(interstitial);
- Navigate(kBypassURL, 2, pending_id, true); // Commit navigation.
+ Navigate(kBypassURL, 2); // Commit the navigation.
GoBack(true);
// We are back on the first page.
@@ -423,15 +394,13 @@ TEST_F(DataReductionProxyDebugBlockingPageTest, NavigatingBackAndForth) {
// Navigate forward to the bypassed URL.
web_contents()->GetController().GoForward();
- pending_id = controller().GetPendingEntry()->GetUniqueID();
ShowInterstitial(false, kBypassURL);
interstitial = GetDataReductionProxyDebugBlockingPage();
ASSERT_TRUE(interstitial);
// Let's proceed and make sure everything is OK.
ProceedThroughInterstitial(interstitial);
- // Commit the navigation.
- NavigateCrossSite(kBypassURL, 2, pending_id, false);
+ Navigate(kBypassURL, 2); // Commit the navigation.
interstitial = GetDataReductionProxyDebugBlockingPage();
ASSERT_FALSE(interstitial);
ASSERT_EQ(2, controller().GetEntryCount());