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

Unified Diff: LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash.html

Issue 488923003: Gracefully handle drag cancellation during drag start. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Expand comment somewhat 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash.html
diff --git a/LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash.html b/LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..b916a833ee4490bebff5f0a0b0debe0fbef1a200
--- /dev/null
+++ b/LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p id="description">
+This tests pressing a mouse button down inside a dragstart event.<br>
+This happens when a user sets a breakpoint of a dragstart event handler in Inspector,
+and clicks somewhere on the page while the script is paused at the breakpoint. WebKit should not crash.
+</p>
+<div id="container"><span id="target" draggable="true" ondragstart="onDragStart()">drag me</span></div>
+<script>
+
+if (!window.testRunner || !window.eventSender)
+ document.body.innerHTML = 'This test requires eventSender';
+else {
+ testRunner.dumpAsText();
+
+ var target = document.getElementById('target');
+ var called = false;
+
+ function onDragStart() {
+ called = true;
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ }
+
+ eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2);
+ eventSender.mouseDown();
+ eventSender.leapForward(100);
+ eventSender.mouseMoveTo(500, 500);
+ eventSender.mouseUp();
+
+ document.getElementById('container').textContent = called ? 'PASS - mouse up and down inside a dragstart did not crash WebKit'
+ : 'FAIL - dragstart was never fired.';
+}
+
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/mousedown-inside-dragstart-should-not-cause-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698