OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 /** |
| 6 * A fake media scanner for testing. |
| 7 * @constructor |
| 8 * @struct |
| 9 */ |
| 10 function MockMediaScanner() { |
| 11 /** @private {!Array<!FileEntry>} */ |
| 12 this.results_ = []; |
| 13 } |
| 14 |
| 15 /** |
| 16 * Returns scan "results". |
| 17 * @return {!Promise<!Array<!FileEntry>>} |
| 18 */ |
| 19 MockMediaScanner.prototype.scan = function(entries) { |
| 20 return Promise.resolve(this.results_); |
| 21 }; |
| 22 |
| 23 /** |
| 24 * Sets the entries that the scanner will return. |
| 25 * @param {!Array<!FileEntry>} entries |
| 26 */ |
| 27 MockMediaScanner.prototype.setScanResults = function(entries) { |
| 28 this.results_ = entries; |
| 29 }; |
OLD | NEW |