Commit 7006136b authored by Sasha Morrissey's avatar Sasha Morrissey Committed by Commit Bot

Some minor fixes for setupAndWaitUntilReady

Bug: 719959
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I5ff560a2d842e91be024d265fd8599675636c16e
Reviewed-on: https://chromium-review.googlesource.com/1088350
Commit-Queue: Sasha Morrissey <sashab@chromium.org>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566634}
parent 3a776dc1
...@@ -314,8 +314,6 @@ function openAndWaitForClosingDialog( ...@@ -314,8 +314,6 @@ function openAndWaitForClosingDialog(
* Opens a Files app's main window and waits until it is initialized. Fills * Opens a Files app's main window and waits until it is initialized. Fills
* the window with initial files. Should be called for the first window only. * the window with initial files. Should be called for the first window only.
* *
* TODO(sashab): Convert optional entries arguments to map, or separate method
* without arguments (e.g. setupWithBasicEntriesAndWaitUntilReady).
* TODO(mtomasz): Pass a volumeId or an enum value instead of full paths. * TODO(mtomasz): Pass a volumeId or an enum value instead of full paths.
* *
* @param {Object} appState App state to be passed with on opening the Files * @param {Object} appState App state to be passed with on opening the Files
...@@ -334,16 +332,11 @@ function openAndWaitForClosingDialog( ...@@ -334,16 +332,11 @@ function openAndWaitForClosingDialog(
function setupAndWaitUntilReady( function setupAndWaitUntilReady(
appState, initialRoot, opt_callback, opt_initialLocalEntries, appState, initialRoot, opt_callback, opt_initialLocalEntries,
opt_initialDriveEntries) { opt_initialDriveEntries) {
var allPromises = []; var initialLocalEntries = opt_initialLocalEntries || BASIC_LOCAL_ENTRY_SET;
var initialDriveEntries = opt_initialDriveEntries || BASIC_DRIVE_ENTRY_SET;
var windowPromise = openNewWindow(appState, initialRoot); var windowPromise = openNewWindow(appState, initialRoot);
var localEntriesPromise = addEntries( var localEntriesPromise = addEntries(['local'], initialLocalEntries);
['local'], var driveEntriesPromise = addEntries(['drive'], initialDriveEntries);
opt_initialLocalEntries ? opt_initialLocalEntries :
BASIC_LOCAL_ENTRY_SET);
var driveEntriesPromise = addEntries(
['drive'],
opt_initialDriveEntries ? opt_initialDriveEntries :
BASIC_DRIVE_ENTRY_SET);
var detailedTablePromise = windowPromise.then(function(windowId) { var detailedTablePromise = windowPromise.then(function(windowId) {
return remoteCall.waitForElement(windowId, '#detail-table'). return remoteCall.waitForElement(windowId, '#detail-table').
then(function() { then(function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment