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

Unified Diff: ui/events/gesture_detection/motion_event_buffer_unittest.cc

Issue 502993004: Remove abstract Clone and Cancel methods from MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nasty bug fix Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/gesture_detection/motion_event_buffer_unittest.cc
diff --git a/ui/events/gesture_detection/motion_event_buffer_unittest.cc b/ui/events/gesture_detection/motion_event_buffer_unittest.cc
index badbd9883f460155fcac2c355bc721d14e8e24ae..ba018b2c9cac895e57f48a6fc663b594977f030c 100644
--- a/ui/events/gesture_detection/motion_event_buffer_unittest.cc
+++ b/ui/events/gesture_detection/motion_event_buffer_unittest.cc
@@ -7,7 +7,7 @@
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/gesture_detection/motion_event_buffer.h"
-#include "ui/events/test/mock_motion_event.h"
+#include "ui/events/test/motion_event_test_utils.h"
using base::TimeDelta;
using base::TimeTicks;
@@ -41,14 +41,14 @@ class MotionEventBufferTest : public testing::Test,
public MotionEventBufferClient {
public:
MotionEventBufferTest() : needs_flush_(false) {}
- virtual ~MotionEventBufferTest() {}
+ ~MotionEventBufferTest() override {}
// MotionEventBufferClient implementation.
- virtual void ForwardMotionEvent(const MotionEvent& event) override {
+ void ForwardMotionEvent(const MotionEvent& event) override {
forwarded_events_.push_back(event.Clone().release());
}
- virtual void SetNeedsFlush() override { needs_flush_ = true; }
+ void SetNeedsFlush() override { needs_flush_ = true; }
bool GetAndResetNeedsFlush() {
bool needs_flush = needs_flush_;
@@ -344,9 +344,9 @@ TEST_F(MotionEventBufferTest, BufferFlushedOnIncompatibleActionMove) {
event_time += base::TimeDelta::FromMilliseconds(5);
// Events with different pointer ids should not combine.
- PointerProperties pointer0(5.f, 5.f);
+ PointerProperties pointer0(5.f, 5.f, 1.f);
pointer0.id = 1;
- PointerProperties pointer1(10.f, 10.f);
+ PointerProperties pointer1(10.f, 10.f, 2.f);
pointer1.id = 2;
MotionEventGeneric move3(MotionEvent::ACTION_MOVE, event_time, pointer0);
move3.PushPointer(pointer1);
@@ -407,9 +407,9 @@ TEST_F(MotionEventBufferTest, OutOfOrderPointersBuffered) {
base::TimeTicks event_time = base::TimeTicks::Now();
MotionEventBuffer buffer(this, true);
- PointerProperties p0(1.f, 2.f);
+ PointerProperties p0(1.f, 2.f, 3.f);
p0.id = 1;
- PointerProperties p1(2.f, 1.f);
+ PointerProperties p1(2.f, 1.f, 0.5f);
p1.id = 2;
MotionEventGeneric move0(MotionEvent::ACTION_MOVE, event_time, p0);
« no previous file with comments | « ui/events/gesture_detection/motion_event_buffer.cc ('k') | ui/events/gesture_detection/motion_event_generic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698