| 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/sync/glue/theme_util.h" | 5 #include "chrome/browser/sync/glue/theme_util.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using ::testing::AnyNumber; | 23 using ::testing::AnyNumber; |
| 24 using ::testing::Return; | 24 using ::testing::Return; |
| 25 | 25 |
| 26 class MockThemeService : public ThemeService { | 26 class MockThemeService : public ThemeService { |
| 27 public: | 27 public: |
| 28 MOCK_METHOD0(SetNativeTheme, void()); | 28 MOCK_METHOD0(SetNativeTheme, void()); |
| 29 MOCK_METHOD0(UseDefaultTheme, void()); | 29 MOCK_METHOD0(UseDefaultTheme, void()); |
| 30 MOCK_CONST_METHOD0(GetThemeID, std::string()); | 30 MOCK_CONST_METHOD0(GetThemeID, std::string()); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 ProfileKeyedBase* BuildMockThemeService(Profile* profile) { | 33 ProfileKeyedService* BuildMockThemeService(Profile* profile) { |
| 34 return new MockThemeService; | 34 return new MockThemeService; |
| 35 } | 35 } |
| 36 | 36 |
| 37 class SyncThemeUtilTest : public testing::Test { | 37 class SyncThemeUtilTest : public testing::Test { |
| 38 protected: | 38 protected: |
| 39 MockThemeService* BuildForProfile(Profile* profile) { | 39 MockThemeService* BuildForProfile(Profile* profile) { |
| 40 return static_cast<MockThemeService*>( | 40 return static_cast<MockThemeService*>( |
| 41 ThemeServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 41 ThemeServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 42 profile, BuildMockThemeService)); | 42 profile, BuildMockThemeService)); |
| 43 } | 43 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // TODO(akalin): Mock out call to GetPrefs() under TOOLKIT_USES_GTK. | 232 // TODO(akalin): Mock out call to GetPrefs() under TOOLKIT_USES_GTK. |
| 233 | 233 |
| 234 sync_pb::ThemeSpecifics theme_specifics; | 234 sync_pb::ThemeSpecifics theme_specifics; |
| 235 SetCurrentThemeFromThemeSpecificsIfNecessary(theme_specifics, | 235 SetCurrentThemeFromThemeSpecificsIfNecessary(theme_specifics, |
| 236 &profile); | 236 &profile); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace | 239 } // namespace |
| 240 | 240 |
| 241 } // namespace browser_sync | 241 } // namespace browser_sync |
| OLD | NEW |