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

Unified Diff: LayoutTests/fast/events/mousemove.html

Issue 23463012: Make the mousemove event cancellable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/mousemove-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/mousemove.html
diff --git a/LayoutTests/fast/events/mousemove.html b/LayoutTests/fast/events/mousemove.html
new file mode 100644
index 0000000000000000000000000000000000000000..390b96387664400325d3b23c37eddeb2065e6822
--- /dev/null
+++ b/LayoutTests/fast/events/mousemove.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../js/resources/js-test-pre.js"></script>
+<body>
+ <div id="testelm">The test element<div>
+<script>
+ var testElm = document.getElementById("testelm");
+ testElm.addEventListener("mousemove", function(event) {
+ if (event.defaultPrevented) {
+ testFailed("Mouse event already cancelled.");
+ return;
+ }
+ event.preventDefault();
+ if (!event.defaultPrevented) {
+ testFailed("Mouse event not cancellable.");
+ return;
+ }
+ testPassed("Mouse move event cancellable.")
+ }, false);
+ if ("eventSender" in window) {
+ eventSender.mouseMoveTo(testElm.offsetLeft + testElm.offsetWidth / 3,
+ testElm.offsetTop + testElm.offsetHeight / 2);
+ eventSender.mouseMoveTo(testElm.offsetLeft + testElm.offsetWidth / 3 * 2,
+ testElm.offsetTop + testElm.offsetHeight / 2);
+ }
+ else {
+ testElm.innerHTML = "window.eventSender not available. To test move the mouse on top of this text.";
+ }
+</script>
+</body>
+<script src="../js/resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/mousemove-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698