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

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc

Issue 2886283004: input: Fix running the completion callback for telemetry gesture. (Closed)
Patch Set: . Created 3 years, 7 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: content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
index 95d4ee1c377b8c49c1a915196e7c40b7e9f980d0..3ebe91678954095f4d0d8cd90f58a201218bcfde 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
@@ -660,6 +660,21 @@ class MockSyntheticPointerMouseActionTarget
WebMouseEvent::Button button_;
};
+class DummySyntheticGestureControllerDelegate
+ : public SyntheticGestureController::Delegate {
+ public:
+ DummySyntheticGestureControllerDelegate() {}
+ ~DummySyntheticGestureControllerDelegate() override {}
+
+ private:
+ // SyntheticGestureController::Delegate:
+ void RequestBeginFrameForSynthesizedInput(
+ base::OnceClosure callback) override {}
+ bool HasGestureStopped() override { return true; }
+
+ DISALLOW_COPY_AND_ASSIGN(DummySyntheticGestureControllerDelegate);
+};
+
class SyntheticGestureControllerTestBase {
public:
SyntheticGestureControllerTestBase() {}
@@ -670,8 +685,7 @@ class SyntheticGestureControllerTestBase {
void CreateControllerAndTarget() {
target_ = new MockGestureTarget();
controller_ = base::MakeUnique<SyntheticGestureController>(
- std::unique_ptr<SyntheticGestureTarget>(target_),
- base::Bind([](base::OnceClosure callback) {}));
+ &delegate_, std::unique_ptr<SyntheticGestureTarget>(target_));
}
void QueueSyntheticGesture(std::unique_ptr<SyntheticGesture> gesture) {
@@ -699,6 +713,7 @@ class SyntheticGestureControllerTestBase {
base::TimeDelta GetTotalTime() const { return time_ - start_time_; }
MockSyntheticGestureTarget* target_;
+ DummySyntheticGestureControllerDelegate delegate_;
std::unique_ptr<SyntheticGestureController> controller_;
base::TimeTicks start_time_;
base::TimeTicks time_;

Powered by Google App Engine
This is Rietveld 408576698