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

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

Issue 372163006: [fsp] Add an option for mounting in R/W mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. 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 | « 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: chrome/test/data/extensions/api_test/file_system_provider/mount/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js b/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js
index 38c3a39199a2c69c3365edededde5c88a3a5a619..0d19d4cf46d1603fe04f112322cdce82a3ec6cb7 100644
--- a/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js
+++ b/chrome/test/data/extensions/api_test/file_system_provider/mount/test.js
@@ -34,6 +34,7 @@ chrome.test.runTests([
onTestSuccess();
});
},
+
// Verifies that mounting fails, when an empty string is provided as an Id
function emptyFileSystemId() {
var onTestSuccess = chrome.test.callbackPass();
@@ -59,14 +60,45 @@ chrome.test.runTests([
{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(!!volumeInfo);
+ chrome.test.assertTrue(volumeInfo.isReadOnly);
+ onTestSuccess();
+ });
+ },
+ function(error) {
+ chrome.test.fail();
+ });
+ },
+
+ // 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(found);
+ chrome.test.assertTrue(!!volumeInfo);
+ chrome.test.assertFalse(volumeInfo.isReadOnly);
onTestSuccess();
});
},
@@ -81,7 +113,7 @@ chrome.test.runTests([
// 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 | « 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