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

Side by Side Diff: components/exo/pointer_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 | « components/exo/pointer_delegate.h ('k') | components/exo/touch_delegate.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/common/shell_window_ids.h" 5 #include "ash/common/shell_window_ids.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "components/exo/buffer.h" 7 #include "components/exo/buffer.h"
8 #include "components/exo/pointer.h" 8 #include "components/exo/pointer.h"
9 #include "components/exo/pointer_delegate.h" 9 #include "components/exo/pointer_delegate.h"
10 #include "components/exo/shell_surface.h" 10 #include "components/exo/shell_surface.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class MockPointerDelegate : public PointerDelegate { 23 class MockPointerDelegate : public PointerDelegate {
24 public: 24 public:
25 MockPointerDelegate() {} 25 MockPointerDelegate() {}
26 26
27 // Overridden from PointerDelegate: 27 // Overridden from PointerDelegate:
28 MOCK_METHOD1(OnPointerDestroying, void(Pointer*)); 28 MOCK_METHOD1(OnPointerDestroying, void(Pointer*));
29 MOCK_CONST_METHOD1(CanAcceptPointerEventsForSurface, bool(Surface*)); 29 MOCK_CONST_METHOD1(CanAcceptPointerEventsForSurface, bool(Surface*));
30 MOCK_METHOD3(OnPointerEnter, void(Surface*, const gfx::PointF&, int)); 30 MOCK_METHOD3(OnPointerEnter, void(Surface*, const gfx::PointF&, int));
31 MOCK_METHOD1(OnPointerLeave, void(Surface*)); 31 MOCK_METHOD1(OnPointerLeave, void(Surface*));
32 MOCK_METHOD2(OnPointerMotion, void(base::TimeDelta, const gfx::PointF&)); 32 MOCK_METHOD2(OnPointerMotion, void(base::TimeTicks, const gfx::PointF&));
33 MOCK_METHOD3(OnPointerButton, void(base::TimeDelta, int, bool)); 33 MOCK_METHOD3(OnPointerButton, void(base::TimeTicks, int, bool));
34 MOCK_METHOD3(OnPointerScroll, 34 MOCK_METHOD3(OnPointerScroll,
35 void(base::TimeDelta, const gfx::Vector2dF&, bool)); 35 void(base::TimeTicks, const gfx::Vector2dF&, bool));
36 MOCK_METHOD1(OnPointerScrollCancel, void(base::TimeDelta)); 36 MOCK_METHOD1(OnPointerScrollCancel, void(base::TimeTicks));
37 MOCK_METHOD1(OnPointerScrollStop, void(base::TimeDelta)); 37 MOCK_METHOD1(OnPointerScrollStop, void(base::TimeTicks));
38 MOCK_METHOD0(OnPointerFrame, void()); 38 MOCK_METHOD0(OnPointerFrame, void());
39 }; 39 };
40 40
41 TEST_F(PointerTest, SetCursor) { 41 TEST_F(PointerTest, SetCursor) {
42 std::unique_ptr<Surface> surface(new Surface); 42 std::unique_ptr<Surface> surface(new Surface);
43 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 43 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
44 gfx::Size buffer_size(10, 10); 44 gfx::Size buffer_size(10, 10);
45 std::unique_ptr<Buffer> buffer( 45 std::unique_ptr<Buffer> buffer(
46 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 46 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
47 surface->Attach(buffer.get()); 47 surface->Attach(buffer.get());
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 EXPECT_CALL(delegate, 284 EXPECT_CALL(delegate,
285 OnPointerScroll(testing::_, gfx::Vector2dF(1, 1), true)); 285 OnPointerScroll(testing::_, gfx::Vector2dF(1, 1), true));
286 generator.MoveMouseWheel(1, 1); 286 generator.MoveMouseWheel(1, 1);
287 287
288 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get())); 288 EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
289 pointer.reset(); 289 pointer.reset();
290 } 290 }
291 291
292 } // namespace 292 } // namespace
293 } // namespace exo 293 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/pointer_delegate.h ('k') | components/exo/touch_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698