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

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: Fix merge conflict 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..39454d80127df9734226e3245b3710098822b8fe 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,13 @@ const char kImplicitURLString[] =
"https://accounts.google.com/ServiceLogin"
"?service=foo&continue=http://foo.google.com";
+bool UseWebBasedSigninFlow() {
+ const bool use_web_based_singin_flow =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseWebBasedSigninFlow);
Andrew T Wilson (Slow) 2012/12/03 13:19:02 Why do we have a separate variable? Also, should b
Roger Tawa OOO till Jul 10th 2012/12/03 19:08:28 No need. Too bad we're now loosing the singin'
+ return use_web_based_singin_flow;
+}
+
class SigninManagerMock : public FakeSigninManager {
public:
explicit SigninManagerMock(Profile* profile)
@@ -352,21 +359,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) {

Powered by Google App Engine
This is Rietveld 408576698