Commit fc33ef5c authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Files app: Change opening a folder navigates to the folder

Change Files app to navigate to the directory when a "selectionURL"
provided in the launch params. Before this CL Files app would only show
the directory selected.

This change is to support the workflow from Issue:1090211. From ARC++
the intent to "ACTION_VIEW_DOWNLOADS" will open the Files app in the
Downloads folder.

Bug: 1090211
Change-Id: Ic6b9d290936f4a25576f3bfd5a799c37f6fa2195
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2379345Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804071}
parent c78786d1
...@@ -1252,10 +1252,8 @@ class FileManager extends cr.EventTarget { ...@@ -1252,10 +1252,8 @@ class FileManager extends cr.EventTarget {
nextCurrentDirEntry = inEntry; nextCurrentDirEntry = inEntry;
} }
// If this dialog attempts to open file(s) and the selection is a // If the |selectionURL| is a directory make it the current directory.
// directory, the selection should be the current directory. if (inEntry.isDirectory) {
if (DialogType.isOpenFileDialog(this.dialogType) &&
inEntry.isDirectory) {
nextCurrentDirEntry = inEntry; nextCurrentDirEntry = inEntry;
} }
......
...@@ -51,9 +51,9 @@ testcase.fileDisplayLaunchOnLocalFolder = async () => { ...@@ -51,9 +51,9 @@ testcase.fileDisplayLaunchOnLocalFolder = async () => {
// Wait for app window to open. // Wait for app window to open.
const appId = await remoteCall.waitForWindow('files#'); const appId = await remoteCall.waitForWindow('files#');
// Check: the Downloads/photos folder should be selected. // Check: The current directory is MyFiles/Downloads/photos.
await remoteCall.waitForElement( await remoteCall.waitUntilCurrentDirectoryIsChanged(
appId, '#file-list [file-name="photos"][selected]'); appId, '/My files/Downloads/photos');
// The API used to launch the Files app does not set the IN_TEST flag to true: // The API used to launch the Files app does not set the IN_TEST flag to true:
// error when attempting to retrieve Web Store access token. // error when attempting to retrieve Web Store access token.
......
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