Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: ui/file_manager/file_manager/background/js/test_util.js

Issue 331583003: Files.app: Add a test to open a file dialog box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3b8213d3398b45d6145e76e21c4ac0c2cbe701b1 100644
--- a/ui/file_manager/file_manager/background/js/test_util.js
+++ b/ui/file_manager/file_manager/background/js/test_util.js
@@ -53,9 +53,6 @@ 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.
*/
@@ -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]) {
« no previous file with comments | « ui/file_manager/file_manager/background/js/background.js ('k') | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698