Skip to content

Commit

Permalink
[ResourceTiming]: Rename WPT resource
Browse files Browse the repository at this point in the history
This change updates the name of some resources used for ResourceTiming
WPTs.

Bug: 1171767
Change-Id: I1fd1f97425058d02562e4477372e8afa1edd1424
GithubIssue: w3c/resource-timing#254
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780397
Commit-Queue: Yoav Weiss <[email protected]>
Auto-Submit: Tom McKee <[email protected]>
Reviewed-by: Yoav Weiss <[email protected]>
Cr-Commit-Position: refs/heads/master@{#878879}
NOKEYCHECK=True
GitOrigin-RevId: 151c30d10af8568d16c8870701786d4b05602a1c
  • Loading branch information
tommckee1 authored and copybara-github committed May 4, 2021
1 parent 7d5f8f5 commit ee2863e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<script>
const {REMOTE_ORIGIN} = get_host_info();
const blank_page = `/resource-timing/resources/blank_page_green.htm`;
const blank_page = `/resource-timing/resources/green.html`;
const destUrl = `/common/redirect.py?location=${REMOTE_ORIGIN}/${blank_page}`;

attribute_test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

const {REMOTE_ORIGIN, ORIGIN} = get_host_info();
const redirect = "/common/redirect.py?location=" + "/resource-timing/resources/blank_page_green.htm";
const redirect = "/common/redirect.py?location=" + "/resource-timing/resources/green.html";
const cross_origin_redirect = REMOTE_ORIGIN + redirect;
const same_origin_redirect = ORIGIN + redirect;
promise_test(t => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}, "Same-origin iframe that complies with CSP attribute gets reported");

promise_test(t => {
const url = new URL("/resource-timing/resources/green_frame.htm", location.href);
const url = new URL("/resource-timing/resources/green-frame.html", location.href);
return run_test(t, url.toString(), csp_directive);
}, "Same-origin iframe that doesn't comply with CSP attribute gets reported");

Expand All @@ -61,7 +61,7 @@
}, "Cross-origin iframe that complies with CSP attribute gets reported");

promise_test(t => {
const url = new URL("/resource-timing/resources/green_frame.htm", REMOTE_ORIGIN);
const url = new URL("/resource-timing/resources/green-frame.html", REMOTE_ORIGIN);
return run_test(t, url.toString(), csp_directive);
}, "Cross-origin iframe that doesn't comply with CSP attribute gets reported");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const observer = new PerformanceObserver(list => {
const entries = list.getEntries();
for (entry of entries) {
if (entry.name.includes("blank_page_green.htm")) {
if (entry.name.includes("green.html")) {
observer.disconnect();
// Observe its performance entry to make sure nextHopProtocol is empty
if (entry.nextHopProtocol != "") {
Expand All @@ -36,7 +36,7 @@
}
});
observer.observe({entryTypes: ["resource"]});
addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/blank_page_green.htm");
addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/green.html");
});
}, "Add TAO-less iframe to remote origin. Make sure nextHopProtocol is the empty string");

Expand Down
6 changes: 3 additions & 3 deletions blink/web_tests/external/wpt/resource-timing/redirects.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"Verify attributes of a redirected image's PerformanceResourceTiming");

attribute_test(
load.iframe, url_prefix + "blank_page_green.html",
load.iframe, url_prefix + "green.html",
invariants.assert_same_origin_redirected_resource,
"Verify attributes of a redirected iframe's PerformanceResourceTiming");

Expand All @@ -37,13 +37,13 @@
"Verify attributes of a redirected script's PerformanceResourceTiming");

attribute_test(
load.xhr_sync, url_prefix + "blank_page_green.htm?id=xhr",
load.xhr_sync, url_prefix + "green.html?id=xhr",
invariants.assert_same_origin_redirected_resource,
"Verify attributes of a redirected synchronous XMLHttpRequest's " +
"PerformanceResourceTiming");

attribute_test(
load.xhr_sync, https_url_prefix + "blank_page_green.htm?id=xhr",
load.xhr_sync, https_url_prefix + "green.html?id=xhr",
invariants.assert_cross_origin_redirected_resource,
"Verify attributes of a synchronous XMLHttpRequest's " +
"PerformanceResourceTiming where the initial HTTP request is redirected " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png', 'img');
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-srcset', 'img');
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.png?id=srcset-src', 'img');
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm', 'iframe');
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=frame', 'frame');
addEntryIfExists(entries, expected_entries, pathname + 'green.html', 'iframe');
addEntryIfExists(entries, expected_entries, pathname + 'green.html?id=frame', 'frame');
addEntryIfExists(entries, expected_entries, pathname + 'empty_script.js', 'script');
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=embed', 'embed');
addEntryIfExists(entries, expected_entries, pathname + 'resource_timing_test0.css?id=n1', 'css');
Expand Down Expand Up @@ -128,7 +128,7 @@
addEntryIfExists(entries, expected_entries, pathname + 'nested.css', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=prefetch', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'nested.css?id=preload', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'blank_page_green.htm?id=prerender', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'green.html?id=prerender', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'manifest.json', 'link');
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=beacon', 'beacon');
addEntryIfExists(entries, expected_entries, pathname + 'empty.py?id=fetch', 'fetch');
Expand Down Expand Up @@ -159,6 +159,6 @@ <h1>Description</h1>
<p>This test validates that all of the initiator types are represented.</p>
<div id="log"></div>
<iframe id="frameContext" onload="onload_test();" src="resources/all_resource_types.htm" style="width: 250px; height: 250px;"></iframe>
<iframe id="frameContext2" onload="frameset_onload();" src="resources/green_frame.htm" style="width: 250px; height: 250px;"></iframe>
<iframe id="frameContext2" onload="frameset_onload();" src="resources/green-frame.html" style="width: 250px; height: 250px;"></iframe>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<link rel="stylesheet" href="nested.css"></link>
<link rel="prefetch" href="nested.css?id=prefetch"></link>
<link rel="preload" href="nested.css?id=preload" as="style"></link>
<link rel="prerender" href="blank_page_green.htm?id=prerender"></link>
<link rel="prerender" href="green.html?id=prerender"></link>
<link rel="manifest" href="manifest.json"></link>
<img src="resource_timing_test0.png"></img>
<img src="resource_timing_test0.png?id=srcset-src"
srcset="resource_timing_test0.png?id=srcset-srcset 67w"
sizes="67px"></img>
<iframe src="blank_page_green.htm" width="100px" height="100px"></iframe>
<iframe src="green.html" width="100px" height="100px"></iframe>
<script src="empty_script.js"></script>
<script>
var async_xhr = new XMLHttpRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<frameset>
<frame src="blank_page_green.htm?id=frame">
<frame src="green.html?id=frame">
</frameset>
</head>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
const observer = new PerformanceObserver(list => {
const entries = list.getEntries();
for (entry of entries) {
if (entry.name.includes("blank_page_green.htm")) {
if (entry.name.includes("green.html")) {
observer.disconnect();
// Observe its performance entry to make sure workerStart is zero
if (entry.workerStart != 0) {
Expand All @@ -51,7 +51,7 @@
}
});
observer.observe({entryTypes: ["resource"]});
addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/blank_page_green.htm");
addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/green.html");
});
}, "Add TAO-less iframe to remote origin. Make sure workerStart is zero");

Expand Down

0 comments on commit ee2863e

Please sign in to comment.