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 | |
hirono
2014/12/04 04:44:24
@struct?
Ben Kwa
2014/12/04 19:53:01
Done.
| |
8 */ | |
9 function MockMediaScanner() { | |
10 /** @private {!Array<!FileEntry>} */ | |
11 this.results = []; | |
hirono
2014/12/04 04:44:25
Please add '_' at the end for private members.
Ben Kwa
2014/12/04 19:53:01
Done.
| |
12 } | |
13 | |
14 /** | |
15 * Returns scan "results". | |
16 * @return {!Promise<!Array<!FileEntry>>} | |
hirono
2014/12/04 04:44:25
!Promise.<!Array.<!FileEntry>>
Ben Kwa
2014/12/04 19:53:01
Acknowledged.
| |
17 */ | |
18 MockMediaScanner.prototype.scan = function(entries) { | |
19 return Promise.resolve(this.results); | |
20 }; | |
21 | |
22 /** | |
23 * Sets the entries that the scanner will return. | |
24 * @param {!Array<!FileEntry>} entries | |
hirono
2014/12/04 04:44:24
!Array.<!FileEntry>
Ben Kwa
2014/12/04 19:53:01
Acknowledged.
| |
25 */ | |
26 MockMediaScanner.prototype.setScanResults = function(entries) { | |
27 this.results = entries; | |
28 }; | |
OLD | NEW |