Update web-platform-tests to revision 8119bc10583682676a3db9806c82ed4044e88e13

This commit is contained in:
WPT Sync Bot 2019-07-09 10:22:34 +00:00
parent 56f1e7cbc5
commit 3c256580fa
189 changed files with 4341 additions and 1030 deletions

View file

@ -17,7 +17,7 @@
PerformanceObserver is registered
Click 1
Click 2
PerformanceObserver should observe only one firstInput entry.
PerformanceObserver should observe only one first-input entry.
(Dispatch and Process Click 2 - not buffered)
*/
async_test(function(t) {
@ -43,7 +43,7 @@
new PerformanceObserver(function(entryList) {
assert_equals(entryList.getEntries().length, 1);
resolve();
}).observe({ type: 'firstInput' , buffered: true});
}).observe({ type: 'first-input' , buffered: true});
});
on_event(window, 'load', function(e) {
@ -57,7 +57,7 @@
});
});
},
"Event Timing: check firstInput after onload, observer, click, click."
"Event Timing: check first-input after onload, observer, click, click."
);
</script>
</html>

View file

@ -12,7 +12,7 @@
<script>
/* Test:
PerformanceObserver for firstInput is registered
PerformanceObserver for first-input is registered
Click 1
Click 2
Wait
@ -27,14 +27,14 @@
const observedEntries = entryList.getEntries().filter(
entry => entry.name === 'mousedown');
assert_equals(observedEntries.length, 1);
assert_equals(observedEntries[0].entryType, 'firstInput');
assert_equals(observedEntries[0].entryType, 'first-input');
assert_equals(observedEntries[0].name, 'mousedown');
})).observe({ entryTypes: ['firstInput'] });
})).observe({ entryTypes: ['first-input'] });
on_event(window, 'load', () => {
clickAndBlockMain('button').then(() => {
clickAndBlockMain('button').then(wait).then( () => {
// After some wait, the PerformanceObserver should have processed both clicks.
// One and only one firstInput entry should have been dispatched, so
// One and only one first-input entry should have been dispatched, so
// |hasObservedFirstInput| should be true.
t.step_timeout( () => {
assert_true(hasObservedFirstInput);
@ -44,7 +44,7 @@
});
});
},
"Event Timing: check firstInput for a PerformanceObserver observing only firstInput."
"Event Timing: check first-input for a PerformanceObserver observing only first-input."
);
</script>
</html>

View file

@ -27,7 +27,7 @@
// 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');
const firstInput = performance.getEntriesByType('first-input');
assert_equals(firstInput.length, 1);
assert_greater_than_equal(firstInput[0].processingStart, beforeClick);
}));

View file

@ -24,7 +24,7 @@ function mainThreadBusy(duration) {
// This method should receive an entry of type 'event'. |is_first| is true only
// when the event also happens to correspond to the first event. In this case,
// the timings of the 'firstInput' entry should be equal to those of this entry.
// the timings of the 'first-input' entry should be equal to those of this entry.
function verifyClickEvent(entry, is_first=false) {
assert_true(entry.cancelable);
assert_equals(entry.name, 'mousedown');
@ -40,11 +40,11 @@ function verifyClickEvent(entry, is_first=false) {
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');
assert_equals(firstInputs.length, 1, 'There should be a single firstInput entry');
let firstInputs = performance.getEntriesByType('first-input');
assert_equals(firstInputs.length, 1, 'There should be a single first-input entry');
let firstInput = firstInputs[0];
assert_equals(firstInput.name, entry.name);
assert_equals(firstInput.entryType, 'firstInput');
assert_equals(firstInput.entryType, 'first-input');
assert_equals(firstInput.startTime, entry.startTime);
assert_equals(firstInput.duration, entry.duration);
assert_equals(firstInput.processingStart, entry.processingStart);

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<title>Event Timing: make sure event-timing entries are retrievable by existing perf APIs.</title>
<title>Event Timing: make sure 'event' entries are not retrievable by performance.getEntries* APIs.</title>
<meta name="timeout" content="long">
<button id='button'>Generate a 'click' event</button>
<script src=/resources/testharness.js></script>
@ -10,17 +10,15 @@
<script src=/resources/testdriver-vendor.js></script>
<script src=resources/event-timing-test-utils.js></script>
<img src=resources/slow-image.py>
<script>
function validateEntries() {
const entriesByName = performance.getEntriesByName('mousedown', 'event');
const entriesByType = performance.getEntriesByType('event');
const allEntries = performance.getEntries();
assert_equals(entriesByName.length, 1, 'event-timing entry should be retrievable by getEntriesByName');
const e = entriesByName[0];
assert_true(entriesByType.includes(e), 'event-timing entry should be retrievable by getEntries');
assert_true(allEntries.includes(e), 'event-timing entry should be retrievable by getEntriesByType');
assert_equals(entriesByName.length, 0, 'Event Timing entry should not be retrievable by getEntriesByName');
assert_equals(entriesByType.length, 0, 'Event Timing entry should not be retrievable by getEntriesByType');
assert_equals(allEntries.filter(e => e.entryType === 'event').length, 0, 'Event Timing entry should not be retrievable by getEntries');
}
/* Timeline:
@ -32,12 +30,15 @@
Validate entries
*/
async_test(function(t) {
clickAndBlockMain('button');
on_event(window, 'load', e => {
if (!window.PerformanceEventTiming) {
assert_unreached('PerformanceEventTiming is not implemented');
}
new PerformanceObserver(t.step_func_done(() => {
validateEntries();
t.done();
});
}, "Event Timing: make sure event-timing entries are retrievable by existing perf APIs.");
})).observe({entryTypes: ['event']});
clickAndBlockMain('button');
}, "Event Timing: make sure event-timing entries are not retrievable by performance.getEntries*.");
</script>
</html>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<meta charset=utf-8 />
<title>Event Timing: firstInput entry should be buffered even without observer</title>
<title>Event Timing: first-input entry should be buffered even without observer</title>
<button id='button'>Generate a 'click' event</button>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
@ -14,22 +14,22 @@
async_test(function(t) {
function testEntries() {
// First callback is not ensured to have the entry.
if (performance.getEntriesByType('firstInput').length === 0) {
if (performance.getEntriesByType('first-input').length === 0) {
t.step_timeout(testEntries, 10);
return;
}
assert_equals(performance.getEntriesByType('firstInput').length, 1,
"There should be a firstInput entry in the performance timeline");
const entry = performance.getEntriesByType('firstInput')[0];
assert_equals(performance.getEntriesByType('first-input').length, 1,
"There should be a first-input entry in the performance timeline");
const entry = performance.getEntriesByType('first-input')[0];
assert_equals(entry.name, 'mousedown');
assert_equals(entry.entryType, 'firstInput');
assert_equals(entry.entryType, 'first-input');
assert_greater_than_equal(entry.duration, 104,
"The first input was a long one.");
t.done();
}
clickAndBlockMain('button').then(wait).then(t.step_func(testEntries));
},
"Event Timing: check firstInput after onload, observer, click, click."
"Event Timing: check first-input after onload, observer, click, click."
);
</script>
</html>

View file

@ -2,10 +2,10 @@ test(() => {
if (typeof PerformanceObserver.supportedEntryTypes === "undefined")
assert_unreached("supportedEntryTypes is not supported.");
const types = PerformanceObserver.supportedEntryTypes;
assert_true(types.includes("firstInput"),
"There should be 'firstInput' in PerformanceObserver.supportedEntryTypes");
assert_true(types.includes("first-input"),
"There should be 'first-input' in PerformanceObserver.supportedEntryTypes");
assert_true(types.includes("event"),
"There should be 'event' in PerformanceObserver.supportedEntryTypes");
assert_greater_than(types.indexOf("firstInput"), types.indexOf('event'),
"The 'firstInput' entry should appear after the 'event' entry");
}, "supportedEntryTypes contains 'event' and 'firstInput'.");
assert_greater_than(types.indexOf("first-input"), types.indexOf('event'),
"The 'first-input' entry should appear after the 'event' entry");
}, "supportedEntryTypes contains 'event' and 'first-input'.");