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.
11 chrome.tabs.create({"url": pageUrl("a")}, function(tab) {
14 chrome.tabs.create({"url": pageUrl("b")}, function(tab) {
17 chrome.tabs.create({"url": pageUrl("c")}, function(tab) {
20 chrome.windows.create({"url": pageUrl("xxx")}, pass(function(tab) {}));
23 function testBasicSetup() {
24 chrome.tabs.get(tabIds[0], pass(function(tab) {
25 assertEq(pageUrl("a"), tab.url);
27 chrome.tabs.get(tabIds[1], pass(function(tab) {
28 assertEq(pageUrl("b"), tab.url);
30 chrome.tabs.get(tabIds[2], pass(function(tab) {
31 assertEq(pageUrl("c"), tab.url);
35 function testUpdatingDefaultTabViaUndefined() {
42 {"url": pageUrl(kFooUrl)},
47 assertEq(pageUrl(kFooUrl), tab.url);
53 function testUpdatingDefaultTabViaNull() {
60 {"url": pageUrl(kBarUrl)},
65 assertEq(pageUrl(kBarUrl), tab.url);
71 function testUpdatingWithPermissionReturnsTabInfo() {
73 undefined, {"url": pageUrl("neutrinos")}, pass(function(tab) {
74 assertEq(pageUrl("neutrinos"), tab.url);