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

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

Issue 703123003: [fsp] Pass more detailed errors to the providing extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a bug. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Runs all of the test cases, one by one. 8 * Runs all of the test cases, one by one.
9 */ 9 */
10 chrome.test.runTests([ 10 chrome.test.runTests([
11 // Tests whether mounting succeeds, when a non-empty name is provided. 11 // Tests whether mounting succeeds, when a non-empty name is provided.
12 function goodDisplayName() { 12 function goodDisplayName() {
13 chrome.fileSystemProvider.mount( 13 chrome.fileSystemProvider.mount(
14 {fileSystemId: 'file-system-id', displayName: 'file-system-name'}, 14 {fileSystemId: 'file-system-id', displayName: 'file-system-name'},
15 chrome.test.callbackPass()); 15 chrome.test.callbackPass());
16 }, 16 },
17 17
18 // Verifies that mounting fails, when an empty string is provided as a name. 18 // Verifies that mounting fails, when an empty string is provided as a name.
19 function emptyDisplayName() { 19 function emptyDisplayName() {
20 chrome.fileSystemProvider.mount( 20 chrome.fileSystemProvider.mount(
21 {fileSystemId: 'file-system-id', displayName: ''}, 21 {fileSystemId: 'file-system-id', displayName: ''},
22 chrome.test.callbackFail('SECURITY')); 22 chrome.test.callbackFail('INVALID_OPERATION'));
23 }, 23 },
24 24
25 // Verifies that mounting fails, when an empty string is provided as an Id 25 // Verifies that mounting fails, when an empty string is provided as an Id
26 function emptyFileSystemId() { 26 function emptyFileSystemId() {
27 chrome.fileSystemProvider.mount( 27 chrome.fileSystemProvider.mount(
28 {fileSystemId: '', displayName: 'File System Name'}, 28 {fileSystemId: '', displayName: 'File System Name'},
29 chrome.test.callbackFail('SECURITY')); 29 chrome.test.callbackFail('INVALID_OPERATION'));
30 }, 30 },
31 31
32 // End to end test. Mounts a volume using fileSystemProvider.mount(), then 32 // End to end test. Mounts a volume using fileSystemProvider.mount(), then
33 // checks if the mounted volume is added to VolumeManager, by querying 33 // checks if the mounted volume is added to VolumeManager, by querying
34 // fileManagerPrivate.getVolumeMetadataList(). 34 // fileManagerPrivate.getVolumeMetadataList().
35 function successfulMount() { 35 function successfulMount() {
36 var fileSystemId = 'caramel-candy'; 36 var fileSystemId = 'caramel-candy';
37 chrome.fileSystemProvider.mount( 37 chrome.fileSystemProvider.mount(
38 {fileSystemId: fileSystemId, displayName: 'caramel-candy.zip'}, 38 {fileSystemId: fileSystemId, displayName: 'caramel-candy.zip'},
39 chrome.test.callbackPass(function() { 39 chrome.test.callbackPass(function() {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 var fileSystemId = index + '-stress-test'; 90 var fileSystemId = index + '-stress-test';
91 chrome.fileSystemProvider.mount( 91 chrome.fileSystemProvider.mount(
92 {fileSystemId: fileSystemId, displayName: index + 'th File System'}, 92 {fileSystemId: fileSystemId, displayName: index + 'th File System'},
93 chrome.test.callbackPass(tryNextOne)); 93 chrome.test.callbackPass(tryNextOne));
94 } else { 94 } else {
95 chrome.fileSystemProvider.mount( 95 chrome.fileSystemProvider.mount(
96 { 96 {
97 fileSystemId: 'over-the-limit-fs-id', 97 fileSystemId: 'over-the-limit-fs-id',
98 displayName: 'Over The Limit File System' 98 displayName: 'Over The Limit File System'
99 }, 99 },
100 chrome.test.callbackFail('SECURITY')); 100 chrome.test.callbackFail('TOO_MANY_OPENED'));
101 } 101 }
102 }; 102 };
103 tryNextOne(); 103 tryNextOne();
104 } 104 }
105 ]); 105 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698