4 <meta charset=
"utf-8" />
5 <title>Resource Timing: PerformanceResourceTiming attributes
</title>
6 <link rel=
"help" href=
"https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
7 <script src=
"/resources/testharness.js"></script>
8 <script src=
"/resources/testharnessreport.js"></script>
11 // Returns a promise that settles once the given path has been fetched.
12 function load_image(path
) {
13 return new Promise(resolve
=> {
14 const img
= new Image();
15 img
.onload
= img
.onerror
= resolve
;
20 promise_test(async () => {
21 // Clean up entries from scripts includes.
22 performance
.clearResourceTimings();
23 await
load_image("resources/fake_responses.py#hash=1");
24 const entry_list
= performance
.getEntriesByType("resource");
25 if (entry_list
.length
!= 1) {
26 throw new Error("There should be one entry for one resource");
28 assert_true(entry_list
[0].name
.includes('#hash=1'),
29 "There should be a hash in the resource name");
30 }, "URL fragments should be present in the 'name' attribute");
36 <p>This test validates that PerformanceResourceTiming entries' attributes are
37 populated with the correct values.
</p>