OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This test file checks if we can read the expected contents | 5 // This test file checks if we can read the expected contents |
6 // (kExpectedContents) from the target file (kFileName). We will try to read | 6 // (kExpectedContents) from the target file (kFileName). We will try to read |
7 // the file directly, and using a filesystem handler | 7 // the file directly, and using a filesystem handler |
8 // (chorme/test/data/extensions/api_test/filesystem_handler/). What's | 8 // (chorme/test/data/extensions/api_test/filesystem_handler/). What's |
9 // interesting is that we'll read the file via a remote mount point. | 9 // interesting is that we'll read the file via a remote mount point. |
10 // See external_filesystem_apitest.cc for how this is set up. | 10 // See external_filesystem_apitest.cc for how this is set up. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 'Expected ' + originalText + ', ' + | 116 'Expected ' + originalText + ', ' + |
117 'Got "' + request.fileContent + '.'}; | 117 'Got "' + request.fileContent + '.'}; |
118 errorCallback(error); | 118 errorCallback(error); |
119 return; | 119 return; |
120 } | 120 } |
121 | 121 |
122 successCallback(); | 122 successCallback(); |
123 }; | 123 }; |
124 | 124 |
125 | 125 |
126 TestRunner.prototype.errorCallback_ = function(error, messagePrefix) { | 126 TestRunner.prototype.errorCallback_ = function(messagePrefix, error) { |
tbarzic
2012/05/18 17:52:15
failure output should be nicer with this :)
| |
127 var msg = ''; | 127 var msg = ''; |
128 if (!error.code) { | 128 if (!error.code) { |
129 msg = error.message; | 129 msg = error.message; |
130 } else { | 130 } else { |
131 switch (error.code) { | 131 switch (error.code) { |
132 case FileError.QUOTA_EXCEEDED_ERR: | 132 case FileError.QUOTA_EXCEEDED_ERR: |
133 msg = 'QUOTA_EXCEEDED_ERR'; | 133 msg = 'QUOTA_EXCEEDED_ERR'; |
134 break; | 134 break; |
135 case FileError.NOT_FOUND_ERR: | 135 case FileError.NOT_FOUND_ERR: |
136 msg = 'NOT_FOUND_ERR'; | 136 msg = 'NOT_FOUND_ERR'; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 }, | 179 }, |
180 function executeReadTask() { | 180 function executeReadTask() { |
181 // Invokes a handler that reads the file opened in the previous test. | 181 // Invokes a handler that reads the file opened in the previous test. |
182 testRunner.runExecuteReadTask(); | 182 testRunner.runExecuteReadTask(); |
183 }, | 183 }, |
184 function createDir() { | 184 function createDir() { |
185 // Creates new directory. | 185 // Creates new directory. |
186 testRunner.runGetDirTest(kNewDirectoryPath, true); | 186 testRunner.runGetDirTest(kNewDirectoryPath, true); |
187 }, | 187 }, |
188 ]); | 188 ]); |
OLD | NEW |