test_empty_provider_list.html (1047B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Empty Provider List</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("empty_provider_list") 12 .then( 13 function () { 14 SpecialPowers.wrap(document).notifyUserGestureActivation(); 15 return navigator.credentials.get({ 16 identity: { 17 providers: [] 18 } 19 }); 20 } 21 ).then((x) => { 22 if (!x) { 23 ok(true, "correctly got null"); 24 return; 25 } 26 ok(false, "incorrectly got a credential"); 27 }).catch(() => { 28 ok(true, "correctly got an error"); 29 }).finally(() => { 30 SimpleTest.finish(); 31 }) 32 </script> 33 </head> 34 <body> 35 <p id="display"></p> 36 <div id="content" style="display: none">This test verifies that we do not get a credential when we give no providers to support.</div> 37 <pre id="test"></pre> 38 </body> 39 </html>