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.
5 var normalWindow
, normalTab
;
7 var pass
= chrome
.test
.callbackPass
;
8 var assertEq
= chrome
.test
.assertEq
;
9 var assertTrue
= chrome
.test
.assertTrue
;
11 chrome
.test
.runTests([
12 function getAllWindows() {
13 // The test harness should have set us up with 2 windows: 1 incognito
14 // and 1 regular. We should only see the regular one.
15 chrome
.windows
.getAll({populate
: true}, pass(function(windows
) {
16 assertEq(1, windows
.length
);
17 normalWindow
= windows
[0];
18 assertTrue(!normalWindow
.incognito
);
22 function tabEvents() {
23 chrome
.test
.listenOnce(chrome
.tabs
.onCreated
, function(tab
) {
24 assertTrue(!tab
.incognito
);
27 chrome
.test
.sendMessage("createIncognitoTab", function(response
) {
28 if (response
== "created") {
29 chrome
.tabs
.create({url
: "about:blank"}, pass());