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

Unified Diff: chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc

Issue 1002803002: Classify navigations without page id in parallel to the existing classifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relax the dcheck Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/offline/offline_load_page_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc
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 31572465e3b50dbc78a8c882778865132bdb4160..0ff4379c6583ee1ea6f731836f8df05267f05ef4 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,6 +13,7 @@
#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"
@@ -64,10 +65,14 @@ class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness {
ChromeRenderViewHostTestHarness::TearDown();
}
- 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 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 ShowInterstitial(const char* url) {
@@ -117,7 +122,7 @@ class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness {
TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) {
SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_DONE);
// Start a load.
- Navigate(kURL1, 1);
+ Navigate(kURL1, 1, 0, true);
// Load next page.
controller().LoadURL(GURL(kURL2), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
@@ -135,7 +140,7 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShownOnTimeout) {
base::TimeDelta::FromSeconds(kSessionMergeTimeout + 1));
// Start a load.
- Navigate(kURL1, 1);
+ Navigate(kURL1, 1, 0, true);
// Load next page.
controller().LoadURL(GURL(kURL2), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
@@ -150,10 +155,11 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) {
SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS);
// Start a load.
- Navigate(kURL1, 1);
+ Navigate(kURL1, 1, 0, true);
// 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.
@@ -170,7 +176,7 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) {
EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec());
// Commit navigation and the interstitial page is gone.
- Navigate(kURL2, 2);
+ Navigate(kURL2, 2, pending_id, true);
EXPECT_FALSE(GetMergeSessionLoadPage());
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/offline/offline_load_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698