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

Unified Diff: trunk/src/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js

Issue 389243002: Revert 282900 "Revert 282890 "[fsp] Add an option for mounting i..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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
« no previous file with comments | « trunk/src/chrome/common/extensions/api/file_system_provider.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js
===================================================================
--- trunk/src/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js (revision 282906)
+++ trunk/src/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js (working copy)
@@ -34,6 +34,7 @@
onTestSuccess();
});
},
+
// Verifies that mounting fails, when an empty string is provided as an Id
function emptyFileSystemId() {
var onTestSuccess = chrome.test.callbackPass();
@@ -59,14 +60,15 @@
{fileSystemId: fileSystemId, displayName: 'caramel-candy.zip'},
function() {
chrome.fileBrowserPrivate.getVolumeMetadataList(function(volumeList) {
- var found = false;
- volumeList.forEach(function(volumeInfo) {
- if (volumeInfo.extensionId == chrome.runtime.id &&
- volumeInfo.fileSystemId == fileSystemId) {
- found = true;
+ var volumeInfo;
+ volumeList.forEach(function(inVolumeInfo) {
+ if (inVolumeInfo.extensionId == chrome.runtime.id &&
+ inVolumeInfo.fileSystemId == fileSystemId) {
+ volumeInfo = inVolumeInfo;
}
});
- chrome.test.assertTrue(found);
+ chrome.test.assertTrue(!!volumeInfo);
+ chrome.test.assertTrue(volumeInfo.isReadOnly);
onTestSuccess();
});
},
@@ -75,13 +77,43 @@
});
},
+ // Checks whether mounting a file system in writable mode ends up on filling
+ // out the volume info properly.
+ function successfulWritableMount() {
+ var onTestSuccess = chrome.test.callbackPass();
+ var fileSystemId = 'caramel-fudges';
+ chrome.fileSystemProvider.mount(
+ {
+ fileSystemId: fileSystemId,
+ displayName: 'caramel-fudges.zip',
+ writable: true
+ },
+ function() {
+ chrome.fileBrowserPrivate.getVolumeMetadataList(function(volumeList) {
+ var volumeInfo;
+ volumeList.forEach(function(inVolumeInfo) {
+ if (inVolumeInfo.extensionId == chrome.runtime.id &&
+ inVolumeInfo.fileSystemId == fileSystemId) {
+ volumeInfo = inVolumeInfo;
+ }
+ });
+ chrome.test.assertTrue(!!volumeInfo);
+ chrome.test.assertFalse(volumeInfo.isReadOnly);
+ onTestSuccess();
+ });
+ },
+ function(error) {
+ chrome.test.fail();
+ });
+ },
+
// Checks is limit for mounted file systems per profile works correctly.
// Tries to create more than allowed number of file systems. All of the mount
// requests should succeed, except the last one which should fail with a
// security error.
function stressMountTest() {
var onTestSuccess = chrome.test.callbackPass();
- var ALREADY_MOUNTED_FILE_SYSTEMS = 2; // By previous tests.
+ var ALREADY_MOUNTED_FILE_SYSTEMS = 3; // By previous tests.
var MAX_FILE_SYSTEMS = 16;
var index = 0;
var tryNextOne = function() {
« no previous file with comments | « trunk/src/chrome/common/extensions/api/file_system_provider.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698