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

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm

Issue 987323002: [MacViews] Frameless app windows: make content view cover title bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test size of web contents, not content view. Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // This file tests whichever implementation of NativeAppWindow is used. 5 // This file tests whichever implementation of NativeAppWindow is used.
6 // I.e. it could be NativeAppWindowCocoa or ChromeNativeAppWindowViewsMac. 6 // I.e. it could be NativeAppWindowCocoa or ChromeNativeAppWindowViewsMac.
7 #include "extensions/browser/app_window/native_app_window.h" 7 #include "extensions/browser/app_window/native_app_window.h"
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 10
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 watcher.reset([[ScopedNotificationWatcher alloc] 206 watcher.reset([[ScopedNotificationWatcher alloc]
207 initWithNotification:NSWindowDidExitFullScreenNotification 207 initWithNotification:NSWindowDidExitFullScreenNotification
208 andObject:ns_window]); 208 andObject:ns_window]);
209 [ns_window toggleFullScreen:nil]; 209 [ns_window toggleFullScreen:nil];
210 [watcher waitForNotification]; 210 [watcher waitForNotification];
211 EXPECT_EQ(extensions::AppWindow::FULLSCREEN_TYPE_NONE, 211 EXPECT_EQ(extensions::AppWindow::FULLSCREEN_TYPE_NONE,
212 app_window->fullscreen_types_for_test()); 212 app_window->fullscreen_types_for_test());
213 EXPECT_FALSE(window->IsFullscreen()); 213 EXPECT_FALSE(window->IsFullscreen());
214 EXPECT_FALSE([ns_window styleMask] & NSFullScreenWindowMask); 214 EXPECT_FALSE([ns_window styleMask] & NSFullScreenWindowMask);
215 } 215 }
216
217 // Test that, in frameless windows, the web contents has the same size as the
218 // window.
219 IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, Frameless) {
220 extensions::AppWindow* app_window =
221 CreateTestAppWindow("{\"frame\": \"none\"}");
222 NSWindow* ns_window = app_window->GetNativeWindow();
223 NSView* web_contents = app_window->web_contents()->GetNativeView();
224 EXPECT_TRUE(NSEqualSizes([ns_window frame].size, [web_contents frame].size));
225 // Move and resize the window.
226 [ns_window setFrame:NSMakeRect(50, 50, 200, 200) display:YES];
tapted 2015/03/18 00:06:38 can you add a check that ensures this wasn't simpl
jackhou1 2015/03/18 03:44:39 Done.
227 EXPECT_TRUE(NSEqualSizes([ns_window frame].size, [web_contents frame].size));
228 CloseAppWindow(app_window);
229 }
tapted 2015/03/18 00:06:38 I think there are some other things this CL fixes
jackhou1 2015/03/18 03:44:39 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698