mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
Automatic update from web-platform-testsNetwork Error Logging: Add web platform tests This adds web-platform-tests for Network Error Logging. They should be suitable to upstream into the cross-platform WPT repo. Bug: 748549 Change-Id: I24098aeec8488c34a5f9239309264e9534dca6e4 Reviewed-on: https://chromium-review.googlesource.com/1106518 Reviewed-by: Peter Beverloo <[email protected]> Reviewed-by: Philip Jägenstedt <[email protected]> Commit-Queue: Douglas Creager <[email protected]> Cr-Commit-Position: refs/heads/master@{#584093} -- wpt-commits: d0b86dfcab07829407425bad98287757818f96c5 wpt-pr: 11758
38 lines
1.0 KiB
HTML
38 lines
1.0 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>
|
|
Test that NEL reports are sent for successful requests
|
|
</title>
|
|
<script src='/resources/testharness.js'></script>
|
|
<script src='/resources/testharnessreport.js'></script>
|
|
<script src='./support/nel.sub.js'></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
nel_test(async t => {
|
|
// Make a request to a resource whose response headers include a NEL
|
|
// policy.
|
|
await fetchResourceWithBasicPolicy();
|
|
// That policy should apply to the request that delivered it, so the
|
|
// collector should have received a report about the request.
|
|
assert_true(await reportExists({
|
|
url: getURLForResourceWithBasicPolicy(),
|
|
user_agent: navigator.userAgent,
|
|
type: "network-error",
|
|
body: {
|
|
method: "GET",
|
|
sampling_fraction: 1.0,
|
|
status_code: 200,
|
|
phase: "application",
|
|
type: "ok",
|
|
},
|
|
metadata: {
|
|
content_type: "application/reports+json",
|
|
},
|
|
}));
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|