Bug 788829 - Call SetSizeConstraints even if a popup is not open. r=enndeakin
[gecko.git] / dom / identity / tests / test_identity_idp_auth_basics.html
blob517c9b1bbb8df767c5e6e2c97fc148dba52b56e7
1 <!DOCTYPE html>
2 <!-- Any copyright is dedicated to the Public Domain.
3 - http://creativecommons.org/publicdomain/zero/1.0/ -->
4 <html>
5 <head>
6 <meta charset="utf-8">
7 <title>Test for navigator.id identity provider (IDP) authentication basics</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="application/javascript;version=1.8" src="head_identity.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank">navigator.id identity provider (IDP) authentication basics</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
17 </div>
18 <pre id="test">
19 <script type="application/javascript;version=1.8">
21 "use strict"
23 let steps = [
24 // completeAuthentication tests
25 function completeAuthenticationExists() {
26 is(typeof(identity.completeAuthentication), "function",
27 "Check completeAuthentication is a function");
28 SimpleTest.executeSoon(next);
30 function completeAuthenticationOutsideFlow() {
31 expectException(function() {
32 identity.completeAuthentication();
33 }, "Check completeAuthentication outside of an auth. flow");
34 SimpleTest.executeSoon(next);
37 // raiseAuthenticationFailure tests
38 function raiseAuthenticationFailureExists() {
39 is(typeof(identity.raiseAuthenticationFailure), "function",
40 "Check raiseAuthenticationFailure is a function");
41 SimpleTest.executeSoon(next);
43 function raiseAuthenticationFailureNoArgs() {
44 expectException(function() {
45 identity.raiseAuthenticationFailure();
46 }, "raiseAuthenticationFailure with no arguments");
47 SimpleTest.executeSoon(next);
50 // beginAuthentication tests
51 function beginAuthenticationExists() {
52 is(typeof(identity.beginAuthentication), "function",
53 "Check beginAuthentication is a function");
54 SimpleTest.executeSoon(next);
56 function beginAuthenticationNoArgs() {
57 expectException(function() {
58 identity.beginAuthentication();
59 }, "beginAuthentication with no arguments");
60 SimpleTest.executeSoon(next);
62 function beginAuthenticationInvalidArg() {
63 expectException(function() {
64 identity.beginAuthentication(999);
65 }, "beginAuthentication with a non-function argument");
66 SimpleTest.executeSoon(next);
68 function beginAuthenticationArgs() {
69 function beginAuthenticationCb() {
70 throw "beginAuthentication callback shouldn't have been called outside of an "
71 + "auth flow";
73 is(identity.beginAuthentication(beginAuthenticationCb), undefined,
74 "Check minimum beginAuthentication arguments");
75 SimpleTest.executeSoon(next);
78 finish_tests,
81 SimpleTest.waitForExplicitFinish();
82 addLoadEvent(next);
84 </script>
85 </pre>
86 </body>
87 </html>