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

Side by Side Diff: ui/touch_selection/touch_selection_controller_unittest.cc

Issue 1263703004: Revert of Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/touch_selection/touch_selection_controller.h" 5 #include "ui/touch_selection/touch_selection_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/events/test/motion_event_test_utils.h" 11 #include "ui/events/test/motion_event_test_utils.h"
12 #include "ui/touch_selection/touch_selection_controller_test_api.h"
13 12
14 using testing::ElementsAre; 13 using testing::ElementsAre;
15 using testing::IsEmpty; 14 using testing::IsEmpty;
16 using ui::test::MockMotionEvent; 15 using ui::test::MockMotionEvent;
17 16
18 namespace ui { 17 namespace ui {
19 namespace { 18 namespace {
20 19
21 const int kDefaultTapTimeoutMs = 200; 20 const int kDefaultTapTimeoutMs = 200;
22 const float kDefaulTapSlop = 10.f; 21 const float kDefaulTapSlop = 10.f;
(...skipping 14 matching lines...) Expand all
37 } 36 }
38 37
39 private: 38 private:
40 bool* intersects_rect_; 39 bool* intersects_rect_;
41 40
42 DISALLOW_COPY_AND_ASSIGN(MockTouchHandleDrawable); 41 DISALLOW_COPY_AND_ASSIGN(MockTouchHandleDrawable);
43 }; 42 };
44 43
45 } // namespace 44 } // namespace
46 45
46 class TouchSelectionControllerTestApi {
47 public:
48 explicit TouchSelectionControllerTestApi(TouchSelectionController* controller)
49 : controller_(controller) {}
50 ~TouchSelectionControllerTestApi() {}
51
52 bool GetStartVisible() const { return controller_->GetStartVisible(); }
53 bool GetEndVisible() const { return controller_->GetEndVisible(); }
54
55 private:
56 TouchSelectionController* controller_;
57
58 DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerTestApi);
59 };
60
47 class TouchSelectionControllerTest : public testing::Test, 61 class TouchSelectionControllerTest : public testing::Test,
48 public TouchSelectionControllerClient { 62 public TouchSelectionControllerClient {
49 public: 63 public:
50 TouchSelectionControllerTest() 64 TouchSelectionControllerTest()
51 : caret_moved_(false), 65 : caret_moved_(false),
52 selection_moved_(false), 66 selection_moved_(false),
53 selection_points_swapped_(false), 67 selection_points_swapped_(false),
54 needs_animate_(false), 68 needs_animate_(false),
55 animation_enabled_(true), 69 animation_enabled_(true),
56 dragging_enabled_(false) {} 70 dragging_enabled_(false) {}
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 EXPECT_EQ(gfx::RectF(6, 5, 44, 10), controller().GetRectBetweenBounds()); 1290 EXPECT_EQ(gfx::RectF(6, 5, 44, 10), controller().GetRectBetweenBounds());
1277 EXPECT_EQ(GetLastEventBoundsRect(), controller().GetRectBetweenBounds()); 1291 EXPECT_EQ(GetLastEventBoundsRect(), controller().GetRectBetweenBounds());
1278 1292
1279 ClearSelection(); 1293 ClearSelection();
1280 ASSERT_THAT(GetAndResetEvents(), 1294 ASSERT_THAT(GetAndResetEvents(),
1281 ElementsAre(SELECTION_DISSOLVED, SELECTION_HANDLES_CLEARED)); 1295 ElementsAre(SELECTION_DISSOLVED, SELECTION_HANDLES_CLEARED));
1282 EXPECT_EQ(gfx::RectF(), controller().GetRectBetweenBounds()); 1296 EXPECT_EQ(gfx::RectF(), controller().GetRectBetweenBounds());
1283 } 1297 }
1284 1298
1285 } // namespace ui 1299 } // namespace ui
OLDNEW
« no previous file with comments | « ui/touch_selection/touch_selection_controller_test_api.cc ('k') | ui/touch_selection/ui_touch_selection.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698