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

Unified Diff: ui/views/widget/widget_unittest.cc

Issue 388453002: MacViews: NativeWidget -> Widget notifications: fullscreen, activation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 6 years, 2 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_interactive_uitest.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/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index 5bcc006bdd0b28209d37e666b632832bca9ba0cf..7476a04c82fd0b51606dc755f0d5e15654cb53ed 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -928,7 +928,9 @@ TEST_F(WidgetTest, GetWindowBoundsInScreen) {
widget->CloseNow();
}
-#if defined(false)
+// Before being enabled on Mac, this was #ifdef(false).
+// TODO(tapted): Fix this for DesktopNativeWidgets on other platforms.
+#if defined(OS_MACOSX)
// Aura needs shell to maximize/fullscreen window.
// NativeWidgetGtk doesn't implement GetRestoredBounds.
TEST_F(WidgetTest, GetRestoredBounds) {
@@ -938,8 +940,14 @@ TEST_F(WidgetTest, GetRestoredBounds) {
toplevel->Show();
toplevel->Maximize();
RunPendingMessages();
+#if defined(OS_MACOSX)
+ // Current expectation on Mac is to do nothing on Maximize.
+ EXPECT_EQ(toplevel->GetWindowBoundsInScreen().ToString(),
+ toplevel->GetRestoredBounds().ToString());
+#else
EXPECT_NE(toplevel->GetWindowBoundsInScreen().ToString(),
toplevel->GetRestoredBounds().ToString());
+#endif
EXPECT_GT(toplevel->GetRestoredBounds().width(), 0);
EXPECT_GT(toplevel->GetRestoredBounds().height(), 0);
@@ -975,6 +983,9 @@ TEST_F(WidgetTest, ExitFullscreenRestoreState) {
// And it should still be in normal state after getting out of full screen.
EXPECT_EQ(ui::SHOW_STATE_NORMAL, GetWidgetShowState(toplevel));
+// On Mac, a "maximized" state is indistinguishable from a window that just
+// fills the screen, so nothing to check there.
+#if !defined(OS_MACOSX)
// Now, make it maximized.
toplevel->Maximize();
EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel));
@@ -986,6 +997,7 @@ TEST_F(WidgetTest, ExitFullscreenRestoreState) {
// And it stays maximized after getting out of full screen.
EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, GetWidgetShowState(toplevel));
+#endif
// Clean up.
toplevel->Close();
« no previous file with comments | « ui/views/widget/native_widget_mac_interactive_uitest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698