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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_pointerup_pointertype-manual.html

Issue 2020083002: Import wpt@1b61dad2be6c5100beb565e91c58b8c1084b3c7d (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests Created 4 years, 6 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: third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_pointerup_pointertype-manual.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_pointerup_pointertype-manual.html b/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_pointerup_pointertype-manual.html
new file mode 100644
index 0000000000000000000000000000000000000000..b356484bacc438853a92e7b2b68ff3fd92dc52be
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_pointerup_pointertype-manual.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html>
+ <head>
+ <title>pointerType conservation</title>
+ <meta name="viewport" content="width=device-width">
+ <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="pointerevent_support.js"></script>
+ </head>
+ <body onload="run()">
+ <h1>pointerType conservation</h1>
+ <h4>Test Description: This test checks if pointerType attribute defined properly.</h4>
+ <div id="instructions">
+ Press and release a mouse button, touch contact or pen contact on the black rectangle. Only use one device per test run.
+ </div>
+ <p>Note: This test may be run with different pointer devices, however only one device should be used per test run.
+ <p>
+ <div id="target0"></div>
+ <script>
+ var eventTested = false;
+ var pointerTypeGot = false;
+ var pointerdown_event;
+ var detected_pointertypes = {};
+
+ setup({ explicit_done: true });
+
+ add_completion_callback(showPointerTypes);
+
+ function run() {
+ var target0 = document.getElementById("target0");
+
+ on_event(target0, "pointerover", function(event) {
+ detected_pointertypes[ event.pointerType ] = true;
+ });
+
+ // The pointerType attribute of a pointerup event must have the same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute.
+ // TA: 3.1
+ on_event(target0, "pointerdown", function (event) {
+ pointerdown_event = event;
+ pointerTypeGot = true;
+ });
+
+ on_event(target0, "pointerup", function (event) {
+ if(pointerTypeGot == true) {
+ if(!eventTested) {
+ test(function() {
+ assert_equals(event.pointerId, pointerdown_event.pointerId, "pointer IDs are equal: ");
+ assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType of pointerup event matches pointerdown event: ");
+ }, "pointerType is dispatched properly");
+ }
+ done();
+ }
+ });
+ }
+ </script>
+ <h1>Pointer Events pointerType conservation tests</h1>
+ <div id="complete-notice">
+ <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+ <p>Refresh the page to run the tests again with a different pointer type.</p>
+ </div>
+ <div id="log"></div>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698