1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 * Runs all of the test cases, one by one.
10 chrome.test.runTests([
11 // Verifies if getAll() returns the mounted file system.
12 function mountSuccess() {
13 chrome.fileSystemProvider.mount(
15 fileSystemId: test_util.FILE_SYSTEM_ID,
16 displayName: test_util.FILE_SYSTEM_NAME
18 chrome.test.callbackPass(function() {
19 chrome.fileSystemProvider.getAll(chrome.test.callbackPass(
20 function(fileSystems) {
21 chrome.test.assertEq(1, fileSystems.length);
23 test_util.FILE_SYSTEM_ID, fileSystems[0].fileSystemId);
25 test_util.FILE_SYSTEM_NAME, fileSystems[0].displayName);
26 chrome.test.assertFalse(fileSystems[0].writable);
31 // Verifies that after unmounting, the file system is not available in
33 function unmountSuccess() {
34 chrome.fileSystemProvider.unmount(
35 {fileSystemId: test_util.FILE_SYSTEM_ID},
36 chrome.test.callbackPass(function() {
37 chrome.fileSystemProvider.getAll(chrome.test.callbackPass(
38 function(fileSystems) {
39 chrome.test.assertEq(0, fileSystems.length);
44 // Verifies that if mounting fails, then the file system is not added to the
46 function mountError() {
47 chrome.fileSystemProvider.mount(
48 {fileSystemId: '', displayName: ''},
49 chrome.test.callbackFail('SECURITY', function() {
50 chrome.fileSystemProvider.getAll(chrome.test.callbackPass(
51 function(fileSystems) {
52 chrome.test.assertEq(0, fileSystems.length);