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

Unified Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 2642273002: CrOS - Make it possible to Alt+Tab while dragging a tab (Closed)
Patch Set: fix tests Created 3 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 | « ash/common/wm/window_cycle_list.cc ('k') | ash/wm/window_cycle_event_filter_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_cycle_controller_unittest.cc
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index 1694d153e32c68007a8b640cf3ca394adb495a08..c8382484ad37d98626f30bedd0d45e5ebde1393e 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -650,35 +650,20 @@ TEST_F(WindowCycleControllerTest, MouseEventsCaptured) {
WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
controller->HandleCycleWindow(WindowCycleController::FORWARD);
- // Events don't get through.
- generator.ClickLeftButton();
+ // Most mouse events don't get through.
+ generator.PressLeftButton();
EXPECT_EQ(0, event_count.GetMouseEventCountAndReset());
+ // Although releases do.
+ generator.ReleaseLeftButton();
+ EXPECT_LT(0, event_count.GetMouseEventCountAndReset());
+
// Stop cycling: once again, events get through.
controller->CompleteCycling();
generator.ClickLeftButton();
EXPECT_LT(0, event_count.GetMouseEventCountAndReset());
}
-// If mouse capture is lost, the UI closes.
-TEST_F(WindowCycleControllerTest, MouseCaptureLost) {
- // This delegate allows the window to receive mouse events.
- aura::test::TestWindowDelegate delegate;
- std::unique_ptr<Window> w0(CreateTestWindowInShellWithDelegate(
- &delegate, 0, gfx::Rect(0, 0, 100, 100)));
- std::unique_ptr<Window> w1(CreateTestWindowInShellWithId(1));
-
- // Start cycling.
- WindowCycleController* controller = WmShell::Get()->window_cycle_controller();
- controller->HandleCycleWindow(WindowCycleController::FORWARD);
-
- // Some other widget grabs capture and this causes Alt+Tab to cease.
- std::unique_ptr<views::Widget> widget = CreateTestWidget(
- nullptr, kShellWindowId_DefaultContainer, gfx::Rect(1, 2, 3, 4));
- widget->SetCapture(nullptr);
- EXPECT_FALSE(controller->IsCycling());
-}
-
// Tests that we can cycle past fullscreen windows: https://crbug.com/622396.
// Fullscreen windows are special in that they are allowed to handle alt+tab
// keypresses, which means the window cycle event filter should not handle
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/wm/window_cycle_event_filter_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698