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

Unified Diff: ui/touch_selection/touch_selection_controller_unittest.cc

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/touch_selection/touch_selection_controller.cc ('k') | ui/touch_selection/ui_touch_selection.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_selection_controller_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc b/ui/touch_selection/touch_selection_controller_unittest.cc
similarity index 97%
rename from content/browser/renderer_host/input/touch_selection_controller_unittest.cc
rename to ui/touch_selection/touch_selection_controller_unittest.cc
index 11d793da5ff9391670a2d4ea26f6060f2061f7ac..5b1839a0b74ad1fd99c7849c8d3be799f595292d 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/ui/touch_selection/touch_selection_controller_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/input/touch_selection_controller.h"
+#include "ui/touch_selection/touch_selection_controller.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/test/motion_event_test_utils.h"
using ui::test::MockMotionEvent;
-namespace content {
+namespace ui {
namespace {
const int kDefaultTapTimeoutMs = 200;
@@ -98,18 +98,17 @@ class TouchSelectionControllerTest : public testing::Test,
void SetDraggingEnabled(bool enabled) { dragging_enabled_ = enabled; }
void ClearSelection() {
- controller_->OnSelectionBoundsChanged(cc::ViewportSelectionBound(),
- cc::ViewportSelectionBound());
+ controller_->OnSelectionBoundsChanged(SelectionBound(),
+ SelectionBound());
}
void ClearInsertion() { ClearSelection(); }
void ChangeInsertion(const gfx::RectF& rect, bool visible) {
- cc::ViewportSelectionBound bound;
- bound.type = cc::SELECTION_BOUND_CENTER;
- bound.edge_top = rect.origin();
- bound.edge_bottom = rect.bottom_left();
- bound.visible = visible;
+ SelectionBound bound;
+ bound.set_type(SelectionBound::CENTER);
+ bound.SetEdge(rect.origin(), rect.bottom_left());
+ bound.set_visible(visible);
controller_->OnSelectionBoundsChanged(bound, bound);
}
@@ -117,15 +116,13 @@ class TouchSelectionControllerTest : public testing::Test,
bool start_visible,
const gfx::RectF& end_rect,
bool end_visible) {
- cc::ViewportSelectionBound start_bound, end_bound;
- start_bound.type = cc::SELECTION_BOUND_LEFT;
- end_bound.type = cc::SELECTION_BOUND_RIGHT;
- start_bound.edge_top = start_rect.origin();
- start_bound.edge_bottom = start_rect.bottom_left();
- end_bound.edge_top = end_rect.origin();
- end_bound.edge_bottom = end_rect.bottom_left();
- start_bound.visible = start_visible;
- end_bound.visible = end_visible;
+ SelectionBound start_bound, end_bound;
+ start_bound.set_type(SelectionBound::LEFT);
+ end_bound.set_type(SelectionBound::RIGHT);
+ start_bound.SetEdge(start_rect.origin(), start_rect.bottom_left());
+ end_bound.SetEdge(end_rect.origin(), end_rect.bottom_left());
+ start_bound.set_visible(start_visible);
+ end_bound.set_visible(end_visible);
controller_->OnSelectionBoundsChanged(start_bound, end_bound);
}
@@ -842,4 +839,4 @@ TEST_F(TouchSelectionControllerTest, AllowShowingFromCurrentSelection) {
EXPECT_EQ(insertion_rect.bottom_left(), GetLastEventAnchor());
}
-} // namespace content
+} // namespace ui
« no previous file with comments | « ui/touch_selection/touch_selection_controller.cc ('k') | ui/touch_selection/ui_touch_selection.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698