OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/themes/theme_syncable_service.h" | 5 #include "chrome/browser/themes/theme_syncable_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 } // namespace | 139 } // namespace |
140 | 140 |
141 class ThemeSyncableServiceTest : public testing::Test { | 141 class ThemeSyncableServiceTest : public testing::Test { |
142 protected: | 142 protected: |
143 ThemeSyncableServiceTest() | 143 ThemeSyncableServiceTest() |
144 : ui_thread_(content::BrowserThread::UI, &loop_), | 144 : ui_thread_(content::BrowserThread::UI, &loop_), |
145 file_thread_(content::BrowserThread::FILE, &loop_), | 145 file_thread_(content::BrowserThread::FILE, &loop_), |
146 fake_theme_service_(NULL) {} | 146 fake_theme_service_(NULL) {} |
147 | 147 |
148 virtual ~ThemeSyncableServiceTest() {} | 148 ~ThemeSyncableServiceTest() override {} |
149 | 149 |
150 virtual void SetUp() { | 150 void SetUp() override { |
151 profile_.reset(new TestingProfile); | 151 profile_.reset(new TestingProfile); |
152 fake_theme_service_ = BuildForProfile(profile_.get()); | 152 fake_theme_service_ = BuildForProfile(profile_.get()); |
153 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), | 153 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), |
154 fake_theme_service_)); | 154 fake_theme_service_)); |
155 fake_change_processor_.reset(new syncer::FakeSyncChangeProcessor); | 155 fake_change_processor_.reset(new syncer::FakeSyncChangeProcessor); |
156 SetUpExtension(); | 156 SetUpExtension(); |
157 } | 157 } |
158 | 158 |
159 virtual void TearDown() { | 159 void TearDown() override { |
160 profile_.reset(); | 160 profile_.reset(); |
161 loop_.RunUntilIdle(); | 161 loop_.RunUntilIdle(); |
162 } | 162 } |
163 | 163 |
164 void SetUpExtension() { | 164 void SetUpExtension() { |
165 CommandLine command_line(CommandLine::NO_PROGRAM); | 165 CommandLine command_line(CommandLine::NO_PROGRAM); |
166 extensions::TestExtensionSystem* test_ext_system = | 166 extensions::TestExtensionSystem* test_ext_system = |
167 static_cast<extensions::TestExtensionSystem*>( | 167 static_cast<extensions::TestExtensionSystem*>( |
168 extensions::ExtensionSystem::Get(profile_.get())); | 168 extensions::ExtensionSystem::Get(profile_.get())); |
169 ExtensionService* service = test_ext_system->CreateExtensionService( | 169 ExtensionService* service = test_ext_system->CreateExtensionService( |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { | 650 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { |
651 // Set up theme service to use custom theme that was installed by policy. | 651 // Set up theme service to use custom theme that was installed by policy. |
652 fake_theme_service_->SetTheme(theme_extension_.get()); | 652 fake_theme_service_->SetTheme(theme_extension_.get()); |
653 | 653 |
654 syncer::SyncDataList data_list = | 654 syncer::SyncDataList data_list = |
655 theme_sync_service_->GetAllSyncData(syncer::THEMES); | 655 theme_sync_service_->GetAllSyncData(syncer::THEMES); |
656 | 656 |
657 ASSERT_EQ(0u, data_list.size()); | 657 ASSERT_EQ(0u, data_list.size()); |
658 } | 658 } |
OLD | NEW |