Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1523562 [wpt PR 14792] - Split
Sec-Metadata
into Sec-Fetch-*
.…
…, a=testonly Automatic update from web-platform-tests Split `Sec-Metadata` into `Sec-Fetch-*`. As of [1], we've split the single `Sec-Metadata` header into multiple headers: `Sec-Fetch-Dest`, `Sec-Fetch-Site`, and `Sec-Fetch-User`. This patch does that work in Chromium. The spec change also added `Sec-Fetch-Mode`, but this patch does not. We'll add that functionality to Chromium in a future CL. Test changes pulled from clap@'s excellent PR at web-platform-tests/wpt#14771 The test failures are expected: redirect failures are https://crbug.com/872285, object/embed failures are https://crbug.com/860510. XSLT failures are WontFix (some engines support cross-origin XSLT; Blink does not). [1]: w3c/webappsec-fetch-metadata@105103d Bug: 843478 Change-Id: I7654d5e823ad813682ac3eb244bbc244a322e6ca Reviewed-on: https://chromium-review.googlesource.com/c/1402448 Commit-Queue: Mike West <mkwst@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/master@{#622145} -- wpt-commits: 2d42384cf21efd71843295d319c1bab85b3acf4a wpt-pr: 14792
- Loading branch information
Showing
25 changed files
with
152 additions
and
116 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 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 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 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 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 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 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
25 changes: 9 additions & 16 deletions
25
testing/web-platform/tests/fetch/sec-metadata/resources/helper.js
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,18 +1,11 @@ | ||
function parse_metadata(value) { | ||
let result = {}; | ||
value.split(',').forEach(item => { | ||
let parsed = item.trim().split('='); | ||
result[parsed[0]] = parsed[1]; | ||
}); | ||
return result; | ||
} | ||
|
||
function assert_header_equals(value, expected) { | ||
// check that the returned value is an object, not a String | ||
assert_not_equals(value, "", "Empty Sec-Metadata header."); | ||
let result = parse_metadata(value); | ||
assert_equals(result.cause, expected.cause, "cause"); | ||
assert_equals(result.destination, expected.destination, "destination"); | ||
assert_equals(result.target, expected.target, "target"); | ||
assert_equals(result.site, expected.site, "site"); | ||
if (typeof(value) === "string"){ | ||
assert_not_equals(value, "No header has been recorded"); | ||
value = JSON.parse(value); | ||
} | ||
assert_equals(value.dest, expected.dest, "dest"); | ||
// Mode is commented out as no test cases have been filled out yet | ||
// assert_equals(value.mode, expected.mode, "mode"); | ||
assert_equals(value.site, expected.site, "site"); | ||
assert_equals(value.user, expected.user, "user"); | ||
} |
Oops, something went wrong.