Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / sync / sync_promo_ui_unittest.cc
index 0c65054..15673d6 100644 (file)
@@ -19,33 +19,15 @@ class SyncPromoUITest : public testing::Test {
   SyncPromoUITest() {}
 
   // testing::Test:
-  virtual void SetUp() OVERRIDE {
+  void SetUp() override {
     testing::Test::SetUp();
-    profile_.reset(new TestingProfile());
+    TestingProfile::Builder builder;
+    builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
+                              FakeSigninManagerBase::Build);
+    profile_ = builder.Build();
   }
 
  protected:
-  void CreateSigninManager(const std::string& username) {
-    SigninManagerBase* signin_manager =
-#if defined(OS_CHROMEOS)
-        static_cast<FakeSigninManagerBase*>(
-            SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
-                profile_.get(),
-                &FakeSigninManagerBase::Build));
-#else
-        static_cast<FakeSigninManager*>(
-            SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
-                profile_.get(),
-                &FakeSigninManager::Build));
-#endif
-    signin_manager->Initialize(profile_.get(), NULL);
-
-    if (!username.empty()) {
-      ASSERT_TRUE(signin_manager);
-      signin_manager->SetAuthenticatedUsername(username);
-    }
-  }
-
   void DisableSync() {
     CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
   }
@@ -59,7 +41,6 @@ class SyncPromoUITest : public testing::Test {
 // Verifies that ShouldShowSyncPromo returns false if sync is disabled by
 // policy.
 TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncDisabled) {
-  CreateSigninManager("");
   DisableSync();
   EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
 }
@@ -67,7 +48,6 @@ TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncDisabled) {
 // Verifies that ShouldShowSyncPromo returns true if all conditions to
 // show the promo are met.
 TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncEnabled) {
-  CreateSigninManager("");
 #if defined(OS_CHROMEOS)
   // No sync promo on CrOS.
   EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));