OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h" | 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.h" |
6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" |
7 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" |
8 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 11 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
13 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
14 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
16 | 18 |
17 using ::testing::NiceMock; | 19 using ::testing::NiceMock; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 NiceMock<ConstrainedWindowDelegateMock> delegate; | 114 NiceMock<ConstrainedWindowDelegateMock> delegate; |
113 ConstrainedWindowMac2 dialog(&delegate, tab1_, sheet_); | 115 ConstrainedWindowMac2 dialog(&delegate, tab1_, sheet_); |
114 EXPECT_EQ(1.0, [sheet_ alphaValue]); | 116 EXPECT_EQ(1.0, [sheet_ alphaValue]); |
115 | 117 |
116 // Close the tab. | 118 // Close the tab. |
117 EXPECT_EQ(2, browser()->tab_count()); | 119 EXPECT_EQ(2, browser()->tab_count()); |
118 EXPECT_TRUE(browser()->tab_strip_model()->CloseTabContentsAt( | 120 EXPECT_TRUE(browser()->tab_strip_model()->CloseTabContentsAt( |
119 1, TabStripModel::CLOSE_USER_GESTURE)); | 121 1, TabStripModel::CLOSE_USER_GESTURE)); |
120 EXPECT_EQ(1, browser()->tab_count()); | 122 EXPECT_EQ(1, browser()->tab_count()); |
121 } | 123 } |
| 124 |
| 125 // Test that adding a sheet disables fullscreen. |
| 126 IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, Fullscreen) { |
| 127 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); |
| 128 |
| 129 // Dialog will delete it self when closed. |
| 130 NiceMock<ConstrainedWindowDelegateMock> delegate; |
| 131 ConstrainedWindowMac2 dialog(&delegate, tab1_, sheet_); |
| 132 |
| 133 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); |
| 134 |
| 135 dialog.CloseConstrainedWindow(); |
| 136 } |
OLD | NEW |