1 var assertEq = chrome.test.assertEq;
3 function pageUrl(letter) {
4 return chrome.extension.getURL(letter + ".html");
7 function onCompleteGetCurrentTab(tab) {
8 assertEq(tab.url, pageUrl("a"));
9 chrome.tabs.remove(tab.id, function() {
10 chrome.test.succeed();
14 chrome.test.runTests([
15 function backgroundPageGetCurrentTab() {
16 chrome.tabs.getCurrent(function(tab) {
17 // There should be no tab.
18 assertEq(tab, undefined);
19 chrome.test.succeed();
23 function openedTabGetCurrentTab() {
24 chrome.tabs.create({url: pageUrl("a")});
25 // Completes with onCompleteGetCurrentTab, which is triggered by
26 // the onload of a.html .