| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 5 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/signin/fake_signin_manager.h" | 11 #include "chrome/browser/signin/fake_signin_manager.h" |
| 12 #include "chrome/browser/signin/signin_manager_factory.h" | 12 #include "chrome/browser/signin/signin_manager_factory.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 class SyncPromoUITest : public testing::Test { | 17 class SyncPromoUITest : public testing::Test { |
| 18 public: | 18 public: |
| 19 SyncPromoUITest() {} | 19 SyncPromoUITest() {} |
| 20 | 20 |
| 21 // testing::Test: | 21 // testing::Test: |
| 22 virtual void SetUp() OVERRIDE { | 22 virtual void SetUp() override { |
| 23 testing::Test::SetUp(); | 23 testing::Test::SetUp(); |
| 24 TestingProfile::Builder builder; | 24 TestingProfile::Builder builder; |
| 25 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), | 25 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), |
| 26 FakeSigninManagerBase::Build); | 26 FakeSigninManagerBase::Build); |
| 27 profile_ = builder.Build(); | 27 profile_ = builder.Build(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 void DisableSync() { | 31 void DisableSync() { |
| 32 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); | 32 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 // Verifies that ShouldShowSyncPromo returns true if all conditions to | 48 // Verifies that ShouldShowSyncPromo returns true if all conditions to |
| 49 // show the promo are met. | 49 // show the promo are met. |
| 50 TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncEnabled) { | 50 TEST_F(SyncPromoUITest, ShouldShowSyncPromoSyncEnabled) { |
| 51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 52 // No sync promo on CrOS. | 52 // No sync promo on CrOS. |
| 53 EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get())); | 53 EXPECT_FALSE(SyncPromoUI::ShouldShowSyncPromo(profile_.get())); |
| 54 #else | 54 #else |
| 55 EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(profile_.get())); | 55 EXPECT_TRUE(SyncPromoUI::ShouldShowSyncPromo(profile_.get())); |
| 56 #endif | 56 #endif |
| 57 } | 57 } |
| OLD | NEW |