-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1741225 [wpt PR 31632] - Add a WPT for pointerevent user activati…
…on trigger., a=testonly Automatic update from web-platform-tests Add a WPT for pointerevent user activation trigger. Related to HTML issue: whatwg/html#3849 Bug: 826293 Change-Id: I9e4bc0df46df63e05dac64af32c1aab7cdabffe4 -- wpt-commits: 266273172093e63a85e72b184735342d5c298797 wpt-pr: 31632
- Loading branch information
1 parent
3415649
commit bf4dcdc
Showing
5 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-enter.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-escape.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
testing/web-platform/tests/html/user-activation/activation-trigger-mouse-left.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
testing/web-platform/tests/html/user-activation/activation-trigger-pointerevent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/interaction.html#activation-triggering-input-event"> | ||
<meta name="variant" content="?mouse"> | ||
<meta name="variant" content="?pen"> | ||
<meta name="variant" content="?touch"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="resources/utils.js"></script> | ||
</head> | ||
<body> | ||
<h1>Test for pointerevent click activation trigger</h1> | ||
<p>Tests user activation from a pointer click.</p> | ||
<ol id="instructions"> | ||
<li>Click anywhere in the document. | ||
</ol> | ||
<script> | ||
let pointer_type = location.search.substring(1); | ||
|
||
promise_test(async () => { | ||
const test_pointer = pointer_type + "TestPointer"; | ||
|
||
new test_driver.Actions().addPointer(test_pointer, pointer_type) | ||
.pointerMove(0, 0, {origin:document.body, sourceName:test_pointer}) | ||
.pointerDown({sourceName:test_pointer}) | ||
.pointerUp({sourceName:test_pointer}) | ||
.send(); | ||
|
||
let pointerdown_event = getEvent('pointerdown'); | ||
let pointerup_event = getEvent('pointerup'); | ||
let click_event = getEvent('click'); | ||
|
||
await pointerdown_event; | ||
let consumed_pointerdown = await consumeTransientActivation(); | ||
await pointerup_event; | ||
let consumed_pointerup = await consumeTransientActivation(); | ||
await click_event; | ||
let consumed_click = await consumeTransientActivation(); | ||
|
||
if (pointer_type === "mouse") { | ||
assert_true(consumed_pointerdown, | ||
pointer_type + " pointerdown event should result in activation"); | ||
assert_false(consumed_pointerup, | ||
pointer_type + " pointerup should have no activation after pointerdown consumption"); | ||
assert_false(consumed_click, | ||
pointer_type + " click should have no activation after pointerdown consumption"); | ||
} else { | ||
assert_false(consumed_pointerdown, | ||
pointer_type + " pointerdown event should not result in activation"); | ||
assert_true(consumed_pointerup, | ||
pointer_type + " pointerup event should result in activation"); | ||
assert_false(consumed_click, | ||
pointer_type + " click should have no activation after pointerup consumption"); | ||
} | ||
}, "Activation through " + pointer_type + " pointerevent click"); | ||
</script> | ||
</body> | ||
</html> |