Chromium Code Reviews| Index: chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js |
| diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..35874655c5c849aa417bbb11290d1486fe101605 |
| --- /dev/null |
| +++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * A fake media scanner for testing. |
| + * @constructor |
|
hirono
2014/12/04 04:44:24
@struct?
Ben Kwa
2014/12/04 19:53:01
Done.
|
| + */ |
| +function MockMediaScanner() { |
| + /** @private {!Array<!FileEntry>} */ |
| + 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.
|
| +} |
| + |
| +/** |
| + * Returns scan "results". |
| + * @return {!Promise<!Array<!FileEntry>>} |
|
hirono
2014/12/04 04:44:25
!Promise.<!Array.<!FileEntry>>
Ben Kwa
2014/12/04 19:53:01
Acknowledged.
|
| + */ |
| +MockMediaScanner.prototype.scan = function(entries) { |
| + return Promise.resolve(this.results); |
| +}; |
| + |
| +/** |
| + * Sets the entries that the scanner will return. |
| + * @param {!Array<!FileEntry>} entries |
|
hirono
2014/12/04 04:44:24
!Array.<!FileEntry>
Ben Kwa
2014/12/04 19:53:01
Acknowledged.
|
| + */ |
| +MockMediaScanner.prototype.setScanResults = function(entries) { |
| + this.results = entries; |
| +}; |