Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test finalization for Login Manager</title> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <script type="text/javascript" src="pwmgr_common.js"></script> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 8 | </head> |
michael@0 | 9 | <body> |
michael@0 | 10 | Login Manager test: finalization. |
michael@0 | 11 | <p id="display"></p> |
michael@0 | 12 | <div id="content" style="display: none"> |
michael@0 | 13 | |
michael@0 | 14 | </div> |
michael@0 | 15 | <pre id="test"> |
michael@0 | 16 | <script class="testbody" type="text/javascript"> |
michael@0 | 17 | |
michael@0 | 18 | /** Test for Login Manager: finalization **/ |
michael@0 | 19 | |
michael@0 | 20 | |
michael@0 | 21 | // Get the pwmgr service |
michael@0 | 22 | var Cc_pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]; |
michael@0 | 23 | ok(Cc_pwmgr != null, "Access Cc[@mozilla.org/login-manager;1]"); |
michael@0 | 24 | |
michael@0 | 25 | var Ci_pwmgr = SpecialPowers.Ci.nsILoginManager; |
michael@0 | 26 | ok(Ci_pwmgr != null, "Access Ci.nsILoginManager"); |
michael@0 | 27 | |
michael@0 | 28 | var pwmgr = Cc_pwmgr.getService(Ci_pwmgr); |
michael@0 | 29 | ok(pwmgr != null, "pwmgr getService()"); |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | // Remove all logins, so future test runs start off clean. |
michael@0 | 33 | pwmgr.removeAllLogins(); |
michael@0 | 34 | |
michael@0 | 35 | var logins = pwmgr.getAllLogins(); |
michael@0 | 36 | ok(logins != null, "getAllLogins()"); |
michael@0 | 37 | is(logins.length, 0, "ensure no remaining logins"); |
michael@0 | 38 | |
michael@0 | 39 | // Remove any disabled hosts |
michael@0 | 40 | var disabledHosts = pwmgr.getAllDisabledHosts(); |
michael@0 | 41 | ok(disabledHosts != null, "getAllDisabledHosts()"); |
michael@0 | 42 | disabledHosts.forEach(function(host) pwmgr.setLoginSavingEnabled(host, true)); |
michael@0 | 43 | |
michael@0 | 44 | disabledHosts = pwmgr.getAllDisabledHosts(); |
michael@0 | 45 | ok(disabledHosts != null, "getAllDisabledHosts()"); |
michael@0 | 46 | is(disabledHosts.length, 0, "ensure no remaining disabled hosts"); |
michael@0 | 47 | |
michael@0 | 48 | </script> |
michael@0 | 49 | </pre> |
michael@0 | 50 | </body> |
michael@0 | 51 | </html> |
michael@0 | 52 |