| 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_mac.h" | 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | |
| 11 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 12 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| 13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 14 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" | 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
| 17 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 18 #include "content/public/browser/web_contents_view.h" | 16 #include "content/public/browser/web_contents_view.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 20 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 ConstrainedWindowMac dialog(&delegate, tab1_, sheet_); | 148 ConstrainedWindowMac dialog(&delegate, tab1_, sheet_); |
| 151 EXPECT_EQ(1.0, [sheet_window_ alphaValue]); | 149 EXPECT_EQ(1.0, [sheet_window_ alphaValue]); |
| 152 | 150 |
| 153 // Close the tab. | 151 // Close the tab. |
| 154 TabStripModel* tab_strip = browser()->tab_strip_model(); | 152 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 155 EXPECT_EQ(2, tab_strip->count()); | 153 EXPECT_EQ(2, tab_strip->count()); |
| 156 EXPECT_TRUE(tab_strip->CloseWebContentsAt(1, | 154 EXPECT_TRUE(tab_strip->CloseWebContentsAt(1, |
| 157 TabStripModel::CLOSE_USER_GESTURE)); | 155 TabStripModel::CLOSE_USER_GESTURE)); |
| 158 EXPECT_EQ(1, tab_strip->count()); | 156 EXPECT_EQ(1, tab_strip->count()); |
| 159 } | 157 } |
| 160 | |
| 161 // Test that adding a sheet disables fullscreen. | |
| 162 IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, Fullscreen) { | |
| 163 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); | |
| 164 | |
| 165 // Dialog will delete it self when closed. | |
| 166 NiceMock<ConstrainedWindowDelegateMock> delegate; | |
| 167 ConstrainedWindowMac dialog(&delegate, tab1_, sheet_); | |
| 168 | |
| 169 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); | |
| 170 | |
| 171 dialog.CloseWebContentsModalDialog(); | |
| 172 } | |
| OLD | NEW |