Chromium Code Reviews| Index: chrome/browser/themes/theme_syncable_service_unittest.cc |
| diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc |
| index 7a772875e29fc2b6c2265464378aaeb2fc55bb55..efb30320782cb756447b11a54151928bdd62bd17 100644 |
| --- a/chrome/browser/themes/theme_syncable_service_unittest.cc |
| +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc |
| @@ -59,6 +59,7 @@ class FakeThemeService : public ThemeService { |
| FakeThemeService() : |
| using_system_theme_(false), |
| using_default_theme_(false), |
| + distinct_from_default_theme_(false), |
| theme_extension_(NULL), |
| is_dirty_(false) {} |
| @@ -84,6 +85,13 @@ class FakeThemeService : public ThemeService { |
| theme_extension_ = NULL; |
| } |
| + bool IsSystemThemeDistinctFromDefaultTheme() const override { |
| + return distinct_from_default_theme_; |
| + } |
|
pkotwicz
2015/10/28 15:02:11
Nit: New line
tfarina
2015/10/28 18:55:13
Done.
|
| + void set_distinct_from_default_theme(bool is_distinct) { |
| + distinct_from_default_theme_ = is_distinct; |
| + } |
| + |
| bool UsingDefaultTheme() const override { return using_default_theme_; } |
| bool UsingSystemTheme() const override { return using_system_theme_; } |
| @@ -110,6 +118,7 @@ class FakeThemeService : public ThemeService { |
| private: |
| bool using_system_theme_; |
| bool using_default_theme_; |
| + bool distinct_from_default_theme_; |
| scoped_refptr<const extensions::Extension> theme_extension_; |
| bool is_dirty_; |
| }; |
| @@ -568,9 +577,9 @@ TEST_F(ThemeSyncableServiceTest, RestoreSystemThemeBitWhenChangeToCustomTheme) { |
| EXPECT_TRUE(change_specifics.use_system_theme_by_default()); |
| } |
| -#if defined(TOOLKIT_GTK) |
| -TEST_F(ThemeSyncableServiceTest, |
| - GtkUpdateSystemThemeBitWhenChangeBetweenSystemAndDefault) { |
| +TEST_F(ThemeSyncableServiceTest, DistinctSystemTheme) { |
| + fake_theme_service_->set_distinct_from_default_theme(true); |
| + |
| // Initialize to use native theme. |
| fake_theme_service_->UseSystemTheme(); |
| fake_theme_service_->MarkClean(); |
| @@ -613,11 +622,10 @@ TEST_F(ThemeSyncableServiceTest, |
| .theme() |
| .use_system_theme_by_default()); |
| } |
| -#endif |
| -#ifndef TOOLKIT_GTK |
| -TEST_F(ThemeSyncableServiceTest, |
| - NonGtkPreserveSystemThemeBitWhenChangeToDefaultTheme) { |
| +TEST_F(ThemeSyncableServiceTest, SystemThemeSameAsDefaultTheme) { |
| + fake_theme_service_->set_distinct_from_default_theme(false); |
| + |
| // Set up theme service to use default theme. |
| fake_theme_service_->UseDefaultTheme(); |
| @@ -652,7 +660,6 @@ TEST_F(ThemeSyncableServiceTest, |
| EXPECT_FALSE(change_specifics.use_custom_theme()); |
| EXPECT_TRUE(change_specifics.use_system_theme_by_default()); |
| } |
| -#endif |
| TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { |
| // Set up theme service to use custom theme that was installed by policy. |