Commit 94890fd9 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Fix some multi-process tab-dragging tests

With recent fixes for multi-display (crbug.com/892714), now
some tests in tab-dragging works. Still the test code needs
to wait for the bounds changes, since related display ID
change arrives asynchronously.

Two tests are still failing because of other reasons.

BUG=890071
TEST=single_process_mash_interactive_ui_tests

Change-Id: I2b73f5ded68fcf0431b67d03737cd137ea57e3d1
Reviewed-on: https://chromium-review.googlesource.com/c/1300689
Commit-Queue: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603257}
parent 7ccea3ac
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h"
#include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/screen_position_client.h"
#include "ui/aura/test/event_generator_delegate_aura.h" #include "ui/aura/test/event_generator_delegate_aura.h"
#include "ui/aura/test/mus/change_completion_waiter.h"
#include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_event_dispatcher.h"
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
#include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_manager.h"
...@@ -2002,6 +2003,10 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ...@@ -2002,6 +2003,10 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest,
display::Screen* screen = display::Screen::GetScreen(); display::Screen* screen = display::Screen::GetScreen();
Display second_display = ui_test_utils::GetSecondaryDisplay(screen); Display second_display = ui_test_utils::GetSecondaryDisplay(screen);
browser2->window()->SetBounds(second_display.work_area()); browser2->window()->SetBounds(second_display.work_area());
// In Mash, the display change as the result of the bounds change is processed
// asynchronously in the window server, it should wait for those changes to
// complete.
aura::test::WaitForAllChangesToComplete();
EXPECT_EQ( EXPECT_EQ(
second_display.id(), second_display.id(),
screen->GetDisplayNearestWindow(browser2->window()->GetNativeWindow()) screen->GetDisplayNearestWindow(browser2->window()->GetNativeWindow())
...@@ -2108,6 +2113,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ...@@ -2108,6 +2113,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest,
browser()->window()->SetBounds(work_area); browser()->window()->SetBounds(work_area);
work_area.set_x(work_area.right()); work_area.set_x(work_area.right());
browser2->window()->SetBounds(work_area); browser2->window()->SetBounds(work_area);
// Wait for the display changes. See the ealier comments for the details.
aura::test::WaitForAllChangesToComplete();
EXPECT_EQ( EXPECT_EQ(
second_display.id(), second_display.id(),
screen->GetDisplayNearestWindow(browser()->window()->GetNativeWindow()) screen->GetDisplayNearestWindow(browser()->window()->GetNativeWindow())
...@@ -2232,6 +2239,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest, ...@@ -2232,6 +2239,8 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest,
display::Screen* screen = display::Screen::GetScreen(); display::Screen* screen = display::Screen::GetScreen();
const std::pair<Display, Display> displays = GetDisplays(screen); const std::pair<Display, Display> displays = GetDisplays(screen);
browser2->window()->SetBounds(displays.second.work_area()); browser2->window()->SetBounds(displays.second.work_area());
// Wait for the display changes. See the ealier comments for the details.
aura::test::WaitForAllChangesToComplete();
EXPECT_EQ( EXPECT_EQ(
displays.second.id(), displays.second.id(),
screen->GetDisplayNearestWindow(browser2->window()->GetNativeWindow()) screen->GetDisplayNearestWindow(browser2->window()->GetNativeWindow())
...@@ -2526,6 +2535,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -2526,6 +2535,8 @@ IN_PROC_BROWSER_TEST_F(
.id()); .id());
browser()->window()->SetBounds(displays.second.work_area()); browser()->window()->SetBounds(displays.second.work_area());
// Wait for the display changes. See the ealier comments for the details.
aura::test::WaitForAllChangesToComplete();
EXPECT_EQ( EXPECT_EQ(
displays.second.id(), displays.second.id(),
screen->GetDisplayNearestWindow(browser()->window()->GetNativeWindow()) screen->GetDisplayNearestWindow(browser()->window()->GetNativeWindow())
......
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
# TabDragging: crbug.com/890071 # TabDragging: crbug.com/890071
-DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest.CancelDragTabToWindowIn1stDisplay -DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest.CancelDragTabToWindowIn1stDisplay
-TabDragging/DetachToBrowserInSeparateDisplayTabDragControllerTest.DragBrowserWindowWhenMajorityOfBoundsInSecondDisplay/0 -TabDragging/DetachToBrowserInSeparateDisplayTabDragControllerTest.DragBrowserWindowWhenMajorityOfBoundsInSecondDisplay/0
-TabDragging/DetachToBrowserInSeparateDisplayTabDragControllerTest.DragSingleTabToSeparateWindowInSecondDisplay/0
-TabDragging/DetachToBrowserInSeparateDisplayTabDragControllerTest.DragTabToWindowInSeparateDisplay/0
-TabDragging/DetachToBrowserInSeparateDisplayTabDragControllerTest.DragTabToWindowOnSecondDisplay/0
-TabDragging/DetachToBrowserTabDragControllerTest.DeferredTargetTabStripTest/1 -TabDragging/DetachToBrowserTabDragControllerTest.DeferredTargetTabStripTest/1
-TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindowFromMaximizedWindow/1 -TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindowFromMaximizedWindow/1
-TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindowWhileInImmersiveFullscreenMode/1 -TabDragging/DetachToBrowserTabDragControllerTest.DetachToOwnWindowWhileInImmersiveFullscreenMode/1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment