michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: function test() { michael@0: runTests(); michael@0: } michael@0: michael@0: gTests.push({ michael@0: desc: "Private tab sanity check", michael@0: run: function() { michael@0: let tab = Browser.addTab("about:mozilla"); michael@0: is(tab.isPrivate, false, "Tabs are not private by default"); michael@0: is(tab.chromeTab.hasAttribute("private"), false, michael@0: "non-private tab has no private attribute"); michael@0: michael@0: let child = Browser.addTab("about:mozilla", false, tab); michael@0: is(child.isPrivate, false, "Child of a non-private tab is not private"); michael@0: michael@0: Browser.closeTab(child, { forceClose: true }); michael@0: Browser.closeTab(tab, { forceClose: true }); michael@0: michael@0: tab = Browser.addTab("about:mozilla", false, null, { private: true }); michael@0: is(tab.isPrivate, true, "Create a private tab"); michael@0: is(tab.chromeTab.getAttribute("private"), "true", michael@0: "private tab has private attribute"); michael@0: michael@0: child = Browser.addTab("about:mozilla", false, tab); michael@0: is(child.isPrivate, true, "Child of a private tab is private"); michael@0: michael@0: Browser.closeTab(child, { forceClose: true }); michael@0: Browser.closeTab(tab, { forceClose: true }); michael@0: } michael@0: });