43 let prefBranch =
Cc[
"@mozilla.org/preferences-service;1"].
45 prefBranch.setBoolPref(
"browser.privatebrowsing.keep_current_session",
true);
46 let
pb =
Cc[
"@mozilla.org/privatebrowsing;1"].
48 let consoleService =
Cc[
"@mozilla.org/consoleservice;1"].
50 const kExitMessage =
"Message to signal the end of the test";
53 let consoleObserver = {
55 if (!aMessage.message)
57 else if (aMessage.message == kExitMessage) {
59 ok(this.gotNull,
"Console should be cleared after leaving the private mode");
61 ok(!messageExists(),
"Message should not exist after leaving the private mode");
63 consoleService.unregisterListener(consoleObserver);
64 prefBranch.clearUserPref(
"browser.privatebrowsing.keep_current_session");
70 consoleService.registerListener(consoleObserver);
72 function messageExists() {
74 consoleService.getMessageArray(out, {});
75 let messages = out.value;
79 for (let
i = 0;
i < messages.length; ++
i)
80 if (messages[
i].
message == kTestMessage) {
87 const kTestMessage =
"Test message from the private browsing test";
89 consoleService.logStringMessage(kTestMessage);
90 ok(!consoleObserver.gotNull,
"Console shouldn't be cleared yet");
91 ok(messageExists(),
"Message should exist before leaving the private mode");
93 pb.privateBrowsingEnabled =
true;
94 ok(!consoleObserver.gotNull,
"Console shouldn't be cleared yet");
95 ok(messageExists(),
"Message should exist after entering the private mode");
96 pb.privateBrowsingEnabled =
false;
99 consoleService.logStringMessage(kExitMessage);
getService(Ci.sbIFaceplateManager)
_getSelectedPageStyle s i
sbDeviceFirmwareAutoCheckForUpdate prototype observe