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;">...test...</di
v> |
| 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 assert_equals(entries.length, 2, |
| 16 "There should be two paint timing instances."); |
| 17 assert_equals(entries[0].entryType, "paint", |
| 18 "Expected entryType to be: paint."); |
| 19 assert_equals(entries[0].duration, 0, |
| 20 "Expected duration to be: 0."); |
| 21 |
| 22 assert_equals(entries[1].entryType, "paint", |
| 23 "Expected entryType to be: paint."); |
| 24 assert_equals(entries[1].duration, 0, |
| 25 "Expected duration to be: 0."); |
| 26 observer.disconnect(); |
| 27 t.done(); |
| 28 }) |
| 29 ); |
| 30 observer.observe({entryTypes: ["paint"]}); |
| 31 |
| 32 }, "Both first-paint-timing and first-contentful-paint timing entry are obse
rvable."); |
| 33 |
| 34 </script> |
| 35 </body> |
| 36 </html> |
OLD | NEW |