| 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/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } // namespace | 148 } // namespace |
| 149 | 149 |
| 150 class ThemeSyncableServiceTest : public testing::Test { | 150 class ThemeSyncableServiceTest : public testing::Test { |
| 151 protected: | 151 protected: |
| 152 ThemeSyncableServiceTest() | 152 ThemeSyncableServiceTest() |
| 153 : loop_(MessageLoop::TYPE_DEFAULT), | 153 : loop_(MessageLoop::TYPE_DEFAULT), |
| 154 ui_thread_(BrowserThread::UI, &loop_), | 154 ui_thread_(BrowserThread::UI, &loop_), |
| 155 file_thread_(BrowserThread::FILE, &loop_), | 155 file_thread_(BrowserThread::FILE, &loop_), |
| 156 fake_theme_service_(NULL) {} | 156 fake_theme_service_(NULL) {} |
| 157 | 157 |
| 158 ~ThemeSyncableServiceTest() {} | 158 virtual ~ThemeSyncableServiceTest() {} |
| 159 | 159 |
| 160 virtual void SetUp() { | 160 virtual void SetUp() { |
| 161 profile_.reset(new TestingProfile); | 161 profile_.reset(new TestingProfile); |
| 162 fake_theme_service_ = BuildForProfile(profile_.get()); | 162 fake_theme_service_ = BuildForProfile(profile_.get()); |
| 163 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), | 163 theme_sync_service_.reset(new ThemeSyncableService(profile_.get(), |
| 164 fake_theme_service_)); | 164 fake_theme_service_)); |
| 165 fake_change_processor_.reset(new FakeSyncChangeProcessor); | 165 fake_change_processor_.reset(new FakeSyncChangeProcessor); |
| 166 SetUpExtension(); | 166 SetUpExtension(); |
| 167 } | 167 } |
| 168 | 168 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 // use_system_theme_by_default bit should be preserved. | 563 // use_system_theme_by_default bit should be preserved. |
| 564 fake_theme_service_->UseDefaultTheme(); | 564 fake_theme_service_->UseDefaultTheme(); |
| 565 theme_sync_service_->OnThemeChange(); | 565 theme_sync_service_->OnThemeChange(); |
| 566 EXPECT_EQ(1u, change_list.size()); | 566 EXPECT_EQ(1u, change_list.size()); |
| 567 const sync_pb::ThemeSpecifics& change_specifics = | 567 const sync_pb::ThemeSpecifics& change_specifics = |
| 568 change_list[0].sync_data().GetSpecifics().theme(); | 568 change_list[0].sync_data().GetSpecifics().theme(); |
| 569 EXPECT_FALSE(change_specifics.use_custom_theme()); | 569 EXPECT_FALSE(change_specifics.use_custom_theme()); |
| 570 EXPECT_TRUE(change_specifics.use_system_theme_by_default()); | 570 EXPECT_TRUE(change_specifics.use_system_theme_by_default()); |
| 571 } | 571 } |
| 572 #endif | 572 #endif |
| OLD | NEW |