Index: ash/wm/toplevel_window_event_handler_unittest.cc |
diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc |
index 23aa801cdff39f3585313bc7d482e773b895dbad..0d04382240034ca46e11b7832f4cb7473a3ddad3 100644 |
--- a/ash/wm/toplevel_window_event_handler_unittest.cc |
+++ b/ash/wm/toplevel_window_event_handler_unittest.cc |
@@ -134,7 +134,6 @@ TEST_F(ToplevelWindowEventHandlerTest, WindowPositionAutoManagement) { |
generator.PressLeftButton(); |
aura::client::WindowMoveClient* move_client = |
aura::client::GetWindowMoveClient(w1->GetRootWindow()); |
- // generator.PressLeftButton(); |
base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, |
base::Bind(&ContinueAndCompleteDrag, base::Unretained(&generator), |
@@ -168,34 +167,16 @@ TEST_F(ToplevelWindowEventHandlerTest, WindowPositionAutoManagement) { |
EXPECT_EQ(size.ToString(), w1->bounds().size().ToString()); |
} |
-namespace { |
- |
-class CancelDragObserver : public aura::WindowObserver { |
- public: |
- CancelDragObserver() {} |
- ~CancelDragObserver() override {} |
- |
- void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override { |
- aura::client::CaptureClient* client = |
- aura::client::GetCaptureClient(params.target->GetRootWindow()); |
- client->SetCapture(nullptr); |
- } |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(CancelDragObserver); |
-}; |
- |
-} // namespace |
- |
// Cancelling drag while starting window drag should not crash. |
TEST_F(ToplevelWindowEventHandlerTest, CancelWhileDragStart) { |
std::unique_ptr<aura::Window> w1(CreateWindow(HTCAPTION)); |
- CancelDragObserver observer; |
- w1->AddObserver(&observer); |
gfx::Point origin = w1->bounds().origin(); |
- DragFromCenterBy(w1.get(), 100, 100); |
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), w1.get()); |
+ generator.PressLeftButton(); |
+ generator.MoveMouseBy(100, 100); |
+ generator.PressKey(ui::VKEY_ESCAPE, 0); |
+ generator.ReleaseLeftButton(); |
EXPECT_EQ(origin, w1->bounds().origin()); |
- w1->RemoveObserver(&observer); |
} |
oshima
2017/02/23 02:21:02
Is this test still meaningful? I guess this was to
afakhry
2017/02/23 18:08:54
It seems we still have reparenting with panels: ht
|
TEST_F(ToplevelWindowEventHandlerTest, BottomRight) { |
@@ -830,7 +811,7 @@ TEST_F(ToplevelWindowEventHandlerTest, DragSnappedWindowToExternalDisplay) { |
// Snap the window to the right. |
wm::WindowState* window_state = wm::GetWindowState(w1.get()); |
ASSERT_TRUE(window_state->CanSnap()); |
- const wm::WMEvent event(wm::WM_EVENT_CYCLE_SNAP_DOCK_RIGHT); |
+ const wm::WMEvent event(wm::WM_EVENT_CYCLE_SNAP_RIGHT); |
window_state->OnWMEvent(&event); |
ASSERT_TRUE(window_state->IsSnapped()); |