summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoryoshiki <yoshiki@chromium.org>2015-07-14 00:23:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 07:24:12 +0000
commit24e059983824b17c8be9dfcff460bf2880dfcad5 (patch)
tree3f024d311eb127b652e8904bcdbafc144bc1afb8 /ui
parent307e8e6d8baf09fe147f3f47696f50c1449bf4e5 (diff)
downloadchromium_src-24e059983824b17c8be9dfcff460bf2880dfcad5.zip
chromium_src-24e059983824b17c8be9dfcff460bf2880dfcad5.tar.gz
chromium_src-24e059983824b17c8be9dfcff460bf2880dfcad5.tar.bz2
Use promise in StepsRunner
BUG=none TEST=browser_test passes Review URL: https://codereview.chromium.org/1216053008 Cr-Commit-Position: refs/heads/master@{#338652}
Diffstat (limited to 'ui')
-rw-r--r--ui/file_manager/integration_tests/file_manager/background.js47
-rw-r--r--ui/file_manager/integration_tests/file_manager/create_new_folder.js12
-rw-r--r--ui/file_manager/integration_tests/file_manager/drive_specific.js19
-rw-r--r--ui/file_manager/integration_tests/file_manager/file_display.js18
-rw-r--r--ui/file_manager/integration_tests/file_manager/grid_view.js6
-rw-r--r--ui/file_manager/integration_tests/file_manager/keyboard_operations.js27
-rw-r--r--ui/file_manager/integration_tests/file_manager/open_audio_files.js24
-rw-r--r--ui/file_manager/integration_tests/file_manager/open_image_files.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/open_video_files.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/providers.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/restore_geometry.js8
-rw-r--r--ui/file_manager/integration_tests/file_manager/restore_prefs.js12
-rw-r--r--ui/file_manager/integration_tests/file_manager/share_dialog.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/sort_columns.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/suggest_app_dialog.js4
-rw-r--r--ui/file_manager/integration_tests/file_manager/tab_index.js16
-rw-r--r--ui/file_manager/integration_tests/file_manager/tasks.js6
-rw-r--r--ui/file_manager/integration_tests/file_manager/transfer.js4
18 files changed, 114 insertions, 109 deletions
diff --git a/ui/file_manager/integration_tests/file_manager/background.js b/ui/file_manager/integration_tests/file_manager/background.js
index ba92401..d8d8797 100644
--- a/ui/file_manager/integration_tests/file_manager/background.js
+++ b/ui/file_manager/integration_tests/file_manager/background.js
@@ -56,20 +56,21 @@ function testPromise(promise) {
*/
function StepsRunner() {
/**
- * List of steps.
- * @type {Array<function>}
+ * Function to notify the end of the current closure.
+ * @type {?function}
* @private
*/
- this.steps_ = [];
+ this.next_ = null;
}
/**
* Creates a StepsRunner instance and runs the passed steps.
* @param {!Array<function>} steps
+ * @return {Promise} Promise to be fulfilled after test finishes.
*/
StepsRunner.run = function(steps) {
var stepsRunner = new StepsRunner();
- stepsRunner.run_(steps);
+ return stepsRunner.run_(steps);
};
/**
@@ -83,35 +84,33 @@ StepsRunner.runGroups = function(groups) {
StepsRunner.prototype = {
/**
- * @return {function} The next closure.
+ * @return {?function} The next closure.
*/
get next() {
- return this.steps_[0];
+ var next = this.next_;
+ this.next_ = null;
+ return next;
}
};
/**
* Runs a sequence of the added test steps.
* @type {Array<function>} List of the sequential steps.
+ * @return {Promise} Promise to be fulfilled after test finishes.
*/
StepsRunner.prototype.run_ = function(steps) {
- this.steps_ = steps.slice(0);
-
- // An extra step which acts as an empty callback for optional asynchronous
- // calls in the last provided step.
- this.steps_.push(function() {});
-
- this.steps_ = this.steps_.map(function(f) {
- return chrome.test.callbackPass(function() {
- var args = arguments;
+ return steps.reduce(function(previousPromise, currentClosure) {
+ return previousPromise.then(function(arg) {
return new Promise(function(resolve, reject) {
- this.steps_.shift();
- f.apply(this, args);
+ this.next_ = resolve;
+ currentClosure.apply(this, [arg]);
}.bind(this));
}.bind(this));
- }.bind(this));
-
- this.next();
+ }.bind(this), Promise.resolve())
+ // Adds the last closure to notify the completion of the run.
+ .then(chrome.test.callbackPass(function() {
+ return true;
+ }));
};
/**
@@ -300,7 +299,8 @@ function openAndWaitForClosingDialog(
* directory during initialization. Can be null, for no default path.
* @param {function(string, Array<Array<string>>)=} opt_callback Callback with
* the window ID and with the file list.
- * @return {Promise} Promise to be fulfilled with window ID.
+ * @return {Promise} Promise to be fulfilled with the result object, which
+ * coutnains the window ID and the file list.
*/
function setupAndWaitUntilReady(appState, initialRoot, opt_callback) {
var windowPromise = openNewWindow(appState, initialRoot);
@@ -323,9 +323,10 @@ function setupAndWaitUntilReady(appState, initialRoot, opt_callback) {
driveEntriesPromise,
detailedTablePromise
]).then(function(results) {
+ var result = {windowId: results[0], fileList: results[3]};
if (opt_callback)
- opt_callback(results[0], results[3]);
- return results[0];
+ opt_callback(result);
+ return result;
}).catch(function(e) {
chrome.test.fail(e.stack || e);
});
diff --git a/ui/file_manager/integration_tests/file_manager/create_new_folder.js b/ui/file_manager/integration_tests/file_manager/create_new_folder.js
index 499c50f..812677b 100644
--- a/ui/file_manager/integration_tests/file_manager/create_new_folder.js
+++ b/ui/file_manager/integration_tests/file_manager/create_new_folder.js
@@ -164,8 +164,8 @@ testcase.createNewFolderAfterSelectFile = function() {
var windowId = null;
var promise = new Promise(function(callback) {
setupAndWaitUntilReady(null, PATH, callback);
- }).then(function(inWindowId) {
- windowId = inWindowId;
+ }).then(function(results) {
+ windowId = results.windowId;
return selectFirstListItem(windowId);
}).then(function() {
return expandRoot(windowId, TREEITEM_DOWNLOADS);
@@ -183,8 +183,8 @@ testcase.createNewFolderDownloads = function() {
var windowId = null;
var promise = new Promise(function(callback) {
setupAndWaitUntilReady(null, PATH, callback);
- }).then(function(inWindowId) {
- windowId = inWindowId
+ }).then(function(results) {
+ windowId = results.windowId;
return expandRoot(windowId, TREEITEM_DOWNLOADS);
}).then(function() {
return remoteCall.waitForElement(windowId, '#detail-table')
@@ -200,8 +200,8 @@ testcase.createNewFolderDrive = function() {
var windowId = null;
var promise = new Promise(function(callback) {
setupAndWaitUntilReady(null, PATH, callback);
- }).then(function(inWindowId) {
- windowId = inWindowId
+ }).then(function(results) {
+ windowId = results.windowId
return expandRoot(windowId, TREEITEM_DRIVE);
}).then(function() {
return remoteCall.waitForElement(windowId, '#detail-table')
diff --git a/ui/file_manager/integration_tests/file_manager/drive_specific.js b/ui/file_manager/integration_tests/file_manager/drive_specific.js
index 78a7a74..59427b1 100644
--- a/ui/file_manager/integration_tests/file_manager/drive_specific.js
+++ b/ui/file_manager/integration_tests/file_manager/drive_specific.js
@@ -36,8 +36,8 @@ function getStepsForSearchResultsAutoComplete() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Focus the search box.
- function(inAppId, list) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil('fakeEvent',
appId,
['#search-box input', 'focus'],
@@ -99,8 +99,8 @@ testcase.openSidebarRecent = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Click the icon of the Recent volume.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'selectVolume', appId, ['drive_recent'], this.next);
},
@@ -133,8 +133,8 @@ testcase.openSidebarOffline = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Click the icon of the Offline volume.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'selectVolume', appId, ['drive_offline'], this.next);
},
@@ -166,8 +166,8 @@ testcase.openSidebarSharedWithMe = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Click the icon of the Shared With Me volume.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Use the icon for a click target.
remoteCall.callRemoteTestUtil('selectVolume',
appId,
@@ -282,7 +282,8 @@ testcase.pressEnterToSearch = function() {
*/
testcase.pinFileOnMobileNetwork = function() {
testPromise(setupAndWaitUntilReady(null, RootPath.DRIVE).then(
- function(windowId) {
+ function(results) {
+ var windowId = results.windowId;
return sendTestMessage(
{name: 'useCellularNetwork'}).then(function(result) {
return remoteCall.callRemoteTestUtil(
diff --git a/ui/file_manager/integration_tests/file_manager/file_display.js b/ui/file_manager/integration_tests/file_manager/file_display.js
index d122daf..93a127a 100644
--- a/ui/file_manager/integration_tests/file_manager/file_display.js
+++ b/ui/file_manager/integration_tests/file_manager/file_display.js
@@ -26,8 +26,9 @@ function fileDisplay(path) {
},
// Notify that the list has been verified and a new file can be added
// in file_manager_browsertest.cc.
- function(inAppId, actualFilesBefore) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
+ var actualFilesBefore = results.fileList;
chrome.test.assertEq(expectedFilesBefore, actualFilesBefore);
addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
},
@@ -62,8 +63,8 @@ testcase.fileDisplayMtp = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Mount a fake MTP volume.
- function(inAppId, files) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
chrome.test.sendMessage(JSON.stringify({name: 'mountFakeMtp'}),
this.next);
},
@@ -105,8 +106,8 @@ function searchDownloads(searchTerm, expectedResults) {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Focus the search box.
- function(inAppId, list) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil('fakeEvent',
appId,
['#search-box input', 'focus'],
@@ -163,9 +164,8 @@ testcase.searchNotFound = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Focus the search box.
- function(inAppId, list) {
- appId = inAppId;
- console.log(list);
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil('fakeEvent',
appId,
['#search-box input', 'focus'],
diff --git a/ui/file_manager/integration_tests/file_manager/grid_view.js b/ui/file_manager/integration_tests/file_manager/grid_view.js
index bebe8c2..9b0f72d 100644
--- a/ui/file_manager/integration_tests/file_manager/grid_view.js
+++ b/ui/file_manager/integration_tests/file_manager/grid_view.js
@@ -19,9 +19,11 @@ function showGridView(rootPath, expectedSet) {
return entryInfo.nameText;
}).sort();
var setupPromise = setupAndWaitUntilReady(null, rootPath);
- return setupPromise.then(function(windowId) {
+ return setupPromise.then(function(results) {
+ var windowId = results.windowId;
// Click the grid view button.
- var clickedPromise = remoteCall.waitForElement(windowId, '#view-button').
+ var clickedPromise = remoteCall.waitForElement(windowId,
+ '#view-button').
then(function() {
return remoteCall.callRemoteTestUtil(
'fakeEvent', windowId, ['#view-button', 'click']);
diff --git a/ui/file_manager/integration_tests/file_manager/keyboard_operations.js b/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
index b867cfa..f6df025 100644
--- a/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
+++ b/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
@@ -48,17 +48,17 @@ function keyboardCopy(path, callback) {
var expectedFilesAfter =
expectedFilesBefore.concat([['world (1).ogv', '59 KB', 'OGG video']]);
- var appId, fileListBefore;
+ var appId;
StepsRunner.run([
// Set up File Manager.
function() {
setupAndWaitUntilReady(null, path, this.next);
},
// Copy the file.
- function(inAppId, inFileListBefore) {
- appId = inAppId;
- fileListBefore = inFileListBefore;
- chrome.test.assertEq(expectedFilesBefore, inFileListBefore);
+ function(results) {
+ appId = results.windowId;
+ var fileListBefore = results.fileList;
+ chrome.test.assertEq(expectedFilesBefore, fileListBefore);
remoteCall.callRemoteTestUtil('copyFile', appId, [filename], this.next);
},
// Wait for a file list change.
@@ -99,9 +99,9 @@ function keyboardDelete(path, treeItem) {
setupAndWaitUntilReady(null, path, this.next);
},
// Delete the file.
- function(inAppId, inFileListBefore) {
- appId = inAppId;
- fileListBefore = inFileListBefore;
+ function(results) {
+ appId = results.windowId;
+ fileListBefore = results.fileList;
chrome.test.assertTrue(isFilePresent(filename, fileListBefore));
this.next();
},
@@ -199,10 +199,11 @@ function testRenameNewDirectory(path, initialEntrySet, pathInBreadcrumb) {
return new Promise(function(resolve) {
setupAndWaitUntilReady(null, path, resolve);
- }).then(function(windowId) {
+ }).then(function(results) {
+ var windowId = results.windowId;
return remoteCall.waitForFiles(windowId, expectedRows).then(function() {
- return remoteCall.fakeKeyDown(windowId, '#list-container', 'U+0045',
- true);
+ return remoteCall.fakeKeyDown(
+ windowId, '#list-container', 'U+0045', true);
}).then(function() {
// Wait for rename text field.
return remoteCall.waitForElement(windowId, 'input.rename');
@@ -261,8 +262,8 @@ function testRenameFile(path, initialEntrySet) {
// Open a window.
return new Promise(function(callback) {
setupAndWaitUntilReady(null, path, callback);
- }).then(function(inWindowId) {
- windowId = inWindowId;
+ }).then(function(results) {
+ windowId = results.windowId;
return remoteCall.waitForFiles(windowId, initialExpectedEntryRows);
}).then(function(){
return renameFile(windowId, 'hello.txt', 'New File Name.txt');
diff --git a/ui/file_manager/integration_tests/file_manager/open_audio_files.js b/ui/file_manager/integration_tests/file_manager/open_audio_files.js
index 73b6971..3a3c4c6 100644
--- a/ui/file_manager/integration_tests/file_manager/open_audio_files.js
+++ b/ui/file_manager/integration_tests/file_manager/open_audio_files.js
@@ -51,8 +51,8 @@ function audioOpen(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Add an additional audio file.
addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
@@ -170,8 +170,8 @@ function audioAutoAdvance(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Add an additional audio file.
addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
@@ -241,8 +241,8 @@ function audioRepeatSingleFile(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'openFile', appId, ['Beautiful Song.ogg'], this.next);
@@ -309,8 +309,8 @@ function audioNoRepeatSingleFile(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'openFile', appId, ['Beautiful Song.ogg'], this.next);
@@ -369,8 +369,8 @@ function audioRepeatMultipleFile(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Add an additional audio file.
addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
@@ -454,8 +454,8 @@ function audioNoRepeatMultipleFile(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Add an additional audio file.
addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
diff --git a/ui/file_manager/integration_tests/file_manager/open_image_files.js b/ui/file_manager/integration_tests/file_manager/open_image_files.js
index f02b3fa..96d2cb4 100644
--- a/ui/file_manager/integration_tests/file_manager/open_image_files.js
+++ b/ui/file_manager/integration_tests/file_manager/open_image_files.js
@@ -27,8 +27,8 @@ function imageOpen(path) {
setupAndWaitUntilReady(null, path, this.next);
},
// Select the song.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Add an additional image file.
addEntries(['local', 'drive'], [ENTRIES.image3], this.next);
diff --git a/ui/file_manager/integration_tests/file_manager/open_video_files.js b/ui/file_manager/integration_tests/file_manager/open_video_files.js
index af87a1e..492f36b 100644
--- a/ui/file_manager/integration_tests/file_manager/open_video_files.js
+++ b/ui/file_manager/integration_tests/file_manager/open_video_files.js
@@ -36,8 +36,8 @@ function videoOpen(path) {
function() {
setupAndWaitUntilReady(null, path, this.next);
},
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
// Select the song.
remoteCall.callRemoteTestUtil(
'openFile', appId, ['world.ogv'], this.next);
diff --git a/ui/file_manager/integration_tests/file_manager/providers.js b/ui/file_manager/integration_tests/file_manager/providers.js
index be94f37..04b8c26 100644
--- a/ui/file_manager/integration_tests/file_manager/providers.js
+++ b/ui/file_manager/integration_tests/file_manager/providers.js
@@ -24,8 +24,8 @@ function getSetupSteps(manifest) {
}));
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
this.next();
}
];
diff --git a/ui/file_manager/integration_tests/file_manager/restore_geometry.js b/ui/file_manager/integration_tests/file_manager/restore_geometry.js
index b3cc248..fd53f15 100644
--- a/ui/file_manager/integration_tests/file_manager/restore_geometry.js
+++ b/ui/file_manager/integration_tests/file_manager/restore_geometry.js
@@ -16,8 +16,8 @@ testcase.restoreGeometry = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Resize the window to minimal dimensions.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'resizeWindow', appId, [640, 480], this.next);
},
@@ -39,8 +39,8 @@ testcase.restoreGeometry = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Check the next window's size.
- function(inAppId) {
- appId2 = inAppId;
+ function(results) {
+ appId2 = results.windowId;
remoteCall.waitForWindowGeometry(appId2, 650, 490).then(this.next);
},
// Check for errors.
diff --git a/ui/file_manager/integration_tests/file_manager/restore_prefs.js b/ui/file_manager/integration_tests/file_manager/restore_prefs.js
index 7a473f5..dc013fb 100644
--- a/ui/file_manager/integration_tests/file_manager/restore_prefs.js
+++ b/ui/file_manager/integration_tests/file_manager/restore_prefs.js
@@ -22,8 +22,8 @@ testcase.restoreSortColumn = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Sort by name.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil('fakeMouseClick',
appId,
['.table-header-cell:nth-of-type(1)'],
@@ -56,8 +56,8 @@ testcase.restoreSortColumn = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Check the sorted style of the header.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.waitForElement(appId, '.table-header-sort-image-desc').
then(this.next);
},
@@ -84,8 +84,8 @@ testcase.restoreCurrentView = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Check the initial view.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.waitForElement(appId, '.thumbnail-grid[hidden]').
then(this.next);
},
diff --git a/ui/file_manager/integration_tests/file_manager/share_dialog.js b/ui/file_manager/integration_tests/file_manager/share_dialog.js
index 68a7c78..0ac284a 100644
--- a/ui/file_manager/integration_tests/file_manager/share_dialog.js
+++ b/ui/file_manager/integration_tests/file_manager/share_dialog.js
@@ -16,8 +16,8 @@ function share(path) {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Select the source file.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'selectFile', appId, [path], this.next);
},
diff --git a/ui/file_manager/integration_tests/file_manager/sort_columns.js b/ui/file_manager/integration_tests/file_manager/sort_columns.js
index 9a0ecb1..e6bcd14 100644
--- a/ui/file_manager/integration_tests/file_manager/sort_columns.js
+++ b/ui/file_manager/integration_tests/file_manager/sort_columns.js
@@ -79,8 +79,8 @@ testcase.sortColumns = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Click the 'Name' column header and check the list.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil('fakeMouseClick',
appId,
['.table-header-cell:nth-of-type(1)'],
diff --git a/ui/file_manager/integration_tests/file_manager/suggest_app_dialog.js b/ui/file_manager/integration_tests/file_manager/suggest_app_dialog.js
index bb575229..56848fc 100644
--- a/ui/file_manager/integration_tests/file_manager/suggest_app_dialog.js
+++ b/ui/file_manager/integration_tests/file_manager/suggest_app_dialog.js
@@ -28,8 +28,8 @@ testcase.suggestAppDialog = function() {
};
setupAndWaitUntilReady(appState, RootPath.DRIVE, this.next);
},
- function(inAppId, inFileListBefore) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'selectFile', appId, ['unsupported.foo'], this.next);
diff --git a/ui/file_manager/integration_tests/file_manager/tab_index.js b/ui/file_manager/integration_tests/file_manager/tab_index.js
index cd7f8c5..7ce78e5 100644
--- a/ui/file_manager/integration_tests/file_manager/tab_index.js
+++ b/ui/file_manager/integration_tests/file_manager/tab_index.js
@@ -15,8 +15,8 @@ testcase.searchBoxFocus = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Check that the file list has the focus on launch.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.waitForElement(appId, ['#file-list:focus']).then(this.next);
},
// Press the Ctrl-F key.
@@ -62,8 +62,8 @@ testcase.tabindexFocus = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Check that the file list has the focus on launch.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.waitForElement(appId, ['#file-list:focus']).then(this.next);
},
function(element) {
@@ -112,8 +112,8 @@ testcase.tabindexFocusDownloads = function() {
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Check that the file list has the focus on launch.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.waitForElement(appId, ['#file-list:focus']).then(this.next);
},
// Press the Tab key.
@@ -155,8 +155,8 @@ testcase.tabindexFocusDirectorySelected = function() {
setupAndWaitUntilReady(null, RootPath.DRIVE, this.next);
},
// Check that the file list has the focus on launch.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
Promise.all([
remoteCall.waitForElement(appId, ['#file-list:focus']),
remoteCall.waitForElement(appId, ['#drive-welcome-link']),
diff --git a/ui/file_manager/integration_tests/file_manager/tasks.js b/ui/file_manager/integration_tests/file_manager/tasks.js
index f7e37eb..096101c 100644
--- a/ui/file_manager/integration_tests/file_manager/tasks.js
+++ b/ui/file_manager/integration_tests/file_manager/tasks.js
@@ -53,12 +53,12 @@ var DRIVE_FAKE_TASKS = [
* @param {Array<FakeTask>} fakeTasks Fake tasks.
*/
function setupTaskTest(rootPath, fakeTasks) {
- return setupAndWaitUntilReady(null, rootPath).then(function(windowId) {
+ return setupAndWaitUntilReady(null, rootPath).then(function(results) {
return remoteCall.callRemoteTestUtil(
'overrideTasks',
- windowId,
+ results.windowId,
[fakeTasks]).then(function() {
- return windowId;
+ return results.windowId;
});
});
}
diff --git a/ui/file_manager/integration_tests/file_manager/transfer.js b/ui/file_manager/integration_tests/file_manager/transfer.js
index 8ff4456..79cb6c8 100644
--- a/ui/file_manager/integration_tests/file_manager/transfer.js
+++ b/ui/file_manager/integration_tests/file_manager/transfer.js
@@ -30,8 +30,8 @@ function copyBetweenVolumes(targetFile,
setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
},
// Select the source volume.
- function(inAppId) {
- appId = inAppId;
+ function(results) {
+ appId = results.windowId;
remoteCall.callRemoteTestUtil(
'selectVolume', appId, [srcName], this.next);
},