OLD | NEW |
1 <script src="tabs_util.js"></script> | 1 <script src="tabs_util.js"></script> |
2 | 2 |
3 <script> | 3 <script> |
4 var testTabId; | 4 var testTabId; |
5 var otherTabId; | 5 var otherTabId; |
6 var firstWindowId; | 6 var firstWindowId; |
7 var secondWindowId; | 7 var secondWindowId; |
8 | 8 |
9 chrome.test.runTests([ | 9 chrome.test.runTests([ |
10 function init() { | 10 function init() { |
11 chrome.tabs.getSelected(null, pass(function(tab) { | 11 chrome.tabs.getSelected(null, pass(function(tab) { |
12 testTabId = tab.id; | 12 testTabId = tab.id; |
13 firstWindowId = tab.windowId; | 13 firstWindowId = tab.windowId; |
14 })); | 14 })); |
15 }, | 15 }, |
16 | 16 |
17 function tabsOnCreated() { | 17 function tabsOnCreated() { |
18 chrome.test.listenOnce(chrome.tabs.onCreated, function(tab) { | 18 chrome.test.listenOnce(chrome.tabs.onCreated, function(tab) { |
19 assertEq(pageUrl("f"), tab.url); | 19 assertEq(pageUrl("f"), tab.url); |
20 otherTabId = tab.id; | 20 otherTabId = tab.id; |
21 // TODO(jstritar): http://crbug.com/59194 tab.selected is always false | 21 assertEq(true, tab.selected); |
22 // when passed into chrome.tabs.onCreated listener | |
23 //assertEq(true, tab.selected); | |
24 }); | 22 }); |
25 | 23 |
26 chrome.tabs.create({"windowId": firstWindowId, "url": pageUrl("f"), | 24 chrome.tabs.create({"windowId": firstWindowId, "url": pageUrl("f"), |
27 "selected": true}, pass(function(tab) {})); | 25 "selected": true}, pass(function(tab) {})); |
28 }, | 26 }, |
29 | 27 |
30 function tabsOnUpdatedIgnoreTabArg() { | 28 function tabsOnUpdatedIgnoreTabArg() { |
31 // A third argument was added to the onUpdated event callback. | 29 // A third argument was added to the onUpdated event callback. |
32 // Test that an event handler which ignores this argument works. | 30 // Test that an event handler which ignores this argument works. |
33 var onUpdatedCompleted = chrome.test.listenForever(chrome.tabs.onUpdated, | 31 var onUpdatedCompleted = chrome.test.listenForever(chrome.tabs.onUpdated, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 }); | 165 }); |
168 chrome.windows.remove(windowB.id); | 166 chrome.windows.remove(windowB.id); |
169 })); | 167 })); |
170 })); | 168 })); |
171 })); | 169 })); |
172 })); | 170 })); |
173 } | 171 } |
174 */ | 172 */ |
175 ]); | 173 ]); |
176 </script> | 174 </script> |
OLD | NEW |