Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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.
| |
| OLD | NEW |