45 var am =
Cc[
"@mozilla.org/network/http-auth-manager;1"].
48 const kHost1 =
"pbtest3.example.com";
49 const kHost2 =
"pbtest4.example.com";
52 const kBasic =
"basic";
53 const kRealm =
"realm";
54 const kDomain =
"example.com";
56 const kUser2 =
"user2";
57 const kPassword =
"pass";
58 const kPassword2 =
"pass2";
62 var domain = {
value: kEmpty}, user = {
value: kEmpty}, pass = {
value: kEmpty};
64 am.setAuthIdentity(kHTTP, kHost1, kPort, kBasic, kRealm, kEmpty, kDomain, kUser, kPassword);
66 am.getAuthIdentity(kHTTP, kHost1, kPort, kBasic, kRealm, kEmpty, domain, user, pass);
71 pb.privateBrowsingEnabled =
true;
73 domain = {
value: kEmpty}, user = {
value: kEmpty}, pass = {
value: kEmpty};
76 am.getAuthIdentity(kHTTP, kHost1, kPort, kBasic, kRealm, kEmpty, domain, user, pass);
77 do_throw(
"Auth entry should not be retrievable after entering the private browsing mode");
85 am.setAuthIdentity(kHTTP, kHost2, kPort, kBasic, kRealm, kEmpty, kDomain, kUser2, kPassword2);
87 domain = {
value: kEmpty}, user = {
value: kEmpty}, pass = {
value: kEmpty};
88 am.getAuthIdentity(kHTTP, kHost2, kPort, kBasic, kRealm, kEmpty, domain, user, pass);
93 pb.privateBrowsingEnabled =
false;
95 domain = {
value: kEmpty}, user = {
value: kEmpty}, pass = {
value: kEmpty};
98 am.getAuthIdentity(kHTTP, kHost2, kPort, kBasic, kRealm, kEmpty, domain, user, pass);
99 do_throw(
"Auth entry should not be retrievable after exiting the private browsing mode");
106 do_throw(
"Unexpected exception while testing HTTP auth manager: " + e);
do_check_eq(typeof PlacesUtils,"object")
function run_test_on_service()
getService(Ci.sbIFaceplateManager)
function run_test_on_all_services()
var PRIVATEBROWSING_CONTRACT_ID