Commit 68fb0634 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Chromium LUCI CQ

Files app: Fix integration tests that uses getLastVisitedURL()

When running Files app as JS modules the util namespace isn't accessible
to test_util.js.  Expose the only required function via the `fileManager`
instance which is accessible to test_util.js

Bug: 1133186
Change-Id: I1b2fe3f702b1f62e954250496818c808fd72aa6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639440
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845080}
parent bbfe91cb
...@@ -289,7 +289,7 @@ test.util.sync.getTreeItems = contentWindow => { ...@@ -289,7 +289,7 @@ test.util.sync.getTreeItems = contentWindow => {
* @return {!string} The URL of the last URL visited. * @return {!string} The URL of the last URL visited.
*/ */
test.util.sync.getLastVisitedURL = contentWindow => { test.util.sync.getLastVisitedURL = contentWindow => {
return contentWindow.util.getLastVisitedURL(); return contentWindow.fileManager.getLastVisitedURL();
}; };
/** /**
......
...@@ -588,6 +588,15 @@ ...@@ -588,6 +588,15 @@
this.fileBrowserBackground_.launchFileManager(appState); this.fileBrowserBackground_.launchFileManager(appState);
} }
/**
* Returns the last URL visited with visitURL() (e.g. for "Manage in Drive").
* Used by the integration tests.
* @return {string}
*/
getLastVisitedURL() {
return util.getLastVisitedURL();
}
/** /**
* One time initialization for app state controller to load view option from * One time initialization for app state controller to load view option from
* local storage. * local storage.
......
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