1 // Copyright (c) 2012 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.
11 chrome
.tabs
.create({index
:1, active
:false}, pass(function(tab
) {
13 assertFalse(tab
.active
);
14 assertEq(1, tab
.index
);
16 {windowId
: chrome
.windows
.WINDOW_ID_CURRENT
, index
:0},
18 assertEq(1, tabs
.length
);
19 assertEq(0, tabs
[0].index
);
20 firstTabId
= tabs
[0].id
;
25 function createWithOpener() {
27 {openerTabId
: firstTabId
, active
: true},
29 assertEq(firstTabId
, tab
.openerTabId
);
30 assertTrue(tab
.active
);
31 assertEq(2, tab
.index
);
36 function closeOpener() {
37 chrome
.tabs
.remove(thirdTabId
, pass(function() {
38 chrome
.tabs
.get(firstTabId
, pass(function(tab
) {
39 assertTrue(tab
.active
);
44 function updateOpener() {
45 chrome
.tabs
.create({active
: true}, pass(function(tab1
) {
47 assertTrue(tab1
.active
);
48 assertFalse("openerTabId" in tab1
);
50 tab1
.id
, {openerTabId
: firstTabId
},
52 assertEq(firstTabId
, tab2
.openerTabId
);
57 function closeOpenerAgain() {
58 chrome
.tabs
.remove(thirdTabId
, pass(function() {
59 chrome
.tabs
.get(firstTabId
, pass(function(tab
) {
60 assertTrue(tab
.active
);