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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc

Issue 13979003: Win: Display a native bubble (instead of the JS one) after the web signin flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused imports. Created 7 years, 8 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/ui/sync/one_click_signin_helper_unittest.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
index f5a527373f1fe6f62bbb1fe21558cebcc557bf98..1d69d0fb5986df3821539209a9df40f6ac58355d 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -276,35 +276,6 @@ void OneClickSigninHelperTest::CreateSigninManager(
}
}
-OneClickSigninHelper* OneClickSigninHelperTest::SetupHelperForSignin() {
- CreateSigninManager(false, "");
- EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
- WillRepeatedly(Return(true));
-
- CreateProfileSyncServiceMock();
-
- content::WebContents* contents = web_contents();
-
- OneClickSigninHelper::CreateForWebContents(contents);
- OneClickSigninHelper* helper =
- OneClickSigninHelper::FromWebContents(contents);
-
- GURL continueUrl(
- "https://www.google.com/intl/en-US/chrome/blank.html?source=1");
- OneClickSigninHelper::ShowInfoBarUIThread(
- "session_index", "user@gmail.com",
- OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT,
- SyncPromoUI::SOURCE_NTP_LINK,
- continueUrl, process()->GetID(), rvh()->GetRoutingID());
-
- SubmitGAIAPassword(helper);
-
- NavigateAndCommit(continueUrl);
- helper->DidStopLoading(rvh());
- helper->OnStateChanged();
- return helper;
-}
-
void OneClickSigninHelperTest::EnableOneClick(bool enable) {
PrefService* pref_service = Profile::FromBrowserContext(
browser_context_.get())->GetPrefs();
@@ -681,7 +652,7 @@ TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) {
}
// If Chrome signin is triggered from a webstore install, and user chooses to
-// config sync, then Chrome should redirect immidiately to sync settings page,
+// config sync, then Chrome should redirect immediately to sync settings page,
// and upon successful setup, redirect back to webstore.
TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) {
CreateSigninManager(false, std::string());
@@ -713,37 +684,6 @@ TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) {
EXPECT_EQ("user@gmail.com", signin_manager_->GetAuthenticatedUsername());
}
-TEST_F(OneClickSigninHelperTest, ShowSigninBubbleAfterSigninComplete) {
- OneClickSigninHelper* helper = SetupHelperForSignin();
- PrefService* pref_service = profile_->GetPrefs();
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), false);
- helper->SigninSuccess();
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), true);
-}
-
-TEST_F(OneClickSigninHelperTest, SigninCancelled) {
- OneClickSigninHelper* helper = SetupHelperForSignin();
-
- PrefService* pref_service = profile_->GetPrefs();
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), false);
- GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
- helper->SigninFailed(error);
- // Should not show the NTP bubble on user cancellation.
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), false);
-}
-
-TEST_F(OneClickSigninHelperTest, SigninFailed) {
- OneClickSigninHelper* helper = SetupHelperForSignin();
-
- PrefService* pref_service = profile_->GetPrefs();
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), false);
- GoogleServiceAuthError error(
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
- helper->SigninFailed(error);
- // Should show the NTP bubble with an error.
- EXPECT_EQ(pref_service->GetBoolean(prefs::kSyncPromoShowNTPBubble), true);
-}
-
// I/O thread tests
TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThread) {

Powered by Google App Engine
This is Rietveld 408576698