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

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

Issue 11090068: When starting a provisional load include the parent frame ID in the IPC and pass it down the th WCO… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updatess Created 8 years, 2 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 214dcbeebfe272e16b69f5909ab81eb11028d55e..7358723a126e9841c92f0b8e4aa1076b268b9435 100644
--- a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
+++ b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc
@@ -89,7 +89,7 @@ class CaptivePortalTabHelperTest : public TabContentsTestHarness {
content::RenderViewHost* render_view_host) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, url, false, render_view_host);
+ 1, -1, true, url, false, render_view_host);
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -101,14 +101,14 @@ class CaptivePortalTabHelperTest : public TabContentsTestHarness {
content::RenderViewHost* render_view_host) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, url, false, render_view_host);
+ 1, -1, true, url, false, render_view_host);
tab_helper().DidFailProvisionalLoad(
1, true, url, net::ERR_TIMED_OUT, string16(), render_view_host);
// Provisional load starts for the error page.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, GURL(kErrorPageUrl), true, render_view_host);
+ 1, -1, true, GURL(kErrorPageUrl), true, render_view_host);
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -122,7 +122,7 @@ class CaptivePortalTabHelperTest : public TabContentsTestHarness {
NavigationType navigation_type) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, url, false, render_view_host);
+ 1, -1, true, url, false, render_view_host);
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
if (navigation_type == kSameProcess) {
@@ -149,14 +149,14 @@ class CaptivePortalTabHelperTest : public TabContentsTestHarness {
NavigationType navigation_type) {
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, url, false, render_view_host);
+ 1, -1, true, url, false, render_view_host);
tab_helper().DidFailProvisionalLoad(
1, true, url, net::ERR_TIMED_OUT, string16(), render_view_host);
// Start event for the error page.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, url, true, render_view_host);
+ 1, -1, true, url, true, render_view_host);
EXPECT_CALL(mock_reloader(), OnAbort()).Times(1);
if (navigation_type == kSameProcess) {
@@ -250,7 +250,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpTimeoutLinkDoctor) {
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
// Provisional load starts for the error page.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, GURL(kErrorPageUrl), true, render_view_host1());
+ 1, -1, true, GURL(kErrorPageUrl), true, render_view_host1());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -324,7 +324,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, same_site_url, false, render_view_host1());
+ 1, -1, true, same_site_url, false, render_view_host1());
// It's unexpectedly interrupted by a cross-process navigation, which starts
// navigating before the old navigation cancels. We generate an abort message
@@ -333,7 +333,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(cross_process_url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, cross_process_url, false, render_view_host2());
+ 1, -1, true, cross_process_url, false, render_view_host2());
// The cross-process navigation fails.
tab_helper().DidFailProvisionalLoad(
@@ -348,7 +348,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) {
// The provisional load starts for the error page for the cross-process
// navigation.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, GURL(kErrorPageUrl), true, render_view_host2());
+ 1, -1, true, GURL(kErrorPageUrl), true, render_view_host2());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_FAILED)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -366,7 +366,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(same_site_url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, same_site_url, false, render_view_host1());
+ 1, -1, true, same_site_url, false, render_view_host1());
// It's unexpectedly interrupted by a cross-process navigation, which starts
// navigating before the old navigation cancels. We generate an abort message
@@ -375,7 +375,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(cross_process_url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, cross_process_url, false, render_view_host2());
+ 1, -1, true, cross_process_url, false, render_view_host2());
// The cross-process navigation fails.
tab_helper().DidFailProvisionalLoad(
@@ -398,23 +398,23 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframe) {
GURL url = GURL(kHttpsUrl);
// Normal load.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, false, url, false, render_view_host1());
+ 1, -1, false, url, false, render_view_host1());
tab_helper().DidCommitProvisionalLoadForFrame(
1, false, url, content::PAGE_TRANSITION_LINK, render_view_host1());
// Timeout.
tab_helper().DidStartProvisionalLoadForFrame(
- 2, false, url, false, render_view_host1());
+ 2, -1, false, url, false, render_view_host1());
tab_helper().DidFailProvisionalLoad(
2, false, url, net::ERR_TIMED_OUT, string16(), render_view_host1());
tab_helper().DidStartProvisionalLoadForFrame(
- 2, false, url, true, render_view_host1());
+ 2, -1, false, url, true, render_view_host1());
tab_helper().DidFailProvisionalLoad(
2, false, url, net::ERR_ABORTED, string16(), render_view_host1());
// Abort.
tab_helper().DidStartProvisionalLoadForFrame(
- 3, false, url, false, render_view_host1());
+ 3, -1, false, url, false, render_view_host1());
tab_helper().DidFailProvisionalLoad(
3, false, url, net::ERR_ABORTED, string16(), render_view_host1());
}
@@ -432,9 +432,9 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) {
// Loads start.
EXPECT_CALL(mock_reloader(), OnLoadStart(url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- frame_id, true, url, false, render_view_host1());
+ frame_id, -1, true, url, false, render_view_host1());
tab_helper().DidStartProvisionalLoadForFrame(
- subframe_id, false, url, false, render_view_host1());
+ subframe_id, frame_id, false, url, false, render_view_host1());
// Loads return errors.
tab_helper().DidFailProvisionalLoad(
@@ -446,9 +446,9 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) {
// Provisional load starts for the error pages.
tab_helper().DidStartProvisionalLoadForFrame(
- frame_id, true, url, true, render_view_host1());
+ frame_id, -1, true, url, true, render_view_host1());
tab_helper().DidStartProvisionalLoadForFrame(
- subframe_id, false, url, true, render_view_host1());
+ subframe_id, frame_id, false, url, true, render_view_host1());
// Error page load finishes.
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -465,7 +465,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) {
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, http_url, false, render_view_host1());
+ 1, -1, true, http_url, false, render_view_host1());
GURL https_url(kHttpsUrl);
EXPECT_CALL(mock_reloader(), OnRedirect(true)).Times(1);
@@ -478,7 +478,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) {
// Provisional load starts for the error page.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, GURL(kErrorPageUrl), true, render_view_host1());
+ 1, -1, true, GURL(kErrorPageUrl), true, render_view_host1());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(
@@ -491,7 +491,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpsToHttpRedirect) {
GURL https_url(kHttpsUrl);
EXPECT_CALL(mock_reloader(),
OnLoadStart(https_url.SchemeIsSecure())).Times(1);
- tab_helper().DidStartProvisionalLoadForFrame(1, true, https_url, false,
+ tab_helper().DidStartProvisionalLoadForFrame(1, -1, true, https_url, false,
render_view_host1());
GURL http_url(kHttpUrl);
@@ -511,7 +511,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpRedirect) {
EXPECT_CALL(mock_reloader(),
OnLoadStart(http_url.SchemeIsSecure())).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, http_url, false, render_view_host1());
+ 1, -1, true, http_url, false, render_view_host1());
EXPECT_CALL(mock_reloader(), OnRedirect(http_url.SchemeIsSecure())).Times(1);
OnRedirect(ResourceType::MAIN_FRAME, http_url,
@@ -528,7 +528,7 @@ TEST_F(CaptivePortalTabHelperTest, SubframeRedirect) {
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, http_url, false, render_view_host1());
+ 1, -1, true, http_url, false, render_view_host1());
GURL https_url(kHttpsUrl);
OnRedirect(ResourceType::SUB_FRAME, https_url,
@@ -545,7 +545,7 @@ TEST_F(CaptivePortalTabHelperTest, OtherRenderViewHostRedirect) {
GURL http_url(kHttpUrl);
EXPECT_CALL(mock_reloader(), OnLoadStart(false)).Times(1);
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, http_url, false, render_view_host1());
+ 1, -1, true, http_url, false, render_view_host1());
// Another RenderViewHost sees a redirect. None of the reloader's functions
// should be called.
@@ -559,7 +559,7 @@ TEST_F(CaptivePortalTabHelperTest, OtherRenderViewHostRedirect) {
// Provisional load starts for the error page.
tab_helper().DidStartProvisionalLoadForFrame(
- 1, true, GURL(kErrorPageUrl), true, render_view_host1());
+ 1, -1, true, GURL(kErrorPageUrl), true, render_view_host1());
EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1);
tab_helper().DidCommitProvisionalLoadForFrame(

Powered by Google App Engine
This is Rietveld 408576698