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

Unified Diff: chrome/test/data/pdf/gesture_detector_test.js

Issue 2855953003: Handle long press in PDF documents. (Closed)
Patch Set: Rebase to master Created 3 years, 8 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
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/pdf/gesture_detector_test.js
diff --git a/chrome/test/data/pdf/gesture_detector_test.js b/chrome/test/data/pdf/gesture_detector_test.js
index c038e28f09fab2afe977a4995df1c1a213028554..6d34e1d69f3c2c61871eff03fcfe1c674e157f70 100644
--- a/chrome/test/data/pdf/gesture_detector_test.js
+++ b/chrome/test/data/pdf/gesture_detector_test.js
@@ -213,5 +213,28 @@ chrome.test.runTests(function() {
chrome.test.succeed();
}
+
+ function testWasTwoFingerTouch() {
+ let stubElement = new StubElement();
+ let gestureDetector = new GestureDetector(stubElement);
+
+ let touchStartEvent = new MockTouchEvent('touchstart', [
+ {clientX: 0, clientY: 0, touches: []}
Kevin McNee 2017/05/03 17:25:43 The array passed to MockTouchEvent's constructor i
dsinclair 2017/05/03 18:13:38 Awesome, thanks. I'd guessed and was going to star
+ ]);
+ stubElement.sendEvent(touchStartEvent);
+ chrome.test.assertFalse(gestureDetector.wasTwoFingerTouch());
+
+ touchStartEvent = new MockTouchEvent('touchstart', [
+ {clientX: 0, clientY: 0, touches: [1, 2]}
+ ]);
+ stubElement.sendEvent(touchStartEvent);
+ chrome.test.assertTrue(gestureDetector.wasTwoFingerTouch());
+
+ touchStartEvent = new MockTouchEvent('touchstart', [
+ {clientX: 0, clientY: 0, touches: [1, 2, 3]}
+ ]);
+ stubElement.sendEvent(touchStartEvent);
+ chrome.test.assertTrue(gestureDetector.wasTwoFingerTouch());
+ }
Kevin McNee 2017/05/03 17:25:43 If you're relying on the value of |wasTwoFingerTou
dsinclair 2017/05/03 18:13:38 Ah, good idea.
];
}());
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698