OLD | NEW |
| 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 |
1 // Utility functions to help with tabs/windows testing. | 5 // Utility functions to help with tabs/windows testing. |
2 | 6 |
3 // Removes current windows and creates one window with tabs set to | 7 // Removes current windows and creates one window with tabs set to |
4 // the urls in the array |tabUrls|. At least one url must be specified. | 8 // the urls in the array |tabUrls|. At least one url must be specified. |
5 // The |callback| should look like function(windowId, tabIds) {...}. | 9 // The |callback| should look like function(windowId, tabIds) {...}. |
6 function setupWindow(tabUrls, callback) { | 10 function setupWindow(tabUrls, callback) { |
7 createWindow(tabUrls, {}, function(winId, tabIds) { | 11 createWindow(tabUrls, {}, function(winId, tabIds) { |
8 // Remove all other windows. | 12 // Remove all other windows. |
9 var removedCount = 0; | 13 var removedCount = 0; |
10 chrome.windows.getAll({}, function(windows) { | 14 chrome.windows.getAll({}, function(windows) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 65 } |
62 if (ready) | 66 if (ready) |
63 callback(); | 67 callback(); |
64 else | 68 else |
65 window.setTimeout(waitForTabs, 30); | 69 window.setTimeout(waitForTabs, 30); |
66 }); | 70 }); |
67 } | 71 } |
68 waitForTabs(); | 72 waitForTabs(); |
69 } | 73 } |
70 | 74 |
OLD | NEW |