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

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

Issue 2926683003: Enable WidgetTestInteractive.DesktopNativeWidgetWithModalTransientChild on OS_WIN (Closed)
Patch Set: change to the test coverage only Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_interactive_uitest.cc
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc
index cd58ae0ec9c4f1f1bbdecf18b4cc97a2a7ea082d..8de867cf8a84d84f4c0cd03bc6c3dbc78049e088 100644
--- a/ui/views/widget/widget_interactive_uitest.cc
+++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -1271,12 +1271,18 @@ TEST_F(WidgetTestInteractive, RestoreAfterMinimize) {
widget->CloseNow();
}
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_WIN)
-// TODO(warx): Investigate the flakiness on OS_WIN (crbug.com/729331).
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// Tests that when a desktop native widget has modal transient child, it should
// avoid restore focused view itself as the modal transient child window will do
// that, thus avoids having multiple focused view visually (crbug.com/727641).
TEST_F(WidgetTestInteractive, DesktopNativeWidgetWithModalTransientChild) {
+#if defined(OS_WIN)
sky 2017/06/07 16:09:34 I get that you really only need this for windows,
Qiang(Joe) Xu 2017/06/07 17:28:17 yes, we can always do it. Done.
+ // On Windows, Widget::Deactivate() works by activating the next topmost
+ // window on the z-order stack. This only works if there is at least one other
+ // window, so make sure that is the case.
+ Widget* deactivate_widget = CreateWidget();
+ deactivate_widget->Show();
+#endif
// Create a top level desktop native widget.
Widget* top_level = CreateWidget();
@@ -1315,8 +1321,12 @@ TEST_F(WidgetTestInteractive, DesktopNativeWidgetWithModalTransientChild) {
EXPECT_FALSE(textfield->HasFocus());
top_level->CloseNow();
+
+#if defined(OS_WIN)
+ deactivate_widget->CloseNow();
+#endif
}
-#endif // defined(USE_AURA) && !defined(OS_CHROMEOS) && !defined(OS_WIN)
+#endif // defined(USE_AURA) && !defined(OS_CHROMEOS)
namespace {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698