| 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());
|
| }
|
|
|
|
|