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

Side by Side Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « no previous file | ash/keyboard_uma_event_filter.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/drag_drop/drag_drop_controller.h" 5 #include "ash/drag_drop/drag_drop_controller.h"
6 6
7 #include "ash/drag_drop/drag_drop_tracker.h" 7 #include "ash/drag_drop/drag_drop_tracker.h"
8 #include "ash/drag_drop/drag_image_view.h" 8 #include "ash/drag_drop/drag_image_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 AddViewToWidgetAndResize(widget.get(), drag_view); 1070 AddViewToWidgetAndResize(widget.get(), drag_view);
1071 ui::OSExchangeData data; 1071 ui::OSExchangeData data;
1072 data.SetString(base::UTF8ToUTF16("I am being dragged")); 1072 data.SetString(base::UTF8ToUTF16("I am being dragged"));
1073 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), 1073 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
1074 widget->GetNativeView()); 1074 widget->GetNativeView());
1075 1075
1076 gfx::Point start = gfx::Rect(drag_view->bounds()).CenterPoint(); 1076 gfx::Point start = gfx::Rect(drag_view->bounds()).CenterPoint();
1077 gfx::Point mid = start + gfx::Vector2d(drag_view->bounds().width() / 6, 0); 1077 gfx::Point mid = start + gfx::Vector2d(drag_view->bounds().width() / 6, 0);
1078 gfx::Point end = start + gfx::Vector2d(drag_view->bounds().width() / 3, 0); 1078 gfx::Point end = start + gfx::Vector2d(drag_view->bounds().width() / 3, 0);
1079 1079
1080 base::TimeDelta timestamp = ui::EventTimeForNow(); 1080 base::TimeTicks timestamp = ui::EventTimeForNow();
1081 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, start, 0, timestamp); 1081 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, start, 0, timestamp);
1082 generator.Dispatch(&press); 1082 generator.Dispatch(&press);
1083 1083
1084 DispatchGesture(ui::ET_GESTURE_LONG_PRESS, start); 1084 DispatchGesture(ui::ET_GESTURE_LONG_PRESS, start);
1085 UpdateDragData(&data); 1085 UpdateDragData(&data);
1086 timestamp += base::TimeDelta::FromMilliseconds(10); 1086 timestamp += base::TimeDelta::FromMilliseconds(10);
1087 ui::TouchEvent move1(ui::ET_TOUCH_MOVED, mid, 0, timestamp); 1087 ui::TouchEvent move1(ui::ET_TOUCH_MOVED, mid, 0, timestamp);
1088 generator.Dispatch(&move1); 1088 generator.Dispatch(&move1);
1089 // Doing two moves instead of one will guarantee to generate a fling at the 1089 // Doing two moves instead of one will guarantee to generate a fling at the
1090 // end. 1090 // end.
(...skipping 11 matching lines...) Expand all
1102 drag_drop_controller_->drag_string_); 1102 drag_drop_controller_->drag_string_);
1103 EXPECT_EQ(1, drag_view->num_drag_enters_); 1103 EXPECT_EQ(1, drag_view->num_drag_enters_);
1104 EXPECT_EQ(2, drag_view->num_drag_updates_); 1104 EXPECT_EQ(2, drag_view->num_drag_updates_);
1105 EXPECT_EQ(1, drag_view->num_drops_); 1105 EXPECT_EQ(1, drag_view->num_drops_);
1106 EXPECT_EQ(0, drag_view->num_drag_exits_); 1106 EXPECT_EQ(0, drag_view->num_drag_exits_);
1107 EXPECT_TRUE(drag_view->drag_done_received_); 1107 EXPECT_TRUE(drag_view->drag_done_received_);
1108 } 1108 }
1109 1109
1110 } // namespace test 1110 } // namespace test
1111 } // namespace ash 1111 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/keyboard_uma_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698