blob: 3dc47c696fb87ead0ef808b99b7e6e52cff01ebe [file] [log] [blame]
<!DOCTYPE html>
<html manifest="/fetch/metadata/resources/record-header.py?file=appcache-manifest{{$id:uuid()}}">
<meta name="timeout" content="long">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/fetch/metadata/resources/helper.js></script>
<script src=/common/utils.js></script>
<body></body>
<script>
async_test(t => {
const expected = {"site": "same-origin", "user": "", "mode": "no-cors", "dest": "empty"};
window.applicationCache.oncached = window.applicationCache.onnoupdate = window.applicationCache.onerror = t.step_func(async e => {
try {
let response = await fetch(
"/fetch/metadata/resources/record-header.py?retrieve=true&file=appcache-manifest{{$id}}");
let text = await response.text();
assert_header_equals(text, expected, "Appcache manifest");
response = await fetch(
"/fetch/metadata/resources/record-header.py?retrieve=true&file=appcache-resource{{$id}}");
text = await response.text();
assert_header_equals(text, expected, "Appcache resource");
} catch (e) {
t.step(e => {
if (e instanceof AssertionError) {
throw e;
}
assert_unreached(`Unhandled rejection with value: ${e}`);
});
}
t.done();
});
}, "Appcache!");
</script>