| <script src="/resources/testharness.js"></script> |
| <script src='/resources/testharnessreport.js'></script> |
| <script src="/common/performance-timeline-utils.js"></script> |
| setup({explicit_done: true}) |
| window.addEventListener('load', function() { |
| // there should be exactly three server-timing entries, 2 for document, 1 for img#one |
| test_entries(performance.getEntriesByType('navigation')[0].serverTiming, [{ |
| test_entries(performance.getEntriesByName(document.querySelector('img#one').src)[0].serverTiming, [{ |
| new PerformanceObserver(function(entryList, observer) { |
| // there should be exactly one server-timing entry, 1 for img#two |
| test_entries(entryList.getEntriesByName(document.querySelector('img#two').src)[0].serverTiming, [{ |
| description: 'green.png', |
| }).observe({entryTypes: ['resource']}) |
| var img = document.createElement('img') |
| img.src = './resources/green.png' |
| document.getElementsByTagName('script')[0].parentNode.appendChild(img) |
| <img id='one' src='resources/blue.png'> |