test_continue_on_close.html (1605B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Happypath Test</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <script src="head.js"></script> 8 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> 9 <script> 10 SimpleTest.waitForExplicitFinish(); 11 setupTest("continue_on_close").then( 12 function () { 13 SpecialPowers.wrap(document).notifyUserGestureActivation(); 14 return navigator.credentials.get({ 15 identity: { 16 mode: "active", 17 providers: [{ 18 configURL: "https://example.net/tests/dom/credentialmanagement/identity/tests/mochitest/server_manifest.sjs", 19 clientId: "mochitest", 20 nonce: "nonce" 21 }] 22 } 23 }); 24 } 25 ).then(() => { 26 ok(false, "incorrectly got a credential"); 27 }).catch(() => { 28 ok(true, "correctly got an error"); 29 }).finally(() => { 30 async function testStorageAccessPermissionMissing() { 31 ok(await SpecialPowers.testPermission('3rdPartyStorage^https://example.net', SpecialPowers.Ci.nsIPermissionManager.UNKNOWN_ACTION, document), "The popup interacted and should not have given a permission"); 32 } 33 return testStorageAccessPermissionMissing(); 34 }).then(() => { 35 SimpleTest.finish(); 36 }) 37 </script> 38 </head> 39 <body> 40 <p id="display"></p> 41 <div id="content" style="display: none">This is the main happypath test. We get a credential in a way that should work. This includes simplifying some logic like exactly one account and provider.</div> 42 <pre id="test"></pre> 43 </body> 44 </html>