OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "chrome/browser/sync/profile_sync_service_factory.h" | 7 #include "chrome/browser/sync/profile_sync_service_factory.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
| 10 #include "content/public/test/test_browser_thread_bundle.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 class ProfileSyncServiceFactoryTest : public testing::Test { | 13 class ProfileSyncServiceFactoryTest : public testing::Test { |
13 protected: | 14 protected: |
14 ProfileSyncServiceFactoryTest() {} | 15 ProfileSyncServiceFactoryTest() {} |
15 | 16 |
16 void SetUp() override { | 17 void SetUp() override { |
17 profile_.reset(new TestingProfile()); | 18 profile_.reset(new TestingProfile()); |
18 } | 19 } |
19 | 20 |
| 21 content::TestBrowserThreadBundle thread_bundle_; |
20 scoped_ptr<Profile> profile_; | 22 scoped_ptr<Profile> profile_; |
21 }; | 23 }; |
22 | 24 |
23 // Verify that the disable sync flag disables creation of the sync service. | 25 // Verify that the disable sync flag disables creation of the sync service. |
24 TEST_F(ProfileSyncServiceFactoryTest, DisableSyncFlag) { | 26 TEST_F(ProfileSyncServiceFactoryTest, DisableSyncFlag) { |
25 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); | 27 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync); |
26 EXPECT_EQ(nullptr, ProfileSyncServiceFactory::GetForProfile(profile_.get())); | 28 EXPECT_EQ(nullptr, ProfileSyncServiceFactory::GetForProfile(profile_.get())); |
27 } | 29 } |
OLD | NEW |