Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10298)

Unified Diff: chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js

Issue 985533004: Implement chrome.fileSystem.requestFileSystem(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed kiosk mode. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js
diff --git a/chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js b/chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js
index d78a38113dfa6b359f6201edb5d3560fb780d805..11e6446278986fcda46ecd0c2ffd93ba7b532e47 100644
--- a/chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js
+++ b/chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/test.js
@@ -126,28 +126,37 @@ function initTests(callback) {
return;
}
- chrome.fileManagerPrivate.requestFileSystem(
- driveVolumes[0].volumeId,
+ chrome.fileSystem.requestFileSystem(
+ {
+ volumeId: driveVolumes[0].volumeId,
+ writable: true
+ },
function(primaryFileSystem) {
if (!primaryFileSystem) {
callback(null, 'Failed to acquire the testing volume.');
return;
}
- var url = primaryFileSystem.root.toURL().replace(
- /[^\/]*\/?$/, kSecondaryDriveMountPointName);
+ // Resolving the isolated entry is necessary in order to fetch URL
+ // of an entry from a different profile.
+ chrome.fileManagerPrivate.resolveIsolatedEntries(
+ [primaryFileSystem.root],
+ function(entries) {
+ var url = entries[0].toURL().replace(
+ /[^\/]*\/?$/, kSecondaryDriveMountPointName);
+ chrome.fileManagerPrivate.grantAccess([url], function() {
+ webkitResolveLocalFileSystemURL(url, function(entry) {
+ if (!entry) {
+ callback(
+ null,
+ 'Failed to acquire secondary profile\'s volume.');
+ return;
+ }
- chrome.fileManagerPrivate.grantAccess([url], function() {
- webkitResolveLocalFileSystemURL(url, function(entry) {
- if (!entry) {
- callback(
- null, 'Failed to acquire secondary profile\'s volume.');
- return;
- }
-
- callback(collectTests(primaryFileSystem.root, entry), 'Success.');
- });
- });
+ callback(collectTests(entries[0], entry), 'Success.');
+ });
+ });
+ });
});
});
}

Powered by Google App Engine
This is Rietveld 408576698