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

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

Issue 824753003: [fsp] Wire limiting number of opened files to FSP API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 11 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_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 81b6ae7207aa51ac2c50f01b8e62096c6b634c9b..83e2c374536d6009bde79eee3cd6757bb6b8622f 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
@@ -18,7 +18,7 @@ chrome.test.runTests([
// Verifies that mounting fails, when an empty string is provided as a name.
function emptyDisplayName() {
chrome.fileSystemProvider.mount(
- {fileSystemId: 'file-system-id', displayName: ''},
+ {fileSystemId: 'file-system-id-2', displayName: ''},
chrome.test.callbackFail('INVALID_OPERATION'));
},
@@ -29,6 +29,36 @@ chrome.test.runTests([
chrome.test.callbackFail('INVALID_OPERATION'));
},
+ // Verifies that mounting succeeds, when a positive limit for opened files is
+ // provided.
+ function goodOpenedFilesLimit() {
+ chrome.fileSystemProvider.mount({
+ fileSystemId: 'file-system-id-3',
+ displayName: 'File System Name',
+ openedFilesLimit: 10
+ }, chrome.test.callbackPass());
+ },
+
+ // Verifies that mounting succeeds, when limit for number of opened files is
+ // set to 0. It means no limit.
+ function goodOpenedFilesLimit() {
+ chrome.fileSystemProvider.mount({
+ fileSystemId: 'file-system-id-4',
+ displayName: 'File System Name',
+ openedFilesLimit: 0
+ }, chrome.test.callbackPass());
+ },
+
+ // Verifies that mounting fails, when a negative limit for opened files is
+ // provided.
+ function illegalOpenedFilesLimit() {
+ chrome.fileSystemProvider.mount({
+ fileSystemId: 'file-system-id-5',
+ displayName: 'File System Name',
+ openedFilesLimit: -1
+ }, chrome.test.callbackFail('INVALID_OPERATION'));
+ },
+
// End to end test. Mounts a volume using fileSystemProvider.mount(), then
// checks if the mounted volume is added to VolumeManager, by querying
// fileManagerPrivate.getVolumeMetadataList().
@@ -81,7 +111,7 @@ chrome.test.runTests([
// requests should succeed, except the last one which should fail with a
// security error.
function stressMountTest() {
- var ALREADY_MOUNTED_FILE_SYSTEMS = 3; // By previous tests.
+ var ALREADY_MOUNTED_FILE_SYSTEMS = 5; // By previous tests.
var MAX_FILE_SYSTEMS = 16;
var index = 0;
var tryNextOne = function() {

Powered by Google App Engine
This is Rietveld 408576698