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.
1 /* vim: set ts=2 et sw=2 tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 "use strict";
8 function test() {
9 runTests();
10 }
12 gTests.push({
13 desc: "Private tab sanity check",
14 run: function() {
15 let tab = Browser.addTab("about:mozilla");
16 is(tab.isPrivate, false, "Tabs are not private by default");
17 is(tab.chromeTab.hasAttribute("private"), false,
18 "non-private tab has no private attribute");
20 let child = Browser.addTab("about:mozilla", false, tab);
21 is(child.isPrivate, false, "Child of a non-private tab is not private");
23 Browser.closeTab(child, { forceClose: true });
24 Browser.closeTab(tab, { forceClose: true });
26 tab = Browser.addTab("about:mozilla", false, null, { private: true });
27 is(tab.isPrivate, true, "Create a private tab");
28 is(tab.chromeTab.getAttribute("private"), "true",
29 "private tab has private attribute");
31 child = Browser.addTab("about:mozilla", false, tab);
32 is(child.isPrivate, true, "Child of a private tab is private");
34 Browser.closeTab(child, { forceClose: true });
35 Browser.closeTab(tab, { forceClose: true });
36 }
37 });