blob: 1975370e3d92f29230ab5a9573da594b5761080a [file] [edit]
<!DOCTYPE html>
<title>navigator.install() requires user activation</title>
<link rel="help" href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/WebInstall/explainer.md">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
promise_test(async function(t) {
await promise_rejects_dom(t, 'NotAllowedError', navigator.install(),
'navigator.install() without user activation should reject with ' +
'NotAllowedError');
}, 'navigator.install() rejects with NotAllowedError without a user ' +
'activation.');
promise_test(async function(t) {
await promise_rejects_dom(t, 'NotAllowedError',
navigator.install('https://example.com'),
'navigator.install(url) without user activation should reject with ' +
'NotAllowedError');
}, 'navigator.install(url) rejects with NotAllowedError without a user ' +
'activation.');
promise_test(async function(t) {
await promise_rejects_dom(t, 'NotAllowedError',
navigator.install('https://example.com', 'https://example.com'),
'navigator.install(url, id) without user activation should reject ' +
'with NotAllowedError');
}, 'navigator.install(url, manifest_id) rejects with NotAllowedError ' +
'without a user activation.');
promise_test(async function(t) {
await promise_rejects_dom(t, 'NotAllowedError',
navigator.install({
manifest: 'https://example.com/manifest.json',
}),
'navigator.install({manifest}) without user activation should reject ' +
'with NotAllowedError');
}, 'navigator.install({manifest}) rejects with NotAllowedError without a ' +
'user activation.');
</script>
</body>