Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 });