Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/themes/theme_syncable_service_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 EXPECT_TRUE(extension); 154 EXPECT_TRUE(extension);
155 EXPECT_EQ("", error); 155 EXPECT_EQ("", error);
156 return extension; 156 return extension;
157 } 157 }
158 158
159 } // namespace 159 } // namespace
160 160
161 class ThemeSyncableServiceTest : public testing::Test { 161 class ThemeSyncableServiceTest : public testing::Test {
162 protected: 162 protected:
163 ThemeSyncableServiceTest() 163 ThemeSyncableServiceTest()
164 : loop_(MessageLoop::TYPE_DEFAULT), 164 : loop_(base::MessageLoop::TYPE_DEFAULT),
165 ui_thread_(BrowserThread::UI, &loop_), 165 ui_thread_(BrowserThread::UI, &loop_),
166 file_thread_(BrowserThread::FILE, &loop_), 166 file_thread_(BrowserThread::FILE, &loop_),
167 fake_theme_service_(NULL) {} 167 fake_theme_service_(NULL) {}
168 168
169 virtual ~ThemeSyncableServiceTest() {} 169 virtual ~ThemeSyncableServiceTest() {}
170 170
171 virtual void SetUp() { 171 virtual void SetUp() {
172 profile_.reset(new TestingProfile); 172 profile_.reset(new TestingProfile);
173 fake_theme_service_ = BuildForProfile(profile_.get()); 173 fake_theme_service_ = BuildForProfile(profile_.get());
174 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), 174 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(),
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 sync_pb::EntitySpecifics entity_specifics; 226 sync_pb::EntitySpecifics entity_specifics;
227 entity_specifics.mutable_theme()->CopyFrom(theme_specifics); 227 entity_specifics.mutable_theme()->CopyFrom(theme_specifics);
228 list.push_back(syncer::SyncData::CreateLocalData( 228 list.push_back(syncer::SyncData::CreateLocalData(
229 ThemeSyncableService::kCurrentThemeClientTag, 229 ThemeSyncableService::kCurrentThemeClientTag,
230 ThemeSyncableService::kCurrentThemeNodeTitle, 230 ThemeSyncableService::kCurrentThemeNodeTitle,
231 entity_specifics)); 231 entity_specifics));
232 return list; 232 return list;
233 } 233 }
234 234
235 // Needed for setting up extension service. 235 // Needed for setting up extension service.
236 MessageLoop loop_; 236 base::MessageLoop loop_;
237 content::TestBrowserThread ui_thread_; 237 content::TestBrowserThread ui_thread_;
238 content::TestBrowserThread file_thread_; 238 content::TestBrowserThread file_thread_;
239 239
240 #if defined OS_CHROMEOS 240 #if defined OS_CHROMEOS
241 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; 241 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
242 chromeos::ScopedTestCrosSettings test_cros_settings_; 242 chromeos::ScopedTestCrosSettings test_cros_settings_;
243 chromeos::ScopedTestUserManager test_user_manager_; 243 chromeos::ScopedTestUserManager test_user_manager_;
244 #endif 244 #endif
245 245
246 scoped_ptr<TestingProfile> profile_; 246 scoped_ptr<TestingProfile> profile_;
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 607
608 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { 608 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) {
609 // Set up theme service to use custom theme that was installed by policy. 609 // Set up theme service to use custom theme that was installed by policy.
610 fake_theme_service_->SetTheme(theme_extension_.get()); 610 fake_theme_service_->SetTheme(theme_extension_.get());
611 611
612 syncer::SyncDataList data_list = 612 syncer::SyncDataList data_list =
613 theme_sync_service_->GetAllSyncData(syncer::THEMES); 613 theme_sync_service_->GetAllSyncData(syncer::THEMES);
614 614
615 ASSERT_EQ(0u, data_list.size()); 615 ASSERT_EQ(0u, data_list.size());
616 } 616 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698