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

Unified Diff: chrome/browser/themes/theme_syncable_service_unittest.cc

Issue 1379133004: themes: Remove usage of TOOLKIT_GTK define. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: \n Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f2b6151b6f2f21703790a8a535c40dec4ae7a9dc 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,14 @@ class FakeThemeService : public ThemeService {
theme_extension_ = NULL;
}
+ bool IsSystemThemeDistinctFromDefaultTheme() const override {
+ return distinct_from_default_theme_;
+ }
+
+ 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 +119,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 +578,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 +623,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 +661,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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698