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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler_unittest.cc

Issue 11941029: Merge 176755 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 11 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 | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_setup_handler_unittest.cc
===================================================================
--- chrome/browser/ui/webui/sync_setup_handler_unittest.cc (revision 177805)
+++ chrome/browser/ui/webui/sync_setup_handler_unittest.cc (working copy)
@@ -538,10 +538,18 @@
// that won't finish for this test as we're simulating cancelling while the
// spinner is showing.
handler_->OpenSyncSetup(false);
- EXPECT_EQ(handler_.get(),
+
+ // When the SigninTracker is initialized here, a signin failure is triggered
+ // due to sync_initialized() returning false, causing the current login UI to
+ // be dismissed.
+ EXPECT_EQ(NULL,
LoginUIServiceFactory::GetForProfile(
profile_.get())->current_login_ui());
- ASSERT_EQ(1U, web_ui_.call_data().size());
+
+ // We expect a call to SyncSetupOverlay.showSyncSetupPage. Some variations of
+ // this test also include a call to OptionsPage.closeOverlay, that we ignore.
+ EXPECT_LE(1U, web_ui_.call_data().size());
+
const TestWebUI::CallData& data = web_ui_.call_data()[0];
EXPECT_EQ("SyncSetupOverlay.showSyncSetupPage", data.function_name);
std::string page;
@@ -573,20 +581,29 @@
SetDefaultExpectationsForConfigPage();
handler_->OpenSyncSetup(false);
- ASSERT_EQ(1U, web_ui_.call_data().size());
+
+ // We expect a call to SyncSetupOverlay.showSyncSetupPage. Some variations of
+ // this test also include a call to OptionsPage.closeOverlay, that we ignore.
+ EXPECT_LE(1U, web_ui_.call_data().size());
+
const TestWebUI::CallData& data0 = web_ui_.call_data()[0];
EXPECT_EQ("SyncSetupOverlay.showSyncSetupPage", data0.function_name);
std::string page;
ASSERT_TRUE(data0.arg1->GetAsString(&page));
EXPECT_EQ(page, "spinner");
handler_->SigninSuccess();
+
// On signin success, the dialog will proceed from spinner to configure sync
- // everything.
- EXPECT_EQ(handler_.get(),
+ // everything. There is no login UI once signin is successful.
+ EXPECT_EQ(NULL,
LoginUIServiceFactory::GetForProfile(
profile_.get())->current_login_ui());
- ASSERT_EQ(2U, web_ui_.call_data().size());
- const TestWebUI::CallData& data1 = web_ui_.call_data()[1];
+
+ // We expect a second call to SyncSetupOverlay.showSyncSetupPage. Some
+ // variations of this test also include a call to OptionsPage.closeOverlay,
+ // that we ignore.
+ EXPECT_LE(2U, web_ui_.call_data().size());
+ const TestWebUI::CallData& data1 = web_ui_.call_data().back();
EXPECT_EQ("SyncSetupOverlay.showSyncSetupPage", data1.function_name);
ASSERT_TRUE(data1.arg1->GetAsString(&page));
EXPECT_EQ(page, "configure");
« no previous file with comments | « chrome/browser/ui/webui/sync_setup_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698