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

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

Issue 11418200: Setup from settings should allow configuration first (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 8 years 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 fa2090c6daaf72ee8601e34f5e950b9ccfcf469e..0806aa5ab75baef5125ab63db270d4e8ddb426a0 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -48,6 +48,11 @@ const char kImplicitURLString[] =
"https://accounts.google.com/ServiceLogin"
"?service=foo&continue=http://foo.google.com";
+bool UseWebBasedSigninFlow() {
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseWebBasedSigninFlow);
+}
+
class SigninManagerMock : public FakeSigninManager {
public:
explicit SigninManagerMock(Profile* profile)
@@ -352,21 +357,22 @@ TEST_F(OneClickSigninHelperTest, CanOfferFirstSetup) {
EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)).
WillRepeatedly(Return(true));
- // Invoke OneClickTestProfileSyncService factory function and grab result.
- OneClickTestProfileSyncService* sync =
- static_cast<OneClickTestProfileSyncService*>(
- ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
- static_cast<Profile*>(browser_context()),
- OneClickTestProfileSyncService::Build));
+ // Invoke OneClickTestProfileSyncService factory function and grab result.
+ OneClickTestProfileSyncService* sync =
+ static_cast<OneClickTestProfileSyncService*>(
+ ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
+ static_cast<Profile*>(browser_context()),
+ OneClickTestProfileSyncService::Build));
- sync->set_first_setup_in_progress(true);
+ sync->set_first_setup_in_progress(true);
- EXPECT_FALSE(OneClickSigninHelper::CanOffer(web_contents(),
- "foo@gmail.com",
- true));
- EXPECT_TRUE(OneClickSigninHelper::CanOffer(web_contents(),
- "foo@gmail.com",
- false));
+ EXPECT_EQ(UseWebBasedSigninFlow(),
+ OneClickSigninHelper::CanOffer(web_contents(),
+ "foo@gmail.com",
+ true));
+ EXPECT_TRUE(OneClickSigninHelper::CanOffer(web_contents(),
+ "foo@gmail.com",
+ false));
}
TEST_F(OneClickSigninHelperTest, CanOfferProfileConnected) {
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.cc ('k') | chrome/browser/ui/sync/one_click_signin_sync_starter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698