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

Unified Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html

Issue 466143005: Fix crash on GestureTap in Node::commonAncestor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment typo Created 6 years, 4 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: LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html
new file mode 100644
index 0000000000000000000000000000000000000000..f8826183de6078ebeb6b91ed496549ebf7eb1d8b
--- /dev/null
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML>
+<script src="../../../../resources/js-test.js"></script>
+<style>
+#target {
+ width: 50px;
+ height: 50px;
+}
+</style>
+<iframe id="target" src="resources/event-delegator.html"></iframe>
+<div id=console></div>
+<script>
+var scrollbarEventType;
+
+function onEventInFrame(e) {
+ debug("Received " + e.type + " in child frame");
+ if (e.type == scrollbarEventType) {
+ debug('Adding scrollbars to iframe');
+ target.contentDocument.body.style.height = "500px";
+ }
+}
+
+function eventLogger(e) {
+ debug("Received " + e.type + " in main frame");
+}
+
+document.addEventListener('mousemove', eventLogger);
+document.addEventListener('mousedown', eventLogger);
+document.addEventListener('mouseup', eventLogger);
+document.addEventListener('click', eventLogger);
+
+description("Taps at a point that becomes a scrollbar (i.e. hit test with innerNode=null) during the tap and verifies we don't crash.");
+
+// Tap at the right edge of the frame, where its scrollbar would live.
+var rect = target.getBoundingClientRect();
+var point = {
+ x: rect.right - 4,
+ y: rect.top + rect.height / 2
+};
+
+function doTap(type)
+{
+ return new Promise(function(resolve, reject) {
+ if (type) {
+ debug('Test case: Add scrollbars during ' + type);
+ scrollbarEventType = type;
+ target.contentDocument.body.style.height = "0";
+ } else {
+ debug('Test case: Tap on consistent scrollbar');
+ }
+
+ eventSender.gestureTapDown(point.x, point.y);
+ eventSender.gestureShowPress(point.x, point.y);
+ debug("Sending GestureTap");
+ eventSender.gestureTap(point.x, point.y);
+
+ setTimeout(function() {
+ debug('');
+ resolve();
+ }, 0);
+ });
+}
+
+if (window.eventSender) {
+ jsTestIsAsync = true;
+ target.onload = function() {
+ doTap()
+ .then(function() { return doTap('mousemove'); })
+ .then(function() { return doTap('mousedown'); })
+ .then(function() { return doTap('mouseup'); })
+ .catch(function(err) {
+ testFailed("Promise rejected: " + err.message);
+ }).then(finishJSTest);
+ }
+} else {
+ debug("This test requires eventSender");
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698