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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_pointerleave_pen-manual.html

Issue 2831933002: Make sure PointerEvents's isPrimary set correctly for stylus (Closed)
Patch Set: isprimary Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Pointer Event: Dispatch pointerleave (pen). </title> 4 <title>Pointer Event: Dispatch pointerleave (pen). </title>
5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> 5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/> 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
7 <meta name="assert" content="When a pointing device that supports hover (pen stylus) leaves the range of the digitizer while over an element, the pointe rleave event must be dispatched."/> 7 <meta name="assert" content="When a pointing device that supports hover (pen stylus) leaves the range of the digitizer while over an element, the pointe rleave event must be dispatched."/>
8 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> 8 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
9 <!-- /resources/testharness.js --> 9 <!-- /resources/testharness.js -->
10 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharness.js"></script>
11 <script src="/resources/testharnessreport.js"></script> 11 <script src="/resources/testharnessreport.js"></script>
12 <!-- Additional helper script for common checks across event types --> 12 <!-- Additional helper script for common checks across event types -->
13 <script type="text/javascript" src="pointerevent_support.js"></script> 13 <script type="text/javascript" src="pointerevent_support.js"></script>
14 <script type="text/javascript"> 14 <script type="text/javascript">
15 var detected_pointertypes = {}; 15 var detected_pointertypes = {};
16 var test_pointerEvent = async_test("pointerleave event"); // set up test harness 16 var test_pointerEvent = async_test("pointerleave event"); // set up test harness
17 // showPointerTypes is defined in pointerevent_support.js 17 // showPointerTypes is defined in pointerevent_support.js
18 // Requirements: the callback function will reference the test_point erEvent object and 18 // Requirements: the callback function will reference the test_point erEvent object and
19 // will fail unless the async_test is created with the var name "tes t_pointerEvent". 19 // will fail unless the async_test is created with the var name "tes t_pointerEvent".
20 add_completion_callback(showPointerTypes); 20 add_completion_callback(showPointerTypes);
21 21
22 function run() { 22 function run() {
23 var target0 = document.getElementById("target0"); 23 var target0 = document.getElementById("target0");
24 var count = 0;
24 25
25 on_event(target0, "pointerleave", function (event) { 26 on_event(target0, "pointerleave", function (event) {
26 detected_pointertypes[event.pointerType] = true; 27 detected_pointertypes[event.pointerType] = true;
27 check_PointerEvent(event); 28 check_PointerEvent(event);
29 count++;
28 test_pointerEvent.step(function () { 30 test_pointerEvent.step(function () {
29 assert_equals(event.pointerType, "pen", "Test should be run using a pen as input"); 31 assert_equals(event.pointerType, "pen", "Test should be run using a pen as input");
30 assert_equals(event.type, "pointerleave", "The " + event .type + " event was received"); 32 assert_equals(event.type, "pointerleave", "The " + event .type + " event was received");
33 assert_equals(event.isPrimary, true, "The " + event.type + ".isPrimary is true");
dtapuska 2017/04/20 21:04:14 You'll need to fix the automation scripts.
31 assert_true((event.clientX > target0.getBoundingClientRe ct().left)&& 34 assert_true((event.clientX > target0.getBoundingClientRe ct().left)&&
32 (event.clientX < target0.getBoundingClientRect().rig ht)&& 35 (event.clientX < target0.getBoundingClientRect().rig ht)&&
33 (event.clientY > target0.getBoundingClientRect().top )&& 36 (event.clientY > target0.getBoundingClientRect().top )&&
34 (event.clientY < target0.getBoundingClientRect().bot tom), 37 (event.clientY < target0.getBoundingClientRect().bot tom),
35 "pointerleave should be received inside of target bo unds"); 38 "pointerleave should be received inside of target bo unds");
36 }); 39 });
37 test_pointerEvent.done(); // complete test 40 if (count >= 2)
41 test_pointerEvent.done(); // complete test
38 }); 42 });
39 } 43 }
40 </script> 44 </script>
41 </head> 45 </head>
42 <body onload="run()"> 46 <body onload="run()">
43 <h1>Pointer Event: Dispatch pointerleave (pen)</h1> 47 <h1>Pointer Event: Dispatch pointerleave (pen)</h1>
44 <h4> 48 <h4>
45 Test Description: 49 Test Description:
46 When a pointing device that supports hover (pen stylus) leaves the r ange of the digitizer while over an element, the pointerleave event must be disp atched. 50 When a pointing device that supports hover (pen stylus) leaves the r ange of the digitizer while over an element, the pointerleave event must be disp atched.
Navid Zolghadr 2017/04/20 21:34:20 Can you also update the test description?
47 </h4> 51 </h4>
48 <br /> 52 <br />
49 <div id="target0"> 53 <div id="target0">
50 Use a pen to hover over then lift up away from this element. 54 Use a pen to hover over then lift up away from this element.
51 </div> 55 </div>
52 <div id="complete-notice"> 56 <div id="complete-notice">
53 <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p> 57 <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
54 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> 58 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p>
55 </div> 59 </div>
56 <div id="log"></div> 60 <div id="log"></div>
57 </body> 61 </body>
58 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698