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

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

Issue 1590803003: MacViews: Implement NativeWidgetMac::SetOpacity function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review remarks. Created 4 years, 11 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/widget/native_widget_mac.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 5a48f0257223f75064732e12b1a76061c18a7cd2..b8d29dde228b029abd0719f5eba9d48c4071abcd 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -1089,6 +1089,19 @@ TEST_F(NativeWidgetMacTest, GetWorkAreaBoundsInScreen) {
EXPECT_TRUE(NSIsEmptyRect(actual));
}
+// Test that Widget opacity can be changed.
+TEST_F(NativeWidgetMacTest, ChangeOpacity) {
+ Widget* widget = CreateTopLevelPlatformWidget();
+ NSWindow* ns_window = widget->GetNativeWindow();
+
+ CGFloat old_opacity = [ns_window alphaValue];
+ widget->SetOpacity(0xAA);
+ EXPECT_NE(old_opacity, [ns_window alphaValue]);
+ EXPECT_DOUBLE_EQ(0xAA / 255.0, [ns_window alphaValue]);
+
+ widget->CloseNow();
+}
+
} // namespace test
} // namespace views
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698