2 Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/
10 var promise
= new Promise(resolve
=> {
11 var observer
= new PerformanceObserver(list
=> resolve(list
));
12 observer
.observe({entryTypes
: ["paint"]});
15 promise
.then(list
=> {
16 var perfEntries
= list
.getEntries();
17 opener
.is(list
.getEntries().length
, 1);
18 opener
.isDeeply(list
.getEntries(),
19 performance
.getEntriesByType("paint"),
20 "Observed 'paint' entries should equal to entries obtained by getEntriesByType.");
21 opener
.isDeeply(list
.getEntries({name
: "paint"}),
22 performance
.getEntriesByName("paint"),
23 "getEntries with name filter should return correct results.");
24 opener
.isDeeply(list
.getEntries({entryType
: "paint"}),
25 performance
.getEntriesByType("paint"),
26 "getEntries with entryType filter should return correct results.");
30 const img
= document
.createElement("IMG");
31 img
.src
= "http://example.org/tests/dom/performance/tests/logo.png";
32 document
.body
.appendChild(img
);