blob: fda02aadf14fcb9be859c091df3a2ac1d2c56994 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>KV Storage: should not work in non-secure contexts when included via an import statement</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
setup({ allow_uncaught_exception: true });
test(() => {
assert_false(self.isSecureContext, "This test must run in a non-secure context");
}, "Prerequisite check");
async_test(t => {
window.addEventListener("error", t.step_func_done(errorEvent => {
assert_equals(errorEvent.error.constructor, DOMException, "Must trigger a DOMException");
assert_equals(errorEvent.error.name, "SecurityError",
"The DOMException must be a \"SecurityError\"");
}, { once: true }));
});
</script>
<script type="module">
import "std:kv-storage";
</script>