4 <meta charset=
"utf-8" />
5 <title>Resource Timing: image with a hash
</title>
6 <link rel=
"help" href=
"http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>
7 <script src=
"/resources/testharness.js"></script>
8 <script src=
"/resources/testharnessreport.js"></script>
9 <script src=
"resources/webperftestharness.js"></script>
10 <script src=
"resources/webperftestharnessextension.js"></script>
12 setup({explicit_done
: true});
14 // explicitly test the namespace before we start testing
15 test_namespace("getEntriesByType");
17 function onload_test() {
18 if (window
.performance
.getEntriesByType
=== undefined) {
23 const url
= "resources/fake_responses.py?tag=" + Math
.random() + '#hash=1';
24 const image
= new Image();
25 image
.onload
= image
.onerror
= () => {
26 const entries
= window
.performance
.getEntriesByType('resource').filter(r
=> r
.initiatorType
=== 'img');
27 test_equals(entries
.length
, 1, "There should be one entry");
28 if (entries
.length
=== 1) {
29 test_true(entries
[0].name
.indexOf('#hash=1') > -1, "There should be a hash in the resource name");
36 window
.onload
= onload_test
;
41 <p>This test validates that a hash in an image URL is preserved in resource timing API results.
</p>