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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_mac_browsertest.mm

Issue 10947019: Constrained Window Cocoa: Disable fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 17
16 class ConstrainedWindowMacTest : public InProcessBrowserTest { 18 class ConstrainedWindowMacTest : public InProcessBrowserTest {
17 public: 19 public:
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 scoped_nsobject<AssertOnTerminateHelper> helper( 140 scoped_nsobject<AssertOnTerminateHelper> helper(
139 [[AssertOnTerminateHelper alloc] init]); 141 [[AssertOnTerminateHelper alloc] init]);
140 [NSApp terminate:nil]; 142 [NSApp terminate:nil];
141 143
142 // Active tab should change and sheet should be visible. 144 // Active tab should change and sheet should be visible.
143 EXPECT_EQ(tab0_, browser()->tab_strip_model()->GetActiveTabContents()); 145 EXPECT_EQ(tab0_, browser()->tab_strip_model()->GetActiveTabContents());
144 EXPECT_EQ(1.0, [sheet_ alphaValue]); 146 EXPECT_EQ(1.0, [sheet_ alphaValue]);
145 147
146 dialog->CloseConstrainedWindow(); 148 dialog->CloseConstrainedWindow();
147 } 149 }
150
151 // Test that adding a sheet disables fullscreen.
152 IN_PROC_BROWSER_TEST_F(ConstrainedWindowMacTest, Fullscreen) {
153 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
154
155 // Dialog will delete it self when closed.
156 ConstrainedWindowMac2* dialog = new ConstrainedWindowMac2(tab1_, sheet_);
157
158 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
159
160 dialog->CloseConstrainedWindow();
161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698