Files
firefox/testing/web-platform/tests/network-error-logging/sends-report-on-success.https.html
T
Douglas Creager 9be8f3daef Bug 1472828 [wpt PR 11758] - Network Error Logging: Add web platform tests, a=testonly
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
2018-08-23 17:06:02 +00:00

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>