Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Happypath Test</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="head.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
SimpleTest.waitForExplicitFinish();
setupTest("continue_on_override").then(
function () {
SpecialPowers.wrap(document).notifyUserGestureActivation();
return navigator.credentials.get({
identity: {
mode: "active",
providers: [{
clientId: "mochitest",
nonce: "nonce"
}]
}
});
}
).then((cred) => {
ok(true, "successfully got a credential");
is(cred.token,
"result_from_inside_continue",
"Correct token on the credential.");
is(cred.id,
"override_id",
"Correct id on the credential- overridden by the continue on");
is(cred.type,
"identity",
"Correct type on the credential");
}).catch(() => {
ok(false, "must not have an error");
}).finally(() => {
async function testStorageAccessPermissionMissing() {
ok(await SpecialPowers.testPermission('3rdPartyStorage^https://example.net', SpecialPowers.Ci.nsIPermissionManager.UNKNOWN_ACTION, document), "The popup interacted and should not have given a permission");
}
return testStorageAccessPermissionMissing();
}).then(() => {
SimpleTest.finish();
})
</script>
</head>
<body>
<p id="display"></p>
<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>
<pre id="test"></pre>
</body>
</html>