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

Side by Side Diff: ui/touch_selection/touch_handle_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 unified diff | Download patch
« no previous file with comments | « ui/touch_selection/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/renderer_host/input/touch_handle.h" 5 #include "ui/touch_selection/touch_handle.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/events/test/motion_event_test_utils.h" 8 #include "ui/events/test/motion_event_test_utils.h"
9 #include "ui/gfx/geometry/rect_f.h" 9 #include "ui/gfx/geometry/rect_f.h"
10 10
11 using ui::test::MockMotionEvent; 11 using ui::test::MockMotionEvent;
12 12
13 namespace content { 13 namespace ui {
14 namespace { 14 namespace {
15 15
16 const int kDefaultTapTimeoutMs = 200; 16 const int kDefaultTapTimeoutMs = 200;
17 const float kDefaultTapSlop = 10.f; 17 const float kDefaultTapSlop = 10.f;
18 const float kDefaultDrawableSize = 10.f; 18 const float kDefaultDrawableSize = 10.f;
19 19
20 struct MockDrawableData { 20 struct MockDrawableData {
21 MockDrawableData() 21 MockDrawableData()
22 : orientation(TOUCH_HANDLE_ORIENTATION_UNDEFINED), 22 : orientation(TOUCH_HANDLE_ORIENTATION_UNDEFINED),
23 alpha(0.f), 23 alpha(0.f),
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 event_time += GetTapTimeout() / 2; 482 event_time += GetTapTimeout() / 2;
483 event = MockMotionEvent( 483 event = MockMotionEvent(
484 MockMotionEvent::ACTION_MOVE, event_time, kDefaultTapSlop * 2.f, 0); 484 MockMotionEvent::ACTION_MOVE, event_time, kDefaultTapSlop * 2.f, 0);
485 EXPECT_TRUE(handle.WillHandleTouchEvent(event)); 485 EXPECT_TRUE(handle.WillHandleTouchEvent(event));
486 event = MockMotionEvent( 486 event = MockMotionEvent(
487 MockMotionEvent::ACTION_UP, event_time, kDefaultTapSlop * 2.f, 0); 487 MockMotionEvent::ACTION_UP, event_time, kDefaultTapSlop * 2.f, 0);
488 EXPECT_TRUE(handle.WillHandleTouchEvent(event)); 488 EXPECT_TRUE(handle.WillHandleTouchEvent(event));
489 EXPECT_FALSE(GetAndResetHandleTapped()); 489 EXPECT_FALSE(GetAndResetHandleTapped());
490 } 490 }
491 491
492 } // namespace content 492 } // namespace ui
OLDNEW
« no previous file with comments | « ui/touch_selection/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698