OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 * @type {string} | 8 * @type {string} |
9 * @const | 9 * @const |
10 */ | 10 */ |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 chrome.fileSystemProvider.unmount( | 63 chrome.fileSystemProvider.unmount( |
64 {fileSystemId: FIRST_FILE_SYSTEM_ID}, | 64 {fileSystemId: FIRST_FILE_SYSTEM_ID}, |
65 chrome.test.callbackPass()); | 65 chrome.test.callbackPass()); |
66 }, | 66 }, |
67 | 67 |
68 // Tests the fileSystemProvider.unmount() with a wrong id. Verifies that | 68 // Tests the fileSystemProvider.unmount() with a wrong id. Verifies that |
69 // it fails with a correct error code. | 69 // it fails with a correct error code. |
70 function unmountWrongId() { | 70 function unmountWrongId() { |
71 chrome.fileSystemProvider.unmount( | 71 chrome.fileSystemProvider.unmount( |
72 {fileSystemId: 'wrong-fs-id'}, | 72 {fileSystemId: 'wrong-fs-id'}, |
73 chrome.test.callbackFail('SECURITY')); | 73 chrome.test.callbackFail('NOT_FOUND')); |
74 }, | 74 }, |
75 | 75 |
76 // Tests if fileManagerPrivate.removeMount() for provided file systems emits | 76 // Tests if fileManagerPrivate.removeMount() for provided file systems emits |
77 // the onMountRequested() event with correct arguments. | 77 // the onMountRequested() event with correct arguments. |
78 function requestUnmountSuccess() { | 78 function requestUnmountSuccess() { |
79 var onUnmountRequested = chrome.test.callbackPass( | 79 var onUnmountRequested = chrome.test.callbackPass( |
80 function(options, onSuccess, onError) { | 80 function(options, onSuccess, onError) { |
81 chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, options.fileSystemId); | 81 chrome.test.assertEq(SECOND_FILE_SYSTEM_ID, options.fileSystemId); |
82 // Not calling fileSystemProvider.unmount(), so the onMountCompleted | 82 // Not calling fileSystemProvider.unmount(), so the onMountCompleted |
83 // event will not be raised. | 83 // event will not be raised. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 test_util.getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) { | 133 test_util.getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) { |
134 chrome.test.assertTrue(!!volumeInfo); | 134 chrome.test.assertTrue(!!volumeInfo); |
135 chrome.fileManagerPrivate.removeMount(volumeInfo.volumeId); | 135 chrome.fileManagerPrivate.removeMount(volumeInfo.volumeId); |
136 }); | 136 }); |
137 } | 137 } |
138 ]); | 138 ]); |
139 } | 139 } |
140 | 140 |
141 // Setup and run all of the test cases. | 141 // Setup and run all of the test cases. |
142 setUp(runTests); | 142 setUp(runTests); |
OLD | NEW |