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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-on-object.html

Issue 2517603002: Fired PointerEvent from Node::dispatchMouseEvent() to fix a bug. (Closed)
Patch Set: Created 4 years, 1 month 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 | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-on-object.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-on-object.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-on-object.html
new file mode 100644
index 0000000000000000000000000000000000000000..bfc893aae3e6551e170f30d6695482a583d30785
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-on-object.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<style>
+#obj {
+ width: 50px;
+ height: 50px;
+ padding: 50px;
+}
+</style>
+
+<h1>Verifies that mouse activites on an object fire pointerevents</h1>
+
+<object id="obj"></object>
+
+<div id="log"></div>
+
+<script>
+var receivedEvents = [];
+
+function testReceivedEvents(expectedEvents, testLabel) {
+ test(function() {
+ assert_array_equals(receivedEvents, expectedEvents);
+ }, testLabel);
+ receivedEvents = [];
+}
+
+function init() {
+ ["mousedown", "mouseup", "mousemove", "pointerdown", "pointerup", "pointermove"].forEach(function(eventName) {
+ document.getElementById("obj").addEventListener(eventName, function(event) {
+ receivedEvents.push(event.type);
+ });
+ });
+}
+
+function runTests() {
+ var rect = document.getElementById("obj").getBoundingClientRect();
+
+ eventSender.mouseMoveTo(rect.left + 5, rect.top + 5);
+ eventSender.mouseDown(0);
+ eventSender.mouseUp(0);
+ testReceivedEvents(["pointermove", "mousemove", "pointerdown", "mousedown", "pointerup", "mouseup"], "Click on object");
+
+ eventSender.mouseDown(0);
+ eventSender.mouseMoveTo(rect.left - 5, rect.top -5);
+ eventSender.mouseUp(0);
+ testReceivedEvents(["pointerdown", "mousedown", "pointermove", "mousemove", "pointerup", "mouseup"], "Drag from object");
+}
+
+test(function() {
+ if (!window.eventSender)
+ assert_true(true, "No eventSender, skipped tests");
+ else {
+ init();
+ runTests();
+ }
+
+ done();
+}, "Verifies that mouse activites on an object fire pointerevents");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698