| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sync/protocol/theme_specifics.pb.h" | 10 #include "chrome/browser/sync/protocol/theme_specifics.pb.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 TEST_F(ThemeUtilTest, SetCurrentThemeSystemTheme) { | 107 TEST_F(ThemeUtilTest, SetCurrentThemeSystemTheme) { |
| 108 sync_pb::ThemeSpecifics theme_specifics; | 108 sync_pb::ThemeSpecifics theme_specifics; |
| 109 theme_specifics.set_use_system_theme_by_default(true); | 109 theme_specifics.set_use_system_theme_by_default(true); |
| 110 | 110 |
| 111 MockProfile mock_profile; | 111 MockProfile mock_profile; |
| 112 EXPECT_CALL(mock_profile, SetNativeTheme()).Times(1); | 112 EXPECT_CALL(mock_profile, SetNativeTheme()).Times(1); |
| 113 | 113 |
| 114 SetCurrentThemeFromThemeSpecifics(theme_specifics, &mock_profile); | 114 SetCurrentThemeFromThemeSpecifics(theme_specifics, &mock_profile); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // TODO(akalin): Make ExtensionsService/ExtensionUpdater testable | 117 // TODO(akalin): Make ExtensionService/ExtensionUpdater testable |
| 118 // enough to be able to write a unittest for SetCurrentTheme for a | 118 // enough to be able to write a unittest for SetCurrentTheme for a |
| 119 // custom theme. | 119 // custom theme. |
| 120 | 120 |
| 121 TEST_F(ThemeUtilTest, GetThemeSpecificsHelperNoCustomTheme) { | 121 TEST_F(ThemeUtilTest, GetThemeSpecificsHelperNoCustomTheme) { |
| 122 sync_pb::ThemeSpecifics theme_specifics; | 122 sync_pb::ThemeSpecifics theme_specifics; |
| 123 theme_specifics.set_use_custom_theme(true); | 123 theme_specifics.set_use_custom_theme(true); |
| 124 theme_specifics.set_use_system_theme_by_default(true); | 124 theme_specifics.set_use_system_theme_by_default(true); |
| 125 theme_specifics.set_custom_theme_name("name"); | 125 theme_specifics.set_custom_theme_name("name"); |
| 126 theme_specifics.set_custom_theme_id("id"); | 126 theme_specifics.set_custom_theme_id("id"); |
| 127 theme_specifics.set_custom_theme_update_url("updateurl"); | 127 theme_specifics.set_custom_theme_update_url("updateurl"); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // TODO(akalin): Mock out call to GetPrefs() under TOOLKIT_USES_GTK. | 212 // TODO(akalin): Mock out call to GetPrefs() under TOOLKIT_USES_GTK. |
| 213 | 213 |
| 214 sync_pb::ThemeSpecifics theme_specifics; | 214 sync_pb::ThemeSpecifics theme_specifics; |
| 215 SetCurrentThemeFromThemeSpecificsIfNecessary(theme_specifics, | 215 SetCurrentThemeFromThemeSpecificsIfNecessary(theme_specifics, |
| 216 &mock_profile); | 216 &mock_profile); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace | 219 } // namespace |
| 220 | 220 |
| 221 } // namespace browser_sync | 221 } // namespace browser_sync |
| OLD | NEW |