Bug 1630624 [wpt PR 23004] - Remove assert_precondition usages in *-timing/, a=testonly

Automatic update from web-platform-tests
Replace assert_precondition with assert_implements in paint-timing/

assert_precondition is deprecated (see
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/assert_precondition_rename.md).
Since PerformancePaintTiming is not an OPTIONAL part of the Paint Timing
spec, these tests should use assert_implements.

--
Replace assert_precondition with assert_implements in longtask-timing/

assert_precondition is deprecated (see
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/assert_precondition_rename.md).
Since PerformanceLongTaskTiming is not an OPTIONAL part of the Long
Tasks spec, these tests should use assert_implements.

--
Replace assert_precondition with assert_implements in event-timing/

assert_precondition is deprecated (see
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/assert_precondition_rename.md).
Since PerformanceElementTiming is not an OPTIONAL part of the Element
Timing spec and EventCount is not an OPTIONAL part of the Event Timing
spec, these tests should use assert_implements.

--
Replace assert_precondition with assert_implements in element-timing/

assert_precondition is deprecated (see
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/assert_precondition_rename.md).
Since PerformanceElementTiming is not an OPTIONAL part of the Element
Timing spec, these tests should use assert_implements.

--

wpt-commits: f3bf3bbd75dbab84e13406ddd86c6a7d00b39986, 4eee874b2c46f4ffff81112b8b3ff490e5092238, 67f7dd268503f106abdc8b38f617a4ba2f299f95, dcfc14df9aa42d2faa708598db34364ecd09b583
wpt-pr: 23004
This commit is contained in:
Stephen McGruer 2020-04-22 04:15:13 +00:00 коммит произвёл moz-wptsync-bot
Родитель ddc740a12f
Коммит 75b2b23ab8
90 изменённых файлов: 94 добавлений и 94 удалений

Просмотреть файл

@ -18,7 +18,7 @@ body {
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -23,7 +23,7 @@ body {
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let beforeRender = performance.now();
let numObservedElements = 0;
let observedDiv1 = false;

Просмотреть файл

@ -18,7 +18,7 @@ body {
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -13,7 +13,7 @@
is available from the observer with the buffered flag set to true.
*/
async_test(function(t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
beforeRender = performance.now();
const img = document.createElement('img');
img.src = 'resources/square20.jpg';

Просмотреть файл

@ -12,7 +12,7 @@ body {
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test(t => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const beforeRender = performance.now();
const img = document.createElement('img');
// Initial observer used to know when entry has been dispatched

Просмотреть файл

@ -12,7 +12,7 @@ body {
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let img;
const pathname = 'http://{{domains[www]}}:{{ports[http][1]}}'
+ '/element-timing/resources/square100.png';

Просмотреть файл

@ -7,7 +7,7 @@
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done((entryList) => {
assert_unreached("We should not observe a cross origin element.");

Просмотреть файл

@ -17,7 +17,7 @@ body {
<script>
async_test(function (t) {
const beforeRender = performance.now();
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -9,7 +9,7 @@
let beforeRender;
let img;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -8,7 +8,7 @@
<script>
let t = async_test('Only expose element attribute for fully active documents');
t.step(() => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
});
window.triggerTest = t.step_func_done(elementEntry => {
assert_not_equals(elementEntry.element, null);

Просмотреть файл

@ -16,7 +16,7 @@
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const div = document.getElementById('target');
let textObserved = false;
let imageObserved = false;

Просмотреть файл

@ -8,7 +8,7 @@
<p elementtiming='my_identifier' id='my_id'>Text</p>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -7,7 +7,7 @@
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test(t => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const beforeRender = performance.now();
const remote_img = 'http://{{domains[www]}}:{{ports[http][1]}}/element-timing/resources/TAOImage.py?'
+ 'origin=' + window.location.origin +'&tao=';

Просмотреть файл

@ -26,7 +26,7 @@ body {
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const beforeRenderTimes = [];
let entry_count = 0;
const entry_count_per_element = [0, 0];

Просмотреть файл

@ -7,7 +7,7 @@
<script>
let beforeRender;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -16,7 +16,7 @@ body {
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -5,7 +5,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(() => {
// The image should not have caused an entry, so fail test.

Просмотреть файл

@ -14,7 +14,7 @@ body {
let beforeRender;
let img;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -11,7 +11,7 @@ body {
<script src="/resources/testharnessreport.js"></script>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
on_event(window, 'message', e => {
assert_equals(e.data.length, 1);
assert_equals(e.data.entryType, 'element');

Просмотреть файл

@ -13,7 +13,7 @@ body {
<img src='resources/square100.png' elementtiming='my_image' id='my_id'/>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let beforeRender = performance.now();
const img = document.getElementById('my_id');
let firstCallback = true;

Просмотреть файл

@ -21,7 +21,7 @@ body {
<script>
const beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -21,7 +21,7 @@ body {
<script>
const beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -20,7 +20,7 @@ body {
let img;
let img2;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -16,7 +16,7 @@
</style>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done((entries) => {
// The image should not have caused an entry, so fail test.

Просмотреть файл

@ -18,7 +18,7 @@ body {
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let numObservedElements = 0;
let observedCircle = false;
let observedSquare = false;

Просмотреть файл

@ -11,7 +11,7 @@
<body>
<script>
async_test(t => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let destUrl = get_host_info().HTTP_REMOTE_ORIGIN
+ '/element-timing/resources/multiple-redirects.py?';
destUrl += 'redirect_count=2';

Просмотреть файл

@ -18,7 +18,7 @@ body {
<script>
let beforeRender = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -12,7 +12,7 @@ body {
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done((entryList) => {
assert_unreached("Should not have received an entry!");

Просмотреть файл

@ -14,7 +14,7 @@ body {
let beforeRender;
let img;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -7,7 +7,7 @@
<script>
let beforeRender;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let observedImage = false;
let observedText = false;
const observer = new PerformanceObserver(

Просмотреть файл

@ -22,7 +22,7 @@ body {
<script>
let beforeRender, image1Observed=0, image2Observed=0, image3Observed=0;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func(function(entryList) {
entryList.getEntries().forEach( entry => {

Просмотреть файл

@ -12,7 +12,7 @@ body {
<div id='target'></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_unreached('Should not observe elements in shadow trees!');

Просмотреть файл

@ -12,7 +12,7 @@ body {
<div id='target'></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_unreached('Should not observe text elements in shadow trees!');

Просмотреть файл

@ -7,7 +7,7 @@
<script>
let beforeRender;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -15,7 +15,7 @@ p {
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let paragraph;
let beforeRender;
const observer = new PerformanceObserver(

Просмотреть файл

@ -7,7 +7,7 @@
<script>
let beforeRender;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -14,7 +14,7 @@
let numInitial = 75;
let sleep = 500;
async_test(function(t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const img_src = 'resources/progressive-image.py?name=square20.jpg&numInitial='
+ numInitial + '&sleep=' + sleep;
const observer = new PerformanceObserver(

Просмотреть файл

@ -14,7 +14,7 @@ body {
let beforeRender;
let img;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -11,7 +11,7 @@
<body>
<script>
async_test(t => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
let destUrl = get_host_info().HTTP_REMOTE_ORIGIN
+ '/resource-timing/resources/multi_redirect.py?';
destUrl += 'page_origin=' + get_host_info().HTTP_ORIGIN;

Просмотреть файл

@ -7,7 +7,7 @@
<script>
let img;
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const beforeRender = performance.now();
new PerformanceObserver(
t.step_func_done(function(entryList) {

Просмотреть файл

@ -10,7 +10,7 @@
<body>
<script>
async_test(t => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
// First redirect
let destUrl = '/common/redirect.py?location='
// Second redirect

Просмотреть файл

@ -15,7 +15,7 @@
<p elementtiming='observeMe'>Test text</p>
<script>
async_test((t) => {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(t.step_func_done(() => {}));
observer.observe({type: 'element', buffered: true});
window.onload = () => {

Просмотреть файл

@ -21,7 +21,7 @@ h3 {
<h3 id='title3' elementtiming='h3'>I am h3</h3>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const beforeRender = performance.now();
let observedFlex = false;
let observedGrid = false;

Просмотреть файл

@ -8,7 +8,7 @@
<img elementtiming='img' src="resources/square100.png"/>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);

Просмотреть файл

@ -12,7 +12,7 @@
let firstInputSeen = false;
let eventSeen = false;
async_test(t => {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
const validateEntry = t.step_func(entry => {
if (entry.entryType === 'first-input')
firstInputSeen = true;

Просмотреть файл

@ -21,7 +21,7 @@
let timeAfterSecondClick;
let observedEntries = [];
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
new PerformanceObserver(t.step_func(entryList => {
observedEntries = observedEntries.concat(entryList.getEntries().filter(
entry => entry.name === 'mousedown'));

Просмотреть файл

@ -48,7 +48,7 @@
}
promise_test(async t => {
assert_precondition(window.PerformanceEventTiming, "Event Timing is not supported");
assert_implements(window.PerformanceEventTiming, "Event Timing is not supported");
clickTimeMin = performance.now();
let observedEntries = false;
const observerPromise = new Promise(resolve => {

Просмотреть файл

@ -10,7 +10,7 @@
<button id='button'>Click me</button>
<script>
promise_test( t => {
assert_precondition(window.EventCounts, "Event Counts isn't supported");
assert_implements(window.EventCounts, "Event Counts isn't supported");
function testClicks(expectedCount, resolve) {
const clickCount = performance.eventCounts.get('click');
if (clickCount < expectedCount) {

Просмотреть файл

@ -8,7 +8,7 @@
<script src=/resources/testdriver-vendor.js></script>
<script>
test(() => {
assert_precondition(window.EventCounts, "Event Counts isn't supported");
assert_implements(window.EventCounts, "Event Counts isn't supported");
const eventTypes = [
'auxclick',
'click',

Просмотреть файл

@ -20,7 +20,7 @@
PerformanceObserver should observe one and only one entry.
*/
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
let hasObservedFirstInput = false;
new PerformanceObserver(t.step_func((entryList) => {
assert_false(hasObservedFirstInput);

Просмотреть файл

@ -18,7 +18,7 @@
delayCalled = true;
}
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
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.

Просмотреть файл

@ -30,7 +30,7 @@
Validate entries
*/
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
new PerformanceObserver(t.step_func_done(() => {
validateEntries();
t.done();

Просмотреть файл

@ -12,7 +12,7 @@
<script>
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
function testEntries() {
// First callback is not ensured to have the entry.
if (performance.getEntriesByType('first-input').length === 0) {

Просмотреть файл

@ -35,7 +35,7 @@
}
async_test(function(t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
new PerformanceObserver(t.step_func_done(entryList => {
const observerCallbackTime = performance.now();
const entries = entryList.getEntries().filter(

Просмотреть файл

@ -10,7 +10,7 @@
<button id='button'>Generate a 'click' event</button>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceEventTiming, 'Event Timing is not supported.');
assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.');
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
const entry = entryList.getEntries()[0];

Просмотреть файл

@ -1,5 +1,5 @@
async_test(t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
new PerformanceObserver(t.step_func((entryList, obs) => {
const observer = new PerformanceObserver(t.step_func_done(list => {
let longtaskObserved = false;

Просмотреть файл

@ -19,7 +19,7 @@ const Containers = [
];
Containers.forEach(container => {
promise_test(async t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const initialTime = performance.now();
return new Promise(resolve => {
const observer = new PerformanceObserver(t.step_func(entryList => {

Просмотреть файл

@ -1,5 +1,5 @@
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
new PerformanceObserver(
t.step_func_done(entryList => {
const entries = entryList.getEntries();

Просмотреть файл

@ -10,7 +10,7 @@
<div id="log"></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -10,7 +10,7 @@
<div id="log"></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -11,7 +11,7 @@
<script>
const initialTime = performance.now();
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -10,7 +10,7 @@
<div id="log"></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -8,7 +8,7 @@
<script>
const t = async_test(t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
window.addEventListener('message', t.step_func(e => {
assert_equals(e.data['entryType'], 'longtask');
assert_equals(e.data['frame-attribution'], 'same-origin-ancestor');

Просмотреть файл

@ -10,7 +10,7 @@
<div id="log"></div>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -8,7 +8,7 @@
<script>
async_test(t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
window.addEventListener('message', t.step_func(e => {
assert_equals(e.data['entryType'], 'longtask');
assert_equals(e.data['frame-attribution'], 'cross-origin-unreachable');

Просмотреть файл

@ -8,7 +8,7 @@
<script>
async_test(t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
window.addEventListener('message', t.step_func(e => {
assert_equals(e.data['entryType'], 'longtask');
// Ignore any long task that may be produced by the top-level frame.

Просмотреть файл

@ -7,7 +7,7 @@
<body>
<script>
async_test(function (t) {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -11,7 +11,7 @@
This window opens a new window which contains a longtask. We test that the
longtask from the new window is not observed by the observer of this window. */
async_test(t => {
assert_precondition(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const observer = new PerformanceObserver(
t.step_func(function (entryList) {
const entries = entryList.getEntries();

Просмотреть файл

@ -1,5 +1,5 @@
test(() => {
assert_precondition(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_implements(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
const types = PerformanceObserver.supportedEntryTypes;
assert_true(types.includes("longtask"),
"There should be 'longtask' in PerformanceObserver.supportedEntryTypes");
@ -21,8 +21,8 @@ function syncWait(waitDuration) {
const entryType = "longtask";
promise_test(async () => {
assert_precondition(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_precondition(typeof PerformanceObserver.supportedEntryTypes.includes(entryType), `supportedEntryTypes does not include '${entryType}'`);
assert_implements(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_implements(typeof PerformanceObserver.supportedEntryTypes.includes(entryType), `supportedEntryTypes does not include '${entryType}'`);
await new Promise((resolve) => {
new PerformanceObserver(function (list, observer) {
observer.disconnect();

Просмотреть файл

@ -9,7 +9,7 @@
<script>
async_test(function(t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
t.step(function() {
const bufferedEntries = performance.getEntriesByType('paint');
assert_equals(bufferedEntries.length, 0, "No paint entries yet");

Просмотреть файл

@ -1,5 +1,5 @@
async_test(t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
// First observer creates second in callback to ensure the entry has been dispatched by the time
// the second observer begins observing.
let entries_seen = 0;

Просмотреть файл

@ -5,7 +5,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
window.addEventListener('message', t.step_func(e => {
assert_equals(e.data, '2 paint first-paint paint first-contentful-paint');
// When only child frame paints, expect only first-paint.

Просмотреть файл

@ -9,7 +9,7 @@
<canvas id="canvas" width="50" height="50"></canvas>
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
const canvas = document.getElementById('canvas');

Просмотреть файл

@ -16,7 +16,7 @@
<div id="main"></div>
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
}, 'Gradients should not count as contentful');

Просмотреть файл

@ -9,7 +9,7 @@
<input id="input" type="text" />
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
const input = document.getElementById('input');

Просмотреть файл

@ -9,7 +9,7 @@
<video id="video" autoplay></video>
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
// Set actual video content to trigger FCP.

Просмотреть файл

@ -9,7 +9,7 @@
<video id="video" width="50" height="50"></video>
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
const video = document.getElementById('video');

Просмотреть файл

@ -19,7 +19,7 @@
<div id="text">TEXT</div>
<script>
promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);
document.body.style.direction = 'ltr'

Просмотреть файл

@ -11,7 +11,7 @@
<footer>
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const body = document.getElementsByTagName('body')[0];
body.style.backgroundImage = 'url(resources/circles.png)';
window.onload = function() {

Просмотреть файл

@ -9,7 +9,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const canvas = document.getElementById("canvas");
const context = canvas.getContext("2d");
context.beginPath();

Просмотреть файл

@ -9,7 +9,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const img = document.createElement("IMG");
img.src = "resources/circles.png";
img.onload = function() {

Просмотреть файл

@ -10,7 +10,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const bufferedEntries = performance.getEntriesByType('paint');
assert_equals(bufferedEntries.length, 0, "No paint entries yet");
const div = document.createElement("div");

Просмотреть файл

@ -9,7 +9,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const img = document.createElement("IMG");
img.src = "resources/circle.svg";
img.onload = function() {

Просмотреть файл

@ -10,7 +10,7 @@
<img src='resources/circles.png'/>
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
window.addEventListener('message', t.step_func(e => {
// Child iframe should not have any paint-timing entries.

Просмотреть файл

@ -11,7 +11,7 @@
<footer>
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
document.body.style.backgroundColor = "#AA0000";
function testPaintEntries() {

Просмотреть файл

@ -9,7 +9,7 @@
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const div = document.createElement("div");
div.style.width = "100px";
div.style.height = "100px";

Просмотреть файл

@ -21,7 +21,7 @@ window.onload = function() {
history.replaceState({}, "", current_url);
}
async_test(function(t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
function testPaintEntries() {
const bufferedEntries = performance.getEntriesByType('paint');
if (bufferedEntries.length < 2) {

Просмотреть файл

@ -36,7 +36,7 @@ async function test_fcp(label) {
const style = document.createElement('style');
document.head.appendChild(style);
await promise_test(async t => {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
const main = document.getElementById('main');
await new Promise(r => window.addEventListener('load', r));
await assertNoFirstContentfulPaint(t);

Просмотреть файл

@ -6,7 +6,7 @@
<iframe id="listening-iframe" src="resources/subframe-sending-paint.html"></iframe>
<script>
async_test(function (t) {
assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
let paintingIframeHasDispatchedEntries = false;
window.addEventListener('message', t.step_func(e => {
if (!paintingIframeHasDispatchedEntries) {

Просмотреть файл

@ -1,13 +1,13 @@
test(() => {
assert_precondition(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_implements(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_true(PerformanceObserver.supportedEntryTypes.includes("paint"),
"There should be an entry 'paint' in PerformanceObserver.supportedEntryTypes");
}, "supportedEntryTypes contains 'paint'.");
const entryType = 'paint';
promise_test(async() => {
assert_precondition(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_precondition(typeof PerformanceObserver.supportedEntryTypes.includes(entryType), `supportedEntryTypes does not include '${entryType}'`);
assert_implements(typeof PerformanceObserver.supportedEntryTypes !== "undefined", 'supportedEntryTypes is not supported');
assert_implements(typeof PerformanceObserver.supportedEntryTypes.includes(entryType), `supportedEntryTypes does not include '${entryType}'`);
await new Promise((resolve) => {
new PerformanceObserver(function (list, observer) {
observer.disconnect();