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

Unified 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: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_window_native_widget_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
index be99c163ba4ce921e29b4103357fb11ccd46e6c6..3992b5f43cdf629dddcae3215d33a6d62e4956bc 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
@@ -213,3 +213,30 @@ IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, Fullscreen) {
EXPECT_FALSE(window->IsFullscreen());
EXPECT_FALSE([ns_window styleMask] & NSFullScreenWindowMask);
}
+
+// Test that, in frameless windows, the web contents has the same size as the
+// window.
+IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, Frameless) {
+ extensions::AppWindow* app_window =
+ CreateTestAppWindow("{\"frame\": \"none\"}");
+ NSWindow* ns_window = app_window->GetNativeWindow();
+ NSView* web_contents = app_window->web_contents()->GetNativeView();
+ EXPECT_TRUE(NSEqualSizes(NSMakeSize(512, 384), [web_contents frame].size));
+ // Move and resize the window.
+ NSRect new_frame = NSMakeRect(50, 50, 200, 200);
+ [ns_window setFrame:new_frame display:YES];
+ EXPECT_TRUE(NSEqualSizes(new_frame.size, [web_contents frame].size));
+
+ // Windows created with NSBorderlessWindowMask by default don't have shadow,
+ // but packaged apps should always have one.
+ EXPECT_TRUE([ns_window hasShadow]);
+
+ // Since the window has no constraints, it should have all of the following
+ // style mask bits.
+ NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
+ NSMiniaturizableWindowMask | NSResizableWindowMask |
+ NSTexturedBackgroundWindowMask;
+ EXPECT_EQ(style_mask, [ns_window styleMask]);
+
+ CloseAppWindow(app_window);
+}
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_window_native_widget_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698