2 Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/
8 https://bugzilla.mozilla.org/show_bug.cgi?id=1518999
11 <title>Test for Bug
1518999</title>
12 <meta http-equiv=
"content-type" content=
"text/html; charset=UTF-8">
16 <div id=
"image"></div>
18 <script class=
"testbody" type=
"text/javascript">
19 async function runTest() {
20 const paintEntries = performance.getEntriesByType('paint');
21 opener.is(paintEntries.length,
0,
"No paint entries yet");
23 const img = document.createElement(
"img");
24 img.src =
"http://example.org/tests/dom/performance/tests/logo.png";
26 const observer = new PerformanceObserver((entryList) =
> {
27 const entries = entryList.getEntries();
28 opener.is(entries.length,
1,
"FCP Only returns");
29 opener.is(entries[
0].entryType,
"paint",
"entryType is paint");
30 opener.is(entries[
0].name,
"first-contentful-paint",
31 "Returned entry should be first-contentful-paint" );
32 const fcpEntriesGotByName =
33 performance.getEntriesByName('first-contentful-paint');
34 opener.is(fcpEntriesGotByName.length,
1,
"entries length should match");
35 opener.is(entries[
0], fcpEntriesGotByName[
0],
"should be the same entry");
39 observer.observe({type: 'paint'});
40 document.body.appendChild(img);
42 window.onload = function() {