mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3
This commit is contained in:
parent
6f8bb4dd40
commit
edff458e23
791 changed files with 17647 additions and 10322 deletions
|
@ -9,7 +9,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<img src=resources/slow-image.py>
|
||||
|
||||
<script>
|
|
@ -14,9 +14,9 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<img src=./resources/slow-image.py>
|
||||
<iframe src=resources/event-timing-crossiframe-childframe.html></iframe>
|
||||
<iframe src=resources/crossiframe-childframe.html></iframe>
|
||||
<script>
|
||||
let clickTimeMin;
|
||||
let processingStartMin;
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset=utf-8 />
|
||||
<title>Event Timing: entries should be observable by its own frame.
|
||||
</title>
|
||||
<script src=./resources/event-timing-support.js></script>
|
||||
<script src=./resources/event-timing-test-utils.js></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Description:</h2>
|
||||
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<h2>iframe:</h2>
|
||||
<div>
|
||||
<iframe name='childframe' width="100%" height="30%" src=./resources/event-timing-observer-manual-childframe.html></iframe>
|
||||
<iframe name='childframe' width="100%" height="30%" src=./resources/observer-manual-childframe.html></iframe>
|
||||
</div>
|
||||
<h2>Timeline:</h2>
|
||||
<p id='timeline'></p>
|
|
@ -10,7 +10,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<img src=resources/slow-image.py>
|
||||
|
||||
<script>
|
|
@ -9,7 +9,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
|
||||
<script>
|
||||
/* Timeline:
|
|
@ -11,7 +11,7 @@ registration are lost
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<script>
|
||||
let callbackTime;
|
||||
let observerStart;
|
|
@ -8,7 +8,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
|
||||
<script>
|
||||
/* Test:
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset=utf-8 />
|
||||
<div id='div' onclick='delay()'>Click me</div>
|
||||
<div id='div2'>No, click me!</div>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<script>
|
||||
let delayCalled = false;
|
||||
let beforeClick;
|
||||
function delay() {
|
||||
const end = performance.now() + 150;
|
||||
while(performance.now() < end) {}
|
||||
delayCalled = true;
|
||||
}
|
||||
async_test(function(t) {
|
||||
const observer = new PerformanceObserver(t.step_func_done((entryList) => {
|
||||
const entries = entryList.getEntries().filter(e => e.name === 'mousedown');
|
||||
// There must only be one click entry: from the clickAndBlockMain() call.
|
||||
assert_equals(entries.length, 1);
|
||||
const entry = entries[0];
|
||||
// This ensures that the entry is exposing timing from the second click, i.e.
|
||||
// the one from the clickAndBlockMain() call.
|
||||
assert_greater_than_equal(entry.processingStart, beforeClick);
|
||||
// Check that the first input entry was also from the second click.
|
||||
const firstInput = performance.getEntriesByType('firstInput');
|
||||
assert_equals(firstInput.length, 1);
|
||||
assert_greater_than_equal(firstInput[0].processingStart, beforeClick);
|
||||
}));
|
||||
observer.observe({entryTypes: ['event']});
|
||||
document.getElementById('div').click();
|
||||
// Take the timestamp after the programmatic click but before the next click.
|
||||
beforeClick = performance.now();
|
||||
// After the programmatic click, use another input to know when entries have been
|
||||
// dispatched to the PerformanceObserver callback.
|
||||
clickAndBlockMain('div2');
|
||||
}, "Event Timing: events from programmatic click are not observed");
|
||||
</script>
|
||||
</html>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCType html>
|
||||
<html>
|
||||
<script src=event-timing-support.js></script>
|
||||
<script src=event-timing-test-utils.js></script>
|
||||
<button id='button_child_frame'>Generate a 'click' event</button>
|
||||
<img src=slow-image.py>
|
||||
<script>
|
|
@ -8,7 +8,7 @@ function clickOnElement(id, callback) {
|
|||
const yCenter = rect.y + rect.height / 2;
|
||||
const leftButton = 0;
|
||||
const clickHandler = () => {
|
||||
mainThreadBusy(60);
|
||||
mainThreadBusy(120);
|
||||
if (callback)
|
||||
callback();
|
||||
element.removeEventListener("mousedown", clickHandler);
|
||||
|
@ -29,13 +29,15 @@ function verifyClickEvent(entry, is_first=false) {
|
|||
assert_true(entry.cancelable);
|
||||
assert_equals(entry.name, 'mousedown');
|
||||
assert_equals(entry.entryType, 'event');
|
||||
assert_greater_than(entry.duration, 50,
|
||||
"The entry's duration should be greater than 50ms.");
|
||||
assert_greater_than_equal(entry.duration, 104,
|
||||
"The entry's duration should be greater than or equal to 104 ms.");
|
||||
assert_greater_than(entry.processingStart, entry.startTime,
|
||||
"The entry's processingStart should be greater than startTime.");
|
||||
assert_greater_than_equal(entry.processingEnd, entry.processingStart,
|
||||
"The entry's processingEnd must be at least as large as processingStart.");
|
||||
assert_greater_than_equal(entry.duration, entry.processingEnd - entry.startTime,
|
||||
// |duration| is a number rounded to the nearest 8 ms, so add 4 to get a lower bound
|
||||
// on the actual duration.
|
||||
assert_greater_than_equal(entry.duration + 4, entry.processingEnd - entry.startTime,
|
||||
"The entry's duration must be at least as large as processingEnd - startTime.");
|
||||
if (is_first) {
|
||||
let firstInputs = performance.getEntriesByType('firstInput');
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset=utf-8 />
|
||||
</head>
|
||||
<script src=./event-timing-support.js></script>
|
||||
<script src=./event-timing-test-utils.js></script>
|
||||
<script>
|
||||
function log(message) {
|
||||
const timestamp = performance.now();
|
|
@ -9,7 +9,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<img src=resources/slow-image.py>
|
||||
|
||||
<script>
|
|
@ -8,7 +8,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
|
@ -23,7 +23,7 @@
|
|||
const entry = performance.getEntriesByType('firstInput')[0];
|
||||
assert_equals(entry.name, 'mousedown');
|
||||
assert_equals(entry.entryType, 'firstInput');
|
||||
assert_greater_than(entry.duration, 50,
|
||||
assert_greater_than_equal(entry.duration, 104,
|
||||
"The first input was a long one.");
|
||||
t.done();
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
<script src=/resources/testdriver.js></script>
|
||||
<script src=/resources/testdriver-vendor.js></script>
|
||||
|
||||
<script src=resources/event-timing-support.js></script>
|
||||
<script src=resources/event-timing-test-utils.js></script>
|
||||
<script>
|
||||
let trustedClickStart;
|
||||
function trustedClickAndBlockMain(id) {
|
Loading…
Add table
Add a link
Reference in a new issue