| 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 /** | 5 /** |
| 6 * importer.MediaScanner and importer.ScanResult test double. | 6 * importer.MediaScanner and importer.ScanResult test double. |
| 7 * | 7 * |
| 8 * @constructor | 8 * @constructor |
| 9 * @struct | 9 * @struct |
| 10 * @implements {importer.MediaScanner} | 10 * @implements {importer.MediaScanner} |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 * @type {!Array.<!FileEntry>} | 108 * @type {!Array.<!FileEntry>} |
| 109 */ | 109 */ |
| 110 this.fileEntries = fileEntries.slice(); | 110 this.fileEntries = fileEntries.slice(); |
| 111 | 111 |
| 112 /** @type {number} */ | 112 /** @type {number} */ |
| 113 this.totalBytes = 100; | 113 this.totalBytes = 100; |
| 114 | 114 |
| 115 /** @type {number} */ | 115 /** @type {number} */ |
| 116 this.scanDuration = 100; | 116 this.scanDuration = 100; |
| 117 | 117 |
| 118 /** @type {number} */ | |
| 119 this.duplicateFileCount = 0; | |
| 120 | |
| 121 /** @type {function} */ | 118 /** @type {function} */ |
| 122 this.resolveResult_; | 119 this.resolveResult_; |
| 123 | 120 |
| 124 /** @type {function} */ | 121 /** @type {function} */ |
| 125 this.rejectResult_; | 122 this.rejectResult_; |
| 126 | 123 |
| 127 /** @type {boolean} */ | 124 /** @type {boolean} */ |
| 128 this.settled_ = false; | 125 this.settled_ = false; |
| 129 | 126 |
| 130 /** @type {!Promise.<!importer.ScanResult>} */ | 127 /** @type {!Promise.<!importer.ScanResult>} */ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 /** @override */ | 161 /** @override */ |
| 165 TestScanResult.prototype.isInvalidated = function() { | 162 TestScanResult.prototype.isInvalidated = function() { |
| 166 return false; | 163 return false; |
| 167 }; | 164 }; |
| 168 | 165 |
| 169 /** @override */ | 166 /** @override */ |
| 170 TestScanResult.prototype.getStatistics = function() { | 167 TestScanResult.prototype.getStatistics = function() { |
| 171 return { | 168 return { |
| 172 scanDuration: this.scanDuration, | 169 scanDuration: this.scanDuration, |
| 173 newFileCount: this.fileEntries.length, | 170 newFileCount: this.fileEntries.length, |
| 174 duplicateFileCount: this.duplicateFileCount, | 171 duplicates: {}, |
| 175 sizeBytes: this.totalBytes | 172 sizeBytes: this.totalBytes |
| 176 }; | 173 }; |
| 177 }; | 174 }; |
| 178 | 175 |
| 179 /** | 176 /** |
| 180 * @constructor | 177 * @constructor |
| 181 * @implements {importer.DirectoryWatcher} | 178 * @implements {importer.DirectoryWatcher} |
| 182 */ | 179 */ |
| 183 function TestDirectoryWatcher(callback) { | 180 function TestDirectoryWatcher(callback) { |
| 184 /** | 181 /** |
| 185 * @public {function()} | 182 * @public {function()} |
| 186 * @const | 183 * @const |
| 187 */ | 184 */ |
| 188 this.callback = callback; | 185 this.callback = callback; |
| 189 | 186 |
| 190 /** | 187 /** |
| 191 * @public {boolean} | 188 * @public {boolean} |
| 192 */ | 189 */ |
| 193 this.triggered = false; | 190 this.triggered = false; |
| 194 }; | 191 }; |
| 195 | 192 |
| 196 /** | 193 /** |
| 197 * @override | 194 * @override |
| 198 */ | 195 */ |
| 199 TestDirectoryWatcher.prototype.addDirectory = function() { | 196 TestDirectoryWatcher.prototype.addDirectory = function() { |
| 200 }; | 197 }; |
| OLD | NEW |