Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1735)

Unified Diff: chrome/test/data/file_manager/unit_tests/mocks/mock_media_scanner.js

Issue 762593006: Prototype implementation of MediaImportHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MediaImportHandler into the importer namespace; make the import destination pluggable. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {
Steve McKay 2014/12/04 23:47:59 This is a Stub, not a mock. Though my standard adv
+ /** @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;
+};

Powered by Google App Engine
This is Rietveld 408576698