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

Unified Diff: ui/views/widget/native_widget_mac_unittest.mm

Issue 2219663003: MacViews: Claim -[NSView isOpaque] for the content view according to the root layer properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: _TRUE,_FALSE Created 4 years, 4 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 | « ui/views/cocoa/bridged_content_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac_unittest.mm
diff --git a/ui/views/widget/native_widget_mac_unittest.mm b/ui/views/widget/native_widget_mac_unittest.mm
index 37d71bbf8c57132cbcfb991675a785589381c2cb..5ae9c03a58f71ea4f5fb5b9df7ca4dd630e02198 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -1379,6 +1379,31 @@ TEST_F(NativeWidgetMacTest, InvalidateShadow) {
widget->CloseNow();
}
+// Test that the contentView opacity corresponds to the window type.
+TEST_F(NativeWidgetMacTest, ContentOpacity) {
+ NativeWidgetMacTestWindow* window;
+ Widget::InitParams init_params =
+ CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+
+ EXPECT_EQ(init_params.opacity, Widget::InitParams::INFER_OPACITY);
+ Widget* widget = CreateWidgetWithTestWindow(init_params, &window);
+
+ // Infer should default to opaque on Mac.
+ EXPECT_TRUE([[window contentView] isOpaque]);
+ widget->CloseNow();
+
+ init_params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW;
+ widget = CreateWidgetWithTestWindow(init_params, &window);
+ EXPECT_FALSE([[window contentView] isOpaque]);
+ widget->CloseNow();
+
+ // Test opaque explicitly.
+ init_params.opacity = Widget::InitParams::OPAQUE_WINDOW;
+ widget = CreateWidgetWithTestWindow(init_params, &window);
+ EXPECT_TRUE([[window contentView] isOpaque]);
+ widget->CloseNow();
+}
+
// Test the expected result of GetWorkAreaBoundsInScreen().
TEST_F(NativeWidgetMacTest, GetWorkAreaBoundsInScreen) {
Widget widget;
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698