Chromium Code Reviews| Index: ui/file_manager/file_manager/background/js/test_util.js |
| diff --git a/ui/file_manager/file_manager/background/js/test_util.js b/ui/file_manager/file_manager/background/js/test_util.js |
| index 9d5e7ed2ddb7f695d02f0274c0e160f7f7a9c527..e1bc7a922367a202ac1c433efaf4c9fd019a21fd 100644 |
| --- a/ui/file_manager/file_manager/background/js/test_util.js |
| +++ b/ui/file_manager/file_manager/background/js/test_util.js |
| @@ -53,13 +53,10 @@ test.util.async.openMainWindow = function(appState, callback) { |
| /** |
| * Obtains window information. |
| * |
| - * @param {string} appIdPrefix ID prefix of the requested window. |
| - * @param {function(Array.<{innerWidth:number, innerHeight:number}>)} callback |
| - * Completion callback with the window information. |
| * @return {Object.<string, {innerWidth:number, innerHeight:number}>} Map window |
| * ID and window information. |
| */ |
| -test.util.sync.getWindows = function() { |
| +test.util.sync.getWindows = function(callback) { |
|
fukino
2014/06/17 05:59:10
nit: |callback| unused
hirono
2014/06/17 07:07:14
Done.
|
| var windows = {}; |
| for (var id in background.appWindows) { |
| var windowWrapper = background.appWindows[id]; |
| @@ -68,6 +65,12 @@ test.util.sync.getWindows = function() { |
| innerHeight: windowWrapper.contentWindow.innerHeight |
| }; |
| } |
| + for (var id in background.dialogs) { |
| + windows[id] = { |
| + innerWidth: background.dialogs[id].innerWidth, |
| + innerHeight: background.dialogs[id].innerHeight |
| + }; |
| + } |
| return windows; |
| }; |
| @@ -684,11 +687,14 @@ test.util.registerRemoteTestUtils = function() { |
| // Prepare arguments. |
| var args = request.args.slice(); // shallow copy |
| if (request.appId) { |
| - if (!background.appWindows[request.appId]) { |
| + if (background.appWindows[request.appId]) { |
| + args.unshift(background.appWindows[request.appId].contentWindow); |
| + } else if (background.dialogs[request.appId]) { |
| + args.unshift(background.dialogs[request.appId]); |
| + } else { |
| console.error('Specified window not found: ' + request.appId); |
| return false; |
| } |
| - args.unshift(background.appWindows[request.appId].contentWindow); |
| } |
| // Call the test utility function and respond the result. |
| if (test.util.async[request.func]) { |