| Index: chrome/browser/ui/sync/sync_promo_ui_unittest.cc
|
| diff --git a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
|
| index 1a9d8d6727e0a10bd6127794cec4828b2ae678ac..20aa0296066ef9c029141831918eb7071ea79e47 100644
|
| --- a/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
|
| +++ b/chrome/browser/ui/sync/sync_promo_ui_unittest.cc
|
| @@ -12,26 +12,18 @@
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| +#include "content/public/test/test_browser_thread_bundle.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| class SyncPromoUITest : public testing::Test {
|
| - public:
|
| - SyncPromoUITest() {}
|
| -
|
| - // testing::Test:
|
| - virtual void SetUp() OVERRIDE {
|
| - testing::Test::SetUp();
|
| - profile_.reset(new TestingProfile());
|
| - }
|
| -
|
| protected:
|
| void CreateSigninManager(const std::string& username) {
|
| SigninManagerBase* signin_manager =
|
| static_cast<FakeSigninManagerBase*>(
|
| SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse(
|
| - profile_.get(),
|
| + &profile_,
|
| &FakeSigninManagerBase::Build));
|
| - signin_manager->Initialize(profile_.get(), NULL);
|
| + signin_manager->Initialize(&profile_, NULL);
|
|
|
| if (!username.empty()) {
|
| ASSERT_TRUE(signin_manager);
|
| @@ -43,10 +35,8 @@ class SyncPromoUITest : public testing::Test {
|
| CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
|
| }
|
|
|
| - scoped_ptr<TestingProfile> profile_;
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(SyncPromoUITest);
|
| + content::TestBrowserThreadBundle thread_bundle_;
|
| + TestingProfile profile_;
|
| };
|
|
|
| // Verifies that ShouldShowSyncPromo returns false if sync is disabled by
|
| @@ -54,7 +44,7 @@ class SyncPromoUITest : public testing::Test {
|
| TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncDisabled) {
|
| CreateSigninManager("");
|
| DisableSync();
|
| - EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
|
| + EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
|
| }
|
|
|
| // Verifies that ShouldShowSyncPromo returns true if all conditions to
|
| @@ -63,8 +53,8 @@ TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncEnabled) {
|
| CreateSigninManager("");
|
| #if defined(OS_CHROMEOS)
|
| // No sync promo on CrOS.
|
| - EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
|
| + EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
|
| #else
|
| - EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(profile_.get()));
|
| + EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(&profile_));
|
| #endif
|
| }
|
|
|