michael@0: 'use strict'; michael@0: michael@0: const { Ci } = require('chrome'); michael@0: const { openTab, closeTab } = require('sdk/tabs/utils'); michael@0: const { browserWindows } = require('sdk/windows'); michael@0: const { getOwnerWindow } = require('sdk/private-browsing/window/utils'); michael@0: const { isPrivate } = require('sdk/private-browsing'); michael@0: michael@0: exports.testIsPrivateOnTab = function(assert) { michael@0: let window = browserWindows.activeWindow; michael@0: michael@0: let chromeWindow = getOwnerWindow(window); michael@0: michael@0: assert.ok(chromeWindow instanceof Ci.nsIDOMWindow, 'associated window is found'); michael@0: assert.ok(!isPrivate(chromeWindow), 'the top level window is not private'); michael@0: michael@0: let rawTab = openTab(chromeWindow, 'data:text/html,