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()); |
+} |