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

Unified Diff: mash/wm/frame/move_loop_unittest.cc

Issue 2002243002: Gets mash to use WmToplevelWindowEventHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 7 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 | « mash/wm/frame/move_loop.cc ('k') | mash/wm/root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/frame/move_loop_unittest.cc
diff --git a/mash/wm/frame/move_loop_unittest.cc b/mash/wm/frame/move_loop_unittest.cc
deleted file mode 100644
index 387ab8e4d05168ad7d19120bbf77f214b1708f04..0000000000000000000000000000000000000000
--- a/mash/wm/frame/move_loop_unittest.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mash/wm/frame/move_loop.h"
-
-#include <stddef.h>
-
-#include "base/macros.h"
-#include "components/mus/public/cpp/tests/test_window.h"
-#include "mojo/converters/input_events/input_events_type_converters.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/hit_test.h"
-#include "ui/events/event.h"
-#include "ui/gfx/geometry/point.h"
-#include "ui/gfx/geometry/rect.h"
-
-using MoveLoopTest = testing::Test;
-
-namespace mash {
-namespace wm {
-
-TEST_F(MoveLoopTest, Move) {
- struct TestData {
- // One of the HitTestCompat values.
- int ht_location;
- // Amount to move the mouse by.
- int delta_x;
- int delta_y;
- gfx::Rect expected_bounds;
- } data[] = {
- // Move.
- {HTCAPTION, 1, 2, gfx::Rect(101, 202, 300, 400)},
-
- // Resizing
- {HTTOPLEFT, 1, 2, gfx::Rect(101, 202, 299, 398)},
- {HTLEFT, 1, 2, gfx::Rect(101, 200, 299, 400)},
- {HTBOTTOMLEFT, -1, -2, gfx::Rect(99, 200, 301, 398)},
- {HTBOTTOM, -1, 4, gfx::Rect(100, 200, 300, 404)},
- {HTBOTTOMRIGHT, -3, 4, gfx::Rect(100, 200, 297, 404)},
- {HTRIGHT, 6, -4, gfx::Rect(100, 200, 306, 400)},
- {HTTOPRIGHT, 6, 5, gfx::Rect(100, 205, 306, 395)},
- };
-
- for (size_t i = 0; i < arraysize(data); ++i) {
- mus::TestWindow window;
- window.SetBounds(gfx::Rect(100, 200, 300, 400));
- gfx::Point pointer_location(51, 52);
- ui::PointerEvent pointer_down_event(
- ui::ET_POINTER_DOWN, ui::EventPointerType::POINTER_TYPE_TOUCH,
- pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta());
- std::unique_ptr<MoveLoop> move_loop =
- MoveLoop::Create(&window, data[i].ht_location, pointer_down_event);
- ASSERT_TRUE(move_loop.get()) << i;
- pointer_location.Offset(data[i].delta_x, data[i].delta_y);
- ui::PointerEvent pointer_move_event(
- ui::ET_POINTER_MOVED, ui::EventPointerType::POINTER_TYPE_TOUCH,
- pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta());
- ASSERT_EQ(MoveLoop::MoveResult::CONTINUE,
- move_loop->Move(pointer_move_event))
- << i;
- ASSERT_EQ(data[i].expected_bounds, window.bounds());
- }
-}
-
-} // namespace wm
-} // namespace mash
« no previous file with comments | « mash/wm/frame/move_loop.cc ('k') | mash/wm/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698