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

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: Sync to master. 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..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;
+};

Powered by Google App Engine
This is Rietveld 408576698