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

Side by Side Diff: ash/wm/toplevel_window_event_handler_unittest.cc

Issue 2494713003: Reenable Tabdragging tests failing because of IsWindowPositionManaged() (Closed)
Patch Set: Test window position auto managed setting in ash Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/common/wm/window_state.h" 7 #include "ash/common/wm/window_state.h"
8 #include "ash/common/wm/workspace_controller.h" 8 #include "ash/common/wm/workspace_controller.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 w1->Init(ui::LAYER_TEXTURED); 71 w1->Init(ui::LAYER_TEXTURED);
72 aura::Window* parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), 72 aura::Window* parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(),
73 kShellWindowId_DefaultContainer); 73 kShellWindowId_DefaultContainer);
74 parent->AddChild(w1); 74 parent->AddChild(w1);
75 w1->SetBounds(gfx::Rect(0, 0, 100, 100)); 75 w1->SetBounds(gfx::Rect(0, 0, 100, 100));
76 w1->Show(); 76 w1->Show();
77 return w1; 77 return w1;
78 } 78 }
79 79
80 void DragFromCenterBy(aura::Window* window, int dx, int dy) { 80 void DragFromCenterBy(aura::Window* window, int dx, int dy) {
81 wm::WindowState* window_state = ash::wm::GetWindowState(window);
82 const bool initial_window_position_managed =
83 window_state->window_position_managed();
Mr4D (OOO till 08-26) 2016/11/28 19:32:56 I might be mistaken, but is there any case where t
afakhry 2016/11/28 22:54:25 Thanks for this note. Actually this test is not ve
84
81 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); 85 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
82 generator.DragMouseBy(dx, dy); 86 generator.PressLeftButton();
87 generator.MoveMouseBy(dx, dy);
88
89 // Window position auto management should be disabled during the drag.
90 EXPECT_FALSE(window_state->window_position_managed());
91
92 generator.ReleaseLeftButton();
93
94 // And restored to its original value after the drag is complete.
95 EXPECT_EQ(initial_window_position_managed,
96 window_state->window_position_managed());
83 } 97 }
84 98
85 void TouchDragFromCenterBy(aura::Window* window, int dx, int dy) { 99 void TouchDragFromCenterBy(aura::Window* window, int dx, int dy) {
86 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window); 100 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
87 generator.PressMoveAndReleaseTouchBy(dx, dy); 101 generator.PressMoveAndReleaseTouchBy(dx, dy);
88 } 102 }
89 103
90 std::unique_ptr<ToplevelWindowEventHandler> handler_; 104 std::unique_ptr<ToplevelWindowEventHandler> handler_;
91 105
92 private: 106 private:
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL, 774 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL,
761 move_client->RunMoveLoop(window.get(), gfx::Vector2d(), 775 move_client->RunMoveLoop(window.get(), gfx::Vector2d(),
762 aura::client::WINDOW_MOVE_SOURCE_TOUCH)); 776 aura::client::WINDOW_MOVE_SOURCE_TOUCH));
763 } 777 }
764 778
765 // Showing the resize shadows when the mouse is over the window edges is tested 779 // Showing the resize shadows when the mouse is over the window edges is tested
766 // in resize_shadow_and_cursor_test.cc 780 // in resize_shadow_and_cursor_test.cc
767 781
768 } // namespace test 782 } // namespace test
769 } // namespace ash 783 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698