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

Unified Diff: chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm

Issue 7734003: Implement basic theming for panel titlebars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 4 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
Index: chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm
diff --git a/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm b/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm
index 8c3cbab92d0d5256c48c4383f7bbf30a968aca67..d6246eacec94e28b57c3f41649654c026ac82302 100644
--- a/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm
+++ b/chrome/browser/ui/panels/panel_browser_window_cocoa_unittest.mm
@@ -17,6 +17,7 @@
#import "chrome/browser/ui/cocoa/browser_test_helper.h"
#import "chrome/browser/ui/cocoa/browser_window_utils.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/ui/cocoa/run_loop_testing.h"
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_manager.h"
#import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h"
@@ -27,6 +28,7 @@
#include "chrome/test/base/ui_test_utils.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/gtest_mac.h"
// Main test class.
class PanelBrowserWindowCocoaTest : public CocoaTest {
@@ -329,3 +331,28 @@ TEST_F(PanelBrowserWindowCocoaTest, KeyEvent) {
inWindow:[native_window->controller_ window]];
ClosePanelAndWait(panel->browser());
}
+
+// Verify that the theme provider is properly plumbed through.
+TEST_F(PanelBrowserWindowCocoaTest, ThemeProvider) {
+ Panel* panel = CreateTestPanel("Test Panel");
+ ASSERT_TRUE(panel);
+
+ PanelBrowserWindowCocoa* native_window =
+ static_cast<PanelBrowserWindowCocoa*>(panel->native_panel());
+ ASSERT_TRUE(native_window);
+ EXPECT_TRUE(NULL != [[native_window->controller_ window] themeProvider]);
+ ClosePanelAndWait(panel->browser());
+}
+
+TEST_F(PanelBrowserWindowCocoaTest, SetTitle) {
+ Panel* panel = CreateTestPanel("Test Panel");
+ ASSERT_TRUE(panel);
+
+ PanelBrowserWindowCocoa* native_window =
+ static_cast<PanelBrowserWindowCocoa*>(panel->native_panel());
+ ASSERT_TRUE(native_window);
+ [native_window->controller_ updateTitleBar];
+ chrome::testing::NSRunLoopRunAllPending();
+ EXPECT_NSEQ(@"Untitled", [[native_window->controller_ window] title]);
+ ClosePanelAndWait(panel->browser());
+}

Powered by Google App Engine
This is Rietveld 408576698