46 var
os =
Cc[
"@mozilla.org/observer-service;1"].
53 do_check_true(
"nsIPrivateBrowsingService" in
Ci);
60 LOG(
"exception thrown when trying to get the service: " + ex);
61 do_throw(
"private browsing service could not be initialized");
65 do_check_false(
pb.privateBrowsingEnabled);
67 do_check_false(
pb.autoStarted);
70 pb.privateBrowsingEnabled =
true;
71 do_check_true(
pb.privateBrowsingEnabled);
72 do_check_false(
pb.autoStarted);
73 pb.privateBrowsingEnabled =
false;
74 do_check_false(
pb.privateBrowsingEnabled);
75 do_check_false(
pb.autoStarted);
86 pb.privateBrowsingEnabled =
true;
88 pb.privateBrowsingEnabled =
false;
98 do_throw(
"Setting privateBrowsingEnabled inside the " +
aData +
99 " notification should throw");
101 if (!(
"result" in ex && ex.result ==
Cr.NS_ERROR_FAILURE))
102 do_throw(
"Unexpected exception caught: " + ex);
108 pb.privateBrowsingEnabled =
true;
109 do_check_true(
pb.privateBrowsingEnabled);
110 pb.privateBrowsingEnabled =
false;
111 do_check_false(
pb.privateBrowsingEnabled);
119 var dummy =
pb.privateBrowsingEnabled;
121 do_check_true(dummy);
123 do_check_false(dummy);
125 do_throw(
"Unexpected exception caught: " + ex);
131 pb.privateBrowsingEnabled =
true;
132 do_check_true(
pb.privateBrowsingEnabled);
133 pb.privateBrowsingEnabled =
false;
134 do_check_false(
pb.privateBrowsingEnabled);
144 this.notifications.push(aTopic +
" " +
aData);
151 pb.privateBrowsingEnabled =
true;
152 do_check_true(
pb.privateBrowsingEnabled);
153 pb.privateBrowsingEnabled =
false;
154 do_check_false(
pb.privateBrowsingEnabled);
157 var reference_order = [
163 do_check_eq(observer.notifications.join(
","), reference_order.join(
","));
171 do_check_neq(aSubject,
null);
173 aSubject.QueryInterface(Ci.nsISupportsPRBool);
176 " should implement nsISupportsPRBool");
178 do_check_false(aSubject.data);
179 aSubject.data =
true;
183 this.notifications.push(aTopic +
" " +
aData);
186 nextPhase:
function() {
187 this.notifications.push(
"enter phase " + (++this._phase));
194 pb.privateBrowsingEnabled =
true;
195 do_check_false(
pb.privateBrowsingEnabled);
198 observer.nextPhase();
199 pb.privateBrowsingEnabled =
true;
200 do_check_true(
pb.privateBrowsingEnabled);
203 pb.privateBrowsingEnabled =
false;
204 do_check_true(
pb.privateBrowsingEnabled);
206 observer.nextPhase();
207 pb.privateBrowsingEnabled =
false;
208 do_check_false(
pb.privateBrowsingEnabled);
218 do_check_eq(observer.notifications.join(
","), reference_order.join(
","));
224 this.notifications.push(aTopic +
" " +
aData);
230 pb.privateBrowsingEnabled =
true;
231 pb.privateBrowsingEnabled =
false;
238 kPrivateBrowsingTransitionCompleteNotification +
" ",
240 do_check_eq(observer.notifications.join(
","), reference_order.join(
","));
do_check_eq(typeof PlacesUtils,"object")
const kPrivateBrowsingCancelVoteNotification
const kPrivateBrowsingTransitionCompleteNotification
getService(Ci.sbIFaceplateManager)
const kPrivateBrowsingNotification
function run_test_on_all_services()
var PRIVATEBROWSING_CONTRACT_ID
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe
function run_test_on_service()