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

Unified Diff: chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc

Issue 580133002: Update entry page type to include error pages when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fix for unit_tests Created 6 years, 3 months 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
Index: chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
index f9884dff473383650aa3323b3f578b44e1ea2aff..fe3afa35c6940efc0ae3381a3f4e6a5bf24346f8 100644
--- a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
+++ b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
@@ -95,6 +95,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness {
tab_helper().DidCommitProvisionalLoadForFrame(
render_view_host->GetMainFrame(),
url,
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_LINK);
}
@@ -118,6 +119,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness {
tab_helper().DidCommitProvisionalLoadForFrame(
render_view_host->GetMainFrame(),
GURL(kErrorPageUrl),
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_LINK);
}
@@ -267,6 +269,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpTimeoutLinkDoctor) {
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
GURL(kErrorPageUrl),
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_LINK);
tab_helper().DidStopLoading(render_view_host1());
}
@@ -367,6 +370,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_FAILED)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame2(),
GURL(kErrorPageUrl),
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_TYPED);
}
@@ -402,8 +406,10 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsSecure())).Times(1);
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
- tab_helper().DidCommitProvisionalLoadForFrame(
- main_render_frame1(), same_site_url, ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
+ same_site_url,
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_LINK);
}
// Simulates navigations for a number of subframes, and makes sure no
@@ -418,8 +424,10 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframe) {
// Normal load.
tab_helper().DidStartProvisionalLoadForFrame(subframe1, url, false, false);
- tab_helper().DidCommitProvisionalLoadForFrame(
- subframe1, url, ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(subframe1,
+ url,
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_LINK);
// Timeout.
content::RenderFrameHost* subframe2 =
@@ -468,10 +476,15 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) {
// Error page load finishes.
tab_helper().DidCommitProvisionalLoadForFrame(
- subframe, url, ui::PAGE_TRANSITION_AUTO_SUBFRAME);
+ subframe,
+ url,
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_AUTO_SUBFRAME);
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_UNEXPECTED)).Times(1);
- tab_helper().DidCommitProvisionalLoadForFrame(
- main_render_frame1(), url, ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
+ url,
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_LINK);
}
// Simulates an HTTP to HTTPS redirect, which then times out.
@@ -499,6 +512,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) {
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
GURL(kErrorPageUrl),
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_LINK);
}
@@ -516,8 +530,10 @@ TEST_F(CaptivePortalTabHelperTest, HttpsToHttpRedirect) {
render_view_host1()->GetProcess()->GetID());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
- tab_helper().DidCommitProvisionalLoadForFrame(
- main_render_frame1(), http_url, ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
+ http_url,
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_LINK);
}
// Simulates an HTTPS to HTTPS redirect.
@@ -533,8 +549,10 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpRedirect) {
render_view_host1()->GetProcess()->GetID());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
- tab_helper().DidCommitProvisionalLoadForFrame(
- main_render_frame1(), http_url, ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
+ http_url,
+ false /* url_is_unreachable */,
+ ui::PAGE_TRANSITION_LINK);
}
// Tests that a subframe redirect doesn't reset the timer to kick off a captive
@@ -551,8 +569,10 @@ TEST_F(CaptivePortalTabHelperTest, SubframeRedirect) {
render_view_host1()->GetProcess()->GetID());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
- tab_helper().DidCommitProvisionalLoadForFrame(
- main_render_frame1(), GURL(kErrorPageUrl), ui::PAGE_TRANSITION_LINK);
+ tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
+ GURL(kErrorPageUrl),
+ false, // url_is_unreachable
+ ui::PAGE_TRANSITION_LINK);
}
// Simulates a redirect, for another RenderViewHost.
@@ -581,6 +601,7 @@ TEST_F(CaptivePortalTabHelperTest, OtherRenderViewHostRedirect) {
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(main_render_frame1(),
GURL(kErrorPageUrl),
+ false, // url_is_unreachable
ui::PAGE_TRANSITION_LINK);
}

Powered by Google App Engine
This is Rietveld 408576698