| 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 {Object} | 8 * @type {Object} |
| 9 * @const | 9 * @const |
| 10 */ | 10 */ |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 chrome.test.assertEq(TESTING_DIRECTORY.name, fileEntry.name); | 133 chrome.test.assertEq(TESTING_DIRECTORY.name, fileEntry.name); |
| 134 directoryChangedCallback = function() { | 134 directoryChangedCallback = function() { |
| 135 chrome.test.fail(); | 135 chrome.test.fail(); |
| 136 }; | 136 }; |
| 137 // TODO(mtomasz): NOT_FOUND error should be returned instead. | 137 // TODO(mtomasz): NOT_FOUND error should be returned instead. |
| 138 chrome.fileSystemProvider.notify({ | 138 chrome.fileSystemProvider.notify({ |
| 139 fileSystemId: test_util.FILE_SYSTEM_ID, | 139 fileSystemId: test_util.FILE_SYSTEM_ID, |
| 140 observedPath: fileEntry.fullPath, | 140 observedPath: fileEntry.fullPath, |
| 141 recursive: false, | 141 recursive: false, |
| 142 changeType: 'CHANGED', | 142 changeType: 'CHANGED', |
| 143 }, chrome.test.callbackFail('SECURITY')); | 143 }, chrome.test.callbackFail('INVALID_OPERATION')); |
| 144 }), | 144 }), |
| 145 function(error) { | 145 function(error) { |
| 146 chrome.test.fail(error.name); | 146 chrome.test.fail(error.name); |
| 147 }); | 147 }); |
| 148 }, | 148 }, |
| 149 | 149 |
| 150 // Notifying for the watched entry but in a wrong mode (recursive, while the | 150 // Notifying for the watched entry but in a wrong mode (recursive, while the |
| 151 // watcher is not recursive) should fail. | 151 // watcher is not recursive) should fail. |
| 152 function notifyWatchedPathButDifferentModeTag() { | 152 function notifyWatchedPathButDifferentModeTag() { |
| 153 test_util.fileSystem.root.getDirectory( | 153 test_util.fileSystem.root.getDirectory( |
| 154 TESTING_DIRECTORY.name, | 154 TESTING_DIRECTORY.name, |
| 155 {create: false}, | 155 {create: false}, |
| 156 chrome.test.callbackPass(function(fileEntry) { | 156 chrome.test.callbackPass(function(fileEntry) { |
| 157 chrome.test.assertEq(TESTING_DIRECTORY.name, fileEntry.name); | 157 chrome.test.assertEq(TESTING_DIRECTORY.name, fileEntry.name); |
| 158 directoryChangedCallback = function() { | 158 directoryChangedCallback = function() { |
| 159 chrome.test.fail(); | 159 chrome.test.fail(); |
| 160 }; | 160 }; |
| 161 // TODO(mtomasz): NOT_FOUND error should be returned instead. | 161 // TODO(mtomasz): NOT_FOUND error should be returned instead. |
| 162 chrome.fileSystemProvider.notify({ | 162 chrome.fileSystemProvider.notify({ |
| 163 fileSystemId: test_util.FILE_SYSTEM_ID, | 163 fileSystemId: test_util.FILE_SYSTEM_ID, |
| 164 observedPath: fileEntry.fullPath, | 164 observedPath: fileEntry.fullPath, |
| 165 recursive: true, | 165 recursive: true, |
| 166 changeType: 'CHANGED', | 166 changeType: 'CHANGED', |
| 167 tag: TESTING_ANOTHER_TAG, | 167 tag: TESTING_ANOTHER_TAG, |
| 168 }, chrome.test.callbackFail('SECURITY')); | 168 }, chrome.test.callbackFail('NOT_FOUND')); |
| 169 })); | 169 })); |
| 170 }, | 170 }, |
| 171 | 171 |
| 172 // Notify about the watched entry being removed. That should result in the | 172 // Notify about the watched entry being removed. That should result in the |
| 173 // watcher being removed. | 173 // watcher being removed. |
| 174 function notifyDeleted() { | 174 function notifyDeleted() { |
| 175 test_util.fileSystem.root.getDirectory( | 175 test_util.fileSystem.root.getDirectory( |
| 176 TESTING_DIRECTORY.name, | 176 TESTING_DIRECTORY.name, |
| 177 {create: false}, | 177 {create: false}, |
| 178 chrome.test.callbackPass(function(fileEntry) { | 178 chrome.test.callbackPass(function(fileEntry) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 directoryChangedCallback = function() { | 216 directoryChangedCallback = function() { |
| 217 chrome.test.fail(); | 217 chrome.test.fail(); |
| 218 }; | 218 }; |
| 219 // TODO(mtomasz): NOT_FOUND error should be returned instead. | 219 // TODO(mtomasz): NOT_FOUND error should be returned instead. |
| 220 chrome.fileSystemProvider.notify({ | 220 chrome.fileSystemProvider.notify({ |
| 221 fileSystemId: test_util.FILE_SYSTEM_ID, | 221 fileSystemId: test_util.FILE_SYSTEM_ID, |
| 222 observedPath: fileEntry.fullPath, | 222 observedPath: fileEntry.fullPath, |
| 223 recursive: false, | 223 recursive: false, |
| 224 changeType: 'CHANGED', | 224 changeType: 'CHANGED', |
| 225 tag: TESTING_ANOTHER_TAG | 225 tag: TESTING_ANOTHER_TAG |
| 226 }, chrome.test.callbackFail('SECURITY')); | 226 }, chrome.test.callbackFail('NOT_FOUND')); |
| 227 })); | 227 })); |
| 228 } | 228 } |
| 229 ]); | 229 ]); |
| 230 } | 230 } |
| 231 | 231 |
| 232 // Setup and run all of the test cases. | 232 // Setup and run all of the test cases. |
| 233 setUp(runTests); | 233 setUp(runTests); |
| OLD | NEW |