| 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..72ce28863bcb72262114bcce8e0958c3ba5ff808
|
| --- /dev/null
|
| +++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js
|
| @@ -0,0 +1,29 @@
|
| +// 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
|
| + * @struct
|
| + */
|
| +function MockMediaScanner() {
|
| + /** @private {!Array<!FileEntry>} */
|
| + this.results_ = [];
|
| +}
|
| +
|
| +/**
|
| + * Returns scan "results".
|
| + * @return {!Promise<!Array<!FileEntry>>}
|
| + */
|
| +MockMediaScanner.prototype.scan = function(entries) {
|
| + return Promise.resolve(this.results_);
|
| +};
|
| +
|
| +/**
|
| + * Sets the entries that the scanner will return.
|
| + * @param {!Array<!FileEntry>} entries
|
| + */
|
| +MockMediaScanner.prototype.setScanResults = function(entries) {
|
| + this.results_ = entries;
|
| +};
|
|
|