Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>pointerType conservation</title> | 4 <title>pointerType conservation</title> |
| 5 <meta name="viewport" content="width=device-width"> | 5 <meta name="viewport" content="width=device-width"> |
| 6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> | 6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> |
| 7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src="pointerevent_support.js"></script> | 9 <script src="pointerevent_support.js"></script> |
| 10 </head> | 10 </head> |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 function run() { | 30 function run() { |
| 31 var target0 = document.getElementById("target0"); | 31 var target0 = document.getElementById("target0"); |
| 32 | 32 |
| 33 on_event(target0, "pointerover", function(event) { | 33 on_event(target0, "pointerover", function(event) { |
| 34 detected_pointertypes[ event.pointerType ] = true; | 34 detected_pointertypes[ event.pointerType ] = true; |
| 35 }); | 35 }); |
| 36 | 36 |
| 37 // The pointerType attribute of a pointermove event must have th e same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute. | 37 // The pointerType attribute of a pointermove event must have th e same value as the pointerType attribute of the last pointerdown event with the same pointerId attribute. |
| 38 // TA: 5.1 | 38 // TA: 5.1 |
| 39 on_event(target0, "pointerdown", function (event) { | 39 on_event(target0, "pointerdown", function (event) { |
| 40 console.log('pointerdown ' + event.pointerId); | |
|
Navid Zolghadr
2016/09/21 10:38:48
I don't think you need these logs anymore. Right?
| |
| 40 pointerdown_event = event; | 41 pointerdown_event = event; |
| 41 pointerTypeGot = true; | 42 pointerTypeGot = true; |
| 42 }); | 43 }); |
| 43 | 44 |
| 44 on_event(target0, "pointermove", function (event) { | 45 on_event(target0, "pointermove", function (event) { |
| 46 console.log('pointermove ' + event.pointerId); | |
| 45 if(pointerTypeGot == true) { | 47 if(pointerTypeGot == true) { |
| 46 if(!eventTested) { | 48 if(!eventTested) { |
| 47 test(function() { | 49 test(function() { |
| 50 console.log('pointermove ' + event.pointerId + ' ' + pointerdown_event.pointerId); | |
| 48 assert_equals(event.pointerId, pointerdown_event .pointerId, "pointer IDs are equal: "); | 51 assert_equals(event.pointerId, pointerdown_event .pointerId, "pointer IDs are equal: "); |
| 49 assert_equals(event.pointerType, pointerdown_eve nt.pointerType, "pointerType of pointermove event matches pointerdown event: "); | 52 assert_equals(event.pointerType, pointerdown_eve nt.pointerType, "pointerType of pointermove event matches pointerdown event: "); |
| 50 }, "pointerType is dispatched properly"); | 53 }, "pointerType is dispatched properly"); |
| 51 } | 54 } |
| 52 done(); | 55 done(); |
| 53 } | 56 } |
| 54 }); | 57 }); |
| 55 } | 58 } |
| 56 </script> | 59 </script> |
| 57 <h1>Pointer Events pointerType conservation tests</h1> | 60 <h1>Pointer Events pointerType conservation tests</h1> |
| 58 <div id="complete-notice"> | 61 <div id="complete-notice"> |
| 59 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> | 62 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> |
| 60 <p>Refresh the page to run the tests again with a different pointer type.</p> | 63 <p>Refresh the page to run the tests again with a different pointer type.</p> |
| 61 </div> | 64 </div> |
| 62 <div id="log"></div> | 65 <div id="log"></div> |
| 63 </body> | 66 </body> |
| 64 </html> | 67 </html> |
| OLD | NEW |