forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The wpt.fyi test runner does not restart the browser on a failure like the trybot runners do, so any state left by the tests makes for flakiness. Also, accept-ch-change.https.html *actually* wasn't working properly, in that nothing was running except the initial check Leaving the cache-related failures for a separate patch Bug: 1257191 Change-Id: I6a51ad020a6dde748afa9fa1efeeaf4c1ccf8b0d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3213006 Reviewed-by: Mike Taylor <[email protected]> Commit-Queue: Aaron Tagliaboschi <[email protected]> Cr-Commit-Position: refs/heads/main@{#932969}
- Loading branch information
1 parent
691416c
commit 207e223
Showing
7 changed files
with
90 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
|
||
<!-- An empty webpage whose response headers include only the | ||
Accept-CH header. Fetching this webpage should cause | ||
user-agent to persist origin preferences for the client hints | ||
specified in the Accept-CH header.--> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Accept-CH: device memory | ||
Access-Control-Allow-Origin: * |
24 changes: 24 additions & 0 deletions
24
client-hints/resources/expect-no-client-hints-headers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script> | ||
|
||
// This test checks if browser attaches the viewport-width client hint in the | ||
// HTTP request headers. | ||
|
||
// resources/echo-client-hints-received.py sets the response headers depending on the set | ||
// of client hints it receives in the request headers. | ||
|
||
fetch("../resources/echo-client-hints-received.py").then(r => { | ||
if(r.status == 200 && | ||
!r.headers.has("viewport-width-received") && | ||
!r.headers.has("viewport-width-received")) { | ||
window.top.opener.postMessage('PASS', '*'); | ||
} else { | ||
window.top.opener.postMessage('FAIL', '*'); | ||
} | ||
}); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
function open_and_add_load_event(href, func) { | ||
// While not practically possible, opening "blank" first and setting the | ||
// href after allows for the theoretical possibility of registering the event | ||
// after the window is loaded. | ||
let popup_window = window.open("about:blank"); | ||
assert_not_equals(popup_window, null, "Popup windows not allowed?"); | ||
popup_window.addEventListener('load', func, false); | ||
popup_window.location.href=href; | ||
function open_and_add_load_event(href) { | ||
return new Promise((resolve) => { | ||
// While not practically possible, opening "blank" first and setting the | ||
// href after allows for the theoretical possibility of registering the event | ||
// after the window is loaded. | ||
let popup_window = window.open("/resources/blank.html"); | ||
assert_not_equals(popup_window, null, "Popup windows not allowed?"); | ||
popup_window.addEventListener('load', resolve, {once: true}); | ||
popup_window.location.href = href; | ||
}); | ||
} | ||
|
||
async function open_and_expect_headers(href) { | ||
let e = await new Promise(resolve => { | ||
let popup_window = window.open("/resources/blank.html"); | ||
assert_not_equals(popup_window, null, "Popup windows not allowed?"); | ||
window.addEventListener('message', resolve, false); | ||
popup_window.location.href = href; | ||
}); | ||
|
||
assert_equals(e.data, "PASS"); | ||
return e; | ||
} |