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

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

Issue 1707233002: Reduce the fullscreen window height by 1px on activation loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: ui/views/widget/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index 1ca9e88b8737a441cb7da5cd4fa9e88e7bfcad7c..5e0e18ed9b023e50b05a965efd54e66c4f5964b7 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -3391,6 +3391,37 @@ TEST_F(WidgetTest, DestroyInSysCommandNCLButtonDownOnCaption) {
widget.CloseNow();
}
+// On Windows if we create a fullscreen window on a thread, then it affects the
+// way other windows on the thread interact with the taskbar. To workaround
+// this we switch the fullscreen state of a window when it loses activation to
+// a window on the same monitor. This test verifies the same.
+TEST_F(WidgetTest, FullscreenStateSwitchedOnActivationLoss) {
+ Widget widget1;
+ Widget::InitParams params =
+ CreateParams(Widget::InitParams::TYPE_WINDOW);
+ params.native_widget = new PlatformDesktopNativeWidget(&widget1);
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ widget1.Init(params);
+ widget1.SetBounds(gfx::Rect(0, 0, 200, 200));
+ widget1.Show();
+
+ Widget widget2;
+ params.native_widget = new PlatformDesktopNativeWidget(&widget2);
+ params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ widget2.Init(params);
+ widget2.SetBounds(gfx::Rect(0, 0, 200, 200));
+ widget2.Show();
+
+ widget1.SetFullscreen(true);
+ EXPECT_TRUE(widget1.IsFullscreen());
+
+ widget2.Activate();
+
+ EXPECT_FALSE(widget1.IsFullscreen());
+
+ widget1.CloseNow();
+ widget2.CloseNow();
+}
#endif
// Test that SetAlwaysOnTop and IsAlwaysOnTop are consistent.

Powered by Google App Engine
This is Rietveld 408576698