-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: 1265649 Change-Id: I41a22138b53f2b8fd06873fba098de9659526b1f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3624549 Commit-Queue: Ian Clelland <iclelland@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Cr-Commit-Position: refs/heads/main@{#1002337}
- Loading branch information
haoliuk
authored and
Chromium LUCI CQ
committed
May 11, 2022
1 parent
be821a7
commit 557e4fb
Showing
4 changed files
with
135 additions
and
32 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
third_party/blink/web_tests/external/wpt/event-timing/interactionid-press-key-as-input.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,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta charset=utf-8 /> | ||
<meta name="timeout" content="long"> | ||
<title>Event Timing: interactionId-press-key-as-input.</title> | ||
<textarea id='test'></textarea> | ||
<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/event-timing-test-utils.js></script> | ||
|
||
<script> | ||
let observedEntries = []; | ||
let map = new Map(); | ||
const events = ['keydown', 'keyup']; | ||
|
||
async_test(function (t) { | ||
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); | ||
|
||
new PerformanceObserver(t.step_func(entryList => { | ||
observedEntries = observedEntries.concat(entryList.getEntries().filter(filterAndAddToMap(events, map))); | ||
|
||
if (observedEntries.length < 2) | ||
return; | ||
|
||
events.forEach(e => assert_greater_than(map.get(e), 0, 'Should have a non-trivial interactionId for ' + e + ' event')); | ||
assert_equals(map.get('keydown'), map.get('keyup'), 'The keydown and the keyup should have the same interactionId'); | ||
assert_equals('t', document.getElementById('test').value); | ||
t.done(); | ||
})).observe({ type: "event" }); | ||
|
||
addListenersAndPress(document.getElementById('test'), 't', events); | ||
}, "Event Timing: compare event timing interactionId for key press as input."); | ||
</script> | ||
|
||
</html> |
43 changes: 43 additions & 0 deletions
43
third_party/blink/web_tests/external/wpt/event-timing/interactionid-press-key-no-effect.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,43 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<meta charset=utf-8 /> | ||
<meta name="timeout" content="long"> | ||
<title>Event Timing: interactionId-press-key-no-effect.</title> | ||
<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/event-timing-test-utils.js></script> | ||
|
||
<body> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tempus | ||
lacinia nisi, eget tempor orci. Nullam congue pharetra arcu, et consectetur | ||
massa mollis tincidunt. Quisque odio sapien, viverra finibus lectus ac, | ||
consectetur ornare quam. In hac habitasse platea dictumst. Morbi cursus est | ||
odio, non fermentum ligula posuere vitae. Sed ullamcorper convallis rhoncus. | ||
In condimentum neque nec metus hendrerit, et cursus ipsum aliquet. | ||
</p> | ||
</body> | ||
<script> | ||
let observedEntries = []; | ||
let map = new Map(); | ||
const events = ['keydown', 'keyup']; | ||
|
||
async_test(function (t) { | ||
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); | ||
|
||
new PerformanceObserver(t.step_func(entryList => { | ||
observedEntries = observedEntries.concat(entryList.getEntries().filter(filterAndAddToMap(events, map))); | ||
|
||
if (observedEntries.length < 2) | ||
return; | ||
|
||
events.forEach(e => assert_greater_than(map.get(e), 0, 'Should have a non-trivial interactionId for ' + e + ' event')); | ||
assert_equals(map.get('keydown'), map.get('keyup'), 'The keydown and the keyup should have the same interactionId'); | ||
t.done(); | ||
})).observe({ type: "event" }); | ||
|
||
addListenersAndPress(document.body, 't', events); | ||
}, "Event Timing: compare event timing interactionId for key press with no effect."); | ||
</script> |
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