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

Unified Diff: ash/wm/toplevel_window_event_handler_unittest.cc

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Yet another Rebase ... Created 3 years, 10 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
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());

Powered by Google App Engine
This is Rietveld 408576698