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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html

Issue 2772443006: Set trusted flag of coalesced events at creation (Closed)
Patch Set: Created 3 years, 9 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/external/wpt/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html
new file mode 100644
index 0000000000000000000000000000000000000000..1a51613dcf1afe114c54430e60610f6581da4f2c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/extension/pointerevent_coalesced_events_attributes-manual.html
@@ -0,0 +1,128 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Pointer Events coalesced events count and properties<</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>
+ <!-- Additional helper script for common checks across event types -->
+ <script type="text/javascript" src="../pointerevent_support.js"></script>
+ <script>
+ var eventList = All_Pointer_Events;
+ PhaseEnum = {
+ WaitingForOver: 0,
+ WaitingForEnter: 1,
+ WaitingForDown: 2,
+ WaitingForMove: 3,
+ WaitingForUp: 4,
+ WaitingForOut: 5,
+ WaitingForLeave: 6,
+ Done: 7,
+ };
+ var phase = PhaseEnum.WaitingForOver;
+
+ function resetTestState() {
+ phase = PhaseEnum.WaitingForOver;
+ }
+ function expect_no_coalesced_events(event, eventName) {
+ test(function () {
+ assert_equals(event.getCoalescedEvents().length, 0, eventName + ' should not have any coalesced events');
+ }, expectedPointerType + ' ' + eventName + ' should not have any coalesced events');
+ }
+ function run() {
+ var test_pointerEvent = setup_pointerevent_test("pointerevent boundary events in capturing", ['mouse']);
+ var target = document.getElementById("target0");
+
+ eventList.forEach(function(eventName) {
+ on_event(target, eventName, function (event) {
+ switch (phase) {
+ case PhaseEnum.WaitingForOver:
+ if (eventName == 'pointerover') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ }
+ break;
+ case PhaseEnum.WaitingForEnter:
+ if (eventName == 'pointerenter') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ }
+ break;
+ case PhaseEnum.WaitingForDown:
+ if (eventName == 'pointerdown') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ setTimeout(function(){
dtapuska 2017/03/24 21:14:02 why don't we check the date and make this more pre
Navid Zolghadr 2017/03/27 15:16:16 Done.
+ // This is just a way to block the main thread.
+ for (var i=0; i<1000000000; i++);
+ }, 0);
+ }
+ break;
+ case PhaseEnum.WaitingForMove:
+ if (eventName == 'pointermove') {
+ var coalescedEvents = event.getCoalescedEvents();
+ test (function() {
+ assert_greater_than(event.getCoalescedEvents().length, 1, 'pointermove should have at least 2 coalesced events.');
+ }, expectedPointerType + ' pointermove should have >2 coalesced events as main thread is busy.');
+ test (function() {
+ for (var i=0; i<coalescedEvents.length; i++) {
+ assert_equals(coalescedEvents[i].isTrusted, true, 'isTrusted flag should be true for coalesced events.');
+ }
+ }, expectedPointerType + ' pointermove coalesced events should all be marked as trusted.');
+ test (function() {
+ for (var i=0; i<coalescedEvents.length; i++) {
+ assert_equals(coalescedEvents[i].bubbles, false, 'Bubbles attribute should be false for coalesced events.');
+ assert_equals(coalescedEvents[i].cancelable, false, 'Cancelable attribute should be false for coalesced events.');
+ }
+ }, expectedPointerType + ' pointermove coalesced events should all bubbles and cancelable as false.');
+ phase++;
+ }
+ break;
+ case PhaseEnum.WaitingForUp:
+ if (eventName == 'pointerup') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ }
+ break;
+ case PhaseEnum.WaitingForOut:
+ if (eventName == 'pointerout') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ }
+ break;
+ case PhaseEnum.WaitingForLeave:
+ if (eventName == 'pointerleave') {
+ expect_no_coalesced_events(event, eventName);
+ phase++;
+ test_pointerEvent.done();
+ }
+ break;
+ }
+ });
+ });
+ }
+ </script>
+ </head>
+ <body onload="run()">
+ <h1>Pointer Events coalesced events count and properties</h1>
+ <h2 id="pointerTypeDescription"></h2>
+ <h4>
+ Test Description: This test checks the boundary events of pointer events while the capturing changes. If you are using hoverable pen don't leave the range of digitizer while doing the instructions.
+ <ol>
+ <li>Move your pointer over the black square</li>
+ <li>Press down the pointer and drag inside the black square immediately</li>
+ <li>Release the pointer and move out of the black square</li>
+ </ol>
+
+ Test passes if the proper behavior of the events is observed.
+ </h4>
+ <div id="target0" class="touchActionNone">
+ </div>
+ <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>
+ </body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698