| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 var firstTabId; |
| 6 var firstWindowId; |
| 7 |
| 8 chrome.test.runTests([ |
| 9 function setupWindow() { |
| 10 createWindow([pageUrl("a")], {}, |
| 11 pass(function(winId, tabIds) { |
| 12 firstWindowId = winId; |
| 13 firstTabId = tabIds[0]; |
| 14 })); |
| 15 }, |
| 16 |
| 17 function duplicateTab() { |
| 18 chrome.tabs.duplicate(firstTabId, pass(function(tab) { |
| 19 assertEq(pageUrl("a"), tab.url); |
| 20 assertEq(1, tab.index); |
| 21 })); |
| 22 }, |
| 23 |
| 24 function totalTab() { |
| 25 chrome.tabs.getAllInWindow(firstWindowId, |
| 26 pass(function(tabs) { |
| 27 assertEq(tabs.length, 2); |
| 28 assertEq(tabs[0].url, tabs[1].url); |
| 29 assertEq(tabs[0].index + 1, tabs[1].index); |
| 30 })); |
| 31 } |
| 32 ]); |
| OLD | NEW |