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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 EXPECT_TRUE(extension); | 155 EXPECT_TRUE(extension); |
156 EXPECT_EQ("", error); | 156 EXPECT_EQ("", error); |
157 return extension; | 157 return extension; |
158 } | 158 } |
159 | 159 |
160 } // namespace | 160 } // namespace |
161 | 161 |
162 class ThemeSyncableServiceTest : public testing::Test { | 162 class ThemeSyncableServiceTest : public testing::Test { |
163 protected: | 163 protected: |
164 ThemeSyncableServiceTest() | 164 ThemeSyncableServiceTest() |
165 : loop_(MessageLoop::TYPE_DEFAULT), | 165 : loop_(base::MessageLoop::TYPE_DEFAULT), |
166 ui_thread_(BrowserThread::UI, &loop_), | 166 ui_thread_(BrowserThread::UI, &loop_), |
167 file_thread_(BrowserThread::FILE, &loop_), | 167 file_thread_(BrowserThread::FILE, &loop_), |
168 fake_theme_service_(NULL) {} | 168 fake_theme_service_(NULL) {} |
169 | 169 |
170 virtual ~ThemeSyncableServiceTest() {} | 170 virtual ~ThemeSyncableServiceTest() {} |
171 | 171 |
172 virtual void SetUp() { | 172 virtual void SetUp() { |
173 profile_.reset(new TestingProfile); | 173 profile_.reset(new TestingProfile); |
174 fake_theme_service_ = BuildForProfile(profile_.get()); | 174 fake_theme_service_ = BuildForProfile(profile_.get()); |
175 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), | 175 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 sync_pb::EntitySpecifics entity_specifics; | 227 sync_pb::EntitySpecifics entity_specifics; |
228 entity_specifics.mutable_theme()->CopyFrom(theme_specifics); | 228 entity_specifics.mutable_theme()->CopyFrom(theme_specifics); |
229 list.push_back(syncer::SyncData::CreateLocalData( | 229 list.push_back(syncer::SyncData::CreateLocalData( |
230 ThemeSyncableService::kCurrentThemeClientTag, | 230 ThemeSyncableService::kCurrentThemeClientTag, |
231 ThemeSyncableService::kCurrentThemeNodeTitle, | 231 ThemeSyncableService::kCurrentThemeNodeTitle, |
232 entity_specifics)); | 232 entity_specifics)); |
233 return list; | 233 return list; |
234 } | 234 } |
235 | 235 |
236 // Needed for setting up extension service. | 236 // Needed for setting up extension service. |
237 MessageLoop loop_; | 237 base::MessageLoop loop_; |
238 content::TestBrowserThread ui_thread_; | 238 content::TestBrowserThread ui_thread_; |
239 content::TestBrowserThread file_thread_; | 239 content::TestBrowserThread file_thread_; |
240 | 240 |
241 #if defined OS_CHROMEOS | 241 #if defined OS_CHROMEOS |
242 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 242 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
243 chromeos::ScopedTestCrosSettings test_cros_settings_; | 243 chromeos::ScopedTestCrosSettings test_cros_settings_; |
244 chromeos::ScopedTestUserManager test_user_manager_; | 244 chromeos::ScopedTestUserManager test_user_manager_; |
245 #endif | 245 #endif |
246 | 246 |
247 scoped_ptr<TestingProfile> profile_; | 247 scoped_ptr<TestingProfile> profile_; |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 | 608 |
609 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { | 609 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { |
610 // Set up theme service to use custom theme that was installed by policy. | 610 // Set up theme service to use custom theme that was installed by policy. |
611 fake_theme_service_->SetTheme(theme_extension_.get()); | 611 fake_theme_service_->SetTheme(theme_extension_.get()); |
612 | 612 |
613 syncer::SyncDataList data_list = | 613 syncer::SyncDataList data_list = |
614 theme_sync_service_->GetAllSyncData(syncer::THEMES); | 614 theme_sync_service_->GetAllSyncData(syncer::THEMES); |
615 | 615 |
616 ASSERT_EQ(0u, data_list.size()); | 616 ASSERT_EQ(0u, data_list.size()); |
617 } | 617 } |
OLD | NEW |