| Index: third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-contentful-image.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-contentful-image.html b/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-contentful-image.html
|
| index 531214284c1b21fa418e71d8f1ca1279a1db631d..2104aea2a816ab504fd8dac69c30d8c0ecb57f8d 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-contentful-image.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-contentful-image.html
|
| @@ -5,39 +5,23 @@
|
| <body>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| - <script>
|
| - async_test(function (t) {
|
| - var observer = new PerformanceObserver(
|
| - t.step_func(function (entryList) {
|
| - var entries = entryList.getEntries();
|
| - assert_equals(entries.length, 2,
|
| - "There should be two paint timing instances.");
|
| - assert_equals(entries[0].entryType, "paint",
|
| - "Expected entryType to be: paint.");
|
| - assert_equals(entries[0].duration, 0,
|
| - "Expected duration to be: 0.");
|
| -
|
| - assert_equals(entries[1].entryType, "paint",
|
| - "Expected entryType to be: paint.");
|
| - assert_equals(entries[1].duration, 0,
|
| - "Expected duration to be: 0.");
|
| - observer.disconnect();
|
| - t.done();
|
| - })
|
| - );
|
| - observer.observe({entryTypes: ["paint"]});
|
| -
|
| - }, "First contentful paint fires due to image render.");
|
| - </script>
|
| + <div id="image"></div>
|
|
|
| <script>
|
| - window.onload = function() {
|
| + async_test(function (t) {
|
| var img = document.createElement("IMG");
|
| img.src = "resources/circles.png";
|
| document.getElementById('image').appendChild(img);
|
| - }
|
| - </script>
|
|
|
| - <div id="image"></div>
|
| + testRunner.capturePixelsAsyncThen(t.step_func_done(function() {
|
| + bufferedEntries = performance.getEntriesByType('paint');
|
| + assert_equals(bufferedEntries.length, 2, "There should be two paint timing instances.");
|
| + assert_equals(bufferedEntries[0].entryType, "paint");
|
| + assert_equals(bufferedEntries[0].name, "first-paint");
|
| + assert_equals(bufferedEntries[1].entryType, "paint");
|
| + assert_equals(bufferedEntries[1].name, "first-contentful-paint");
|
| + }));
|
| + }, "First contentful paint fires due to image render.");
|
| + </script>
|
| </body>
|
| </html>
|
|
|