| Index: third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-paint-only.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-paint-only.html b/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-paint-only.html
|
| index c427faa03843fa456b56eb75465f05638f377ad9..a270370fc73688102d8c6b3137eb5bdb0866e027 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-paint-only.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/first-paint-only.html
|
| @@ -5,30 +5,24 @@
|
| <body>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| - <script>
|
| + <div id="main"></div>
|
|
|
| + <script>
|
| async_test(function (t) {
|
| - var observer = new PerformanceObserver(
|
| - t.step_func(function (entryList) {
|
| - var entries = entryList.getEntries();
|
| - // Nothing contentful to be painted yet.
|
| - assert_equals(entries.length, 1,
|
| - "There should be only first paint timing instance.");
|
| - assert_equals(entries[0].entryType, "paint",
|
| - "Expected entryType to be: paint.");
|
| - assert_equals(entries[0].name, "first-paint",
|
| - "Expected name to be: first-paint.");
|
| - assert_equals(entries[0].duration, 0,
|
| - "Expected duration to be: 0.");
|
| - observer.disconnect();
|
| - })
|
| - );
|
| - observer.observe({entryTypes: ["paint"]});
|
| + var div = document.createElement("div");
|
| + div.style.width = "100px";
|
| + div.style.height = "100px";
|
| + div.style.backgroundColor = "red";
|
| + div.style.color = "blue";
|
| + document.getElementById("main").appendChild(div);
|
|
|
| - t.step_timeout(function() { t.done(); }, 1000);
|
| - }, "Performance first paint timing entry is observable. No first contentful paint.");
|
| + testRunner.capturePixelsAsyncThen(t.step_func_done(function() {
|
| + bufferedEntries = performance.getEntriesByType('paint');
|
| + assert_equals(bufferedEntries.length, 1, "FP only.");
|
| + assert_equals(bufferedEntries[0].entryType, "paint");
|
| + assert_equals(bufferedEntries[0].name, "first-paint");
|
| + }));
|
| + }, "Performance first paint timing entry exists. No first contentful paint.");
|
| </script>
|
| -
|
| - <div style="background-color:black;color:white;padding:20px;"></div>
|
| </body>
|
| </html>
|
|
|