Commit d2d3ac45 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Fix traverseFolderShortcuts from folder_shortcuts.js with DriveFS.

Previously, traverseFolderShortcuts expanded the directory tree by
faking a mouse click on the expand icon once it exists. However, it
didn't wait for it to be visible or ready to click, which are only the
case after updating the directory contents. Fix this by waiting for the
row to have the has-children attribute set to true. Run this test with
DriveFS enabled.

addRemoveFolderShortcuts seems to be as reliable with or without DriveFS
enabled so run it with DriveFS enabled too.

Bug: 891197
Change-Id: I40df199feda04461b65891112e3314e0eca8496d
Reviewed-on: https://chromium-review.googlesource.com/c/1258372Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596413}
parent d2891f7f
......@@ -525,7 +525,9 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
FolderShortcuts, /* folder_shortcuts.js */
FilesAppBrowserTest,
::testing::Values(TestCase("traverseFolderShortcuts"),
TestCase("addRemoveFolderShortcuts")));
TestCase("traverseFolderShortcuts").EnableDriveFs(),
TestCase("addRemoveFolderShortcuts"),
TestCase("addRemoveFolderShortcuts").EnableDriveFs()));
WRAPPED_INSTANTIATE_TEST_CASE_P(
SortColumns, /* sort_columns.js */
......
......@@ -80,7 +80,8 @@ const DIRECTORY = {
* @return {Promise} Promise fulfilled on success.
*/
function expandTreeItem(appId, directory) {
const expandIcon = directory.treeItem + '> .tree-row > .expand-icon';
const expandIcon =
directory.treeItem + '> .tree-row[has-children=true] > .expand-icon';
return remoteCall.waitForElement(appId, expandIcon).then(function() {
return remoteCall.callRemoteTestUtil('fakeMouseClick', appId, [expandIcon]);
}).then(function(result) {
......
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