OLD | NEW |
1 // Utility functions to help with tabs/windows testing. | 1 // Utility functions to help with tabs/windows testing. |
2 | 2 |
3 // Creates one window with tabs set to the urls in the array |tabUrls|. | 3 // Creates one window with tabs set to the urls in the array |tabUrls|. |
4 // At least one url must be specified. | 4 // At least one url must be specified. |
5 // The |callback| should look like function(windowId, tabIds) {...}. | 5 // The |callback| should look like function(windowId, tabIds) {...}. |
6 function createWindow(tabUrls, winOptions, callback) { | 6 function createWindow(tabUrls, winOptions, callback) { |
7 winOptions["url"] = tabUrls[0]; | 7 winOptions["url"] = tabUrls[0]; |
8 chrome.windows.create(winOptions, function(win) { | 8 chrome.windows.create(winOptions, function(win) { |
9 assertTrue(win.id > 0); | 9 assertTrue(win.id > 0); |
10 var newTabIds = []; | 10 var newTabIds = []; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 break; | 45 break; |
46 } | 46 } |
47 if (ready) | 47 if (ready) |
48 callback(); | 48 callback(); |
49 else | 49 else |
50 window.setTimeout(waitForTabs, 30); | 50 window.setTimeout(waitForTabs, 30); |
51 }); | 51 }); |
52 } | 52 } |
53 waitForTabs(); | 53 waitForTabs(); |
54 } | 54 } |
55 | |
OLD | NEW |