OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <title>Performance Paint Timing Test</title> |
| 4 </head> |
| 5 <body> |
| 6 <div style="background-color:black;color:white;padding:20px;"></div> |
| 7 <script src="../../resources/testharness.js"></script> |
| 8 <script src="../../resources/testharnessreport.js"></script> |
| 9 <script> |
| 10 |
| 11 async_test(function (t) { |
| 12 var observer = new PerformanceObserver( |
| 13 t.step_func(function (entryList) { |
| 14 var entries = entryList.getEntries(); |
| 15 // Nothing contentful to be painted yet. |
| 16 assert_equals(entries.length, 1, |
| 17 "There should be only first paint timing instance."); |
| 18 assert_equals(entries[0].entryType, "paint", |
| 19 "Expected entryType to be: paint."); |
| 20 assert_equals(entries[0].name, "first-paint", |
| 21 "Expected name to be: first-paint."); |
| 22 assert_equals(entries[0].duration, 0, |
| 23 "Expected duration to be: 0."); |
| 24 observer.disconnect(); |
| 25 t.done(); |
| 26 }) |
| 27 ); |
| 28 observer.observe({entryTypes: ["paint"]}); |
| 29 |
| 30 }, "Performance first paint timing entry is observable."); |
| 31 |
| 32 </script> |
| 33 </body> |
| 34 </html> |
OLD | NEW |