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

Unified Diff: chrome/browser/ui/gtk/gtk_theme_service_unittest.cc

Issue 9447096: gtk: Rename GtkThemeService to ThemeServiceGtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « chrome/browser/ui/gtk/gtk_theme_service.cc ('k') | chrome/browser/ui/gtk/gtk_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/gtk_theme_service_unittest.cc
diff --git a/chrome/browser/ui/gtk/gtk_theme_service_unittest.cc b/chrome/browser/ui/gtk/gtk_theme_service_unittest.cc
deleted file mode 100644
index 6802f5f3a818085b6443e2b0d5d4b46c3fd3677c..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/gtk/gtk_theme_service_unittest.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <gtk/gtk.h>
-
-#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/gtk/gtk_theme_service.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/test/base/testing_profile.h"
-#include "grit/theme_resources.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/skia_utils_gtk.h"
-
-class GtkThemeServiceTest : public testing::Test {
- public:
- GtkThemeServiceTest() : provider_(NULL) {}
-
- void SetUseGtkTheme(bool use_gtk_theme) {
- profile_.GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, use_gtk_theme);
- }
-
- void BuildProvider() {
- provider_ = GtkThemeService::GetFrom(&profile_);
- }
-
- protected:
- TestingProfile profile_;
-
- GtkThemeService* provider_;
-};
-
-TEST_F(GtkThemeServiceTest, DefaultValues) {
- SetUseGtkTheme(false);
- BuildProvider();
-
- // Test that we get the default theme colors back when in normal mode.
- for (int i = ThemeService::COLOR_FRAME;
- i <= ThemeService::COLOR_BUTTON_BACKGROUND; ++i) {
- EXPECT_EQ(provider_->GetColor(i), ThemeService::GetDefaultColor(i))
- << "Wrong default color for " << i;
- }
-}
-
-TEST_F(GtkThemeServiceTest, UsingGtkValues) {
- SetUseGtkTheme(true);
- BuildProvider();
-
- // This test only verifies that we're using GTK values. Because of Gtk's
- // large, implied global state, it would take some IN_PROCESS_BROWSER_TESTS
- // to write an equivalent of DefaultValues above in a way that wouldn't make
- // other tests flaky. kColorTabText is the only simple path where there's no
- // weird calculations for edge cases so use that as a simple test.
- GtkWidget* fake_label = provider_->fake_label();
- GtkStyle* label_style = gtk_rc_get_style(fake_label);
- GdkColor label_color = label_style->fg[GTK_STATE_NORMAL];
- EXPECT_EQ(provider_->GetColor(ThemeService::COLOR_TAB_TEXT),
- gfx::GdkColorToSkColor(label_color));
-}
« no previous file with comments | « chrome/browser/ui/gtk/gtk_theme_service.cc ('k') | chrome/browser/ui/gtk/gtk_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698