1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 openFromNormalShouldOpenInNormal();
8 function openFromNormalShouldOpenInNormal() {
9 nextTest = openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser;
10 chrome.windows.getAll({populate: true}, function(windows) {
11 chrome.test.assertEq(1, windows.length);
12 chrome.test.assertFalse(windows[0].incognito);
13 chrome.test.assertEq(1, windows[0].tabs.length);
14 chrome.test.assertFalse(windows[0].tabs[0].incognito);
16 // The rest of the test continues in infobar.html.
17 chrome.infobars.show({tabId: windows[0].tabs[0].id, path: "infobar.html"});
21 function openFromExtensionHostInIncognitoBrowserShouldOpenInNormalBrowser() {
23 chrome.windows.getCurrent(function(normalWin) {
24 chrome.test.assertFalse(normalWin.incognito);
25 // Create an incognito window.
26 chrome.windows.create({ incognito: true }, function(incognitoWin) {
27 // Remove the normal window. We keep running because of the incognito
29 chrome.windows.remove(normalWin.id, function() {
30 chrome.tabs.getAllInWindow(incognitoWin.id, function(tabs) {
31 chrome.test.assertEq(1, tabs.length);
32 // The rest of the test continues in infobar.html.
33 chrome.infobars.show({tabId: tabs[0].id, path: "infobar.html"});
40 function verifyCreatedTab(tab) {
41 // The new tab should be a normal tab, and it should be in a normal
43 chrome.test.assertFalse(tab.incognito);
44 chrome.windows.get(tab.windowId, function(win) {
45 chrome.test.assertFalse(win.incognito);
49 chrome.test.notifyPass();