Skip to content

Commit

Permalink
ResourceTiming: Cleanup resource_hash.htm
Browse files Browse the repository at this point in the history
This change rewrites a ResourceTiming WPT to use the updated style and
file naming conventions in wpt/resource-timing/CodingConventions.md

Bug: 1171767
Change-Id: I00d44affaaa702598c39bbdadf5f14f5a5392b93
GithubIssue: w3c/resource-timing#254
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2698854
Reviewed-by: Yoav Weiss <[email protected]>
Commit-Queue: Tom McKee <[email protected]>
Cr-Commit-Position: refs/heads/master@{#855731}
  • Loading branch information
tommckee1 authored and chromium-wpt-export-bot committed Feb 19, 2021
1 parent 42520ae commit 29134be
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 44 deletions.
39 changes: 39 additions & 0 deletions resource-timing/entry-attributes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing: PerformanceResourceTiming attributes</title>
<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

// Returns a promise that settles once the given path has been fetched.
function load_image(path) {
return new Promise(resolve => {
const img = new Image();
img.onload = img.onerror = resolve;
img.src = path;
});
}

promise_test(async () => {
// Clean up entries from scripts includes.
performance.clearResourceTimings();
await load_image("resources/fake_responses.py#hash=1");
const entry_list = performance.getEntriesByType("resource");
if (entry_list.length != 1) {
throw new Error("There should be one entry for one resource");
}
assert_true(entry_list[0].name.includes('#hash=1'),
"There should be a hash in the resource name");
}, "URL fragments should be present in the 'name' attribute");

</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that PerformanceResourceTiming entries' attributes are
populated with the correct values.</p>
</body>
</html>
44 changes: 0 additions & 44 deletions resource-timing/resource_hash.htm

This file was deleted.

0 comments on commit 29134be

Please sign in to comment.