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

Unified Diff: chrome/test/data/file_manager/unit_tests/media_scanner_unittest.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/media_scanner_unittest.js
diff --git a/chrome/test/data/file_manager/unit_tests/media_scanner_unittest.js b/chrome/test/data/file_manager/unit_tests/media_scanner_unittest.js
index 869abde355836df71ca9959ad5e7972c078c52c6..bd6ae36ffc0bc5096f39b33430745888e28d75d3 100644
--- a/chrome/test/data/file_manager/unit_tests/media_scanner_unittest.js
+++ b/chrome/test/data/file_manager/unit_tests/media_scanner_unittest.js
@@ -14,8 +14,14 @@ var chrome;
var timeoutCallbacks;
+/**
+ * @type {!MediaScanner}
+ */
+var scanner;
+
// Set up the test components.
function setUp() {
+ scanner = new MediaScanner();
}
/**
@@ -78,8 +84,7 @@ function populateDir(filenames, dir) {
* Verifies that scanning an empty filesystem produces an empty list.
*/
function testEmptyList(errorIf) {
- var scanner = new MediaScanner([]);
- scanner.getFiles().then(function(files) {
+ scanner.scan([]).then(function(files) {
errorIf(files.length !== 0);
hirono 2014/12/04 04:44:23 Please use assert and reportPromise.
Ben Kwa 2014/12/04 07:48:08 Okay, but can I make that change in a separate CL,
Ben Kwa 2014/12/04 19:53:01 Acknowledged. Will fix in a follow-up CL.
});
}
@@ -109,8 +114,7 @@ function testSingleLevel(errorIf) {
* @param {!DirectoryEntry} root
*/
function(root) {
- var scanner = new MediaScanner([root]);
- return scanner.getFiles();
+ return scanner.scan([root]);
})
.then(
/**
@@ -168,8 +172,7 @@ function testMultiLevel(errorIf) {
* @param {!DirectoryEntry} root
*/
function(root) {
- var scanner = new MediaScanner([root]);
- return scanner.getFiles();
+ return scanner.scan([root]);
})
.then(
/**
@@ -234,8 +237,7 @@ function testMultipleDirectories(errorIf) {
return Promise.all(['foo.0', 'foo.1'].map(
getDirectory.bind(null, root))).then(
function(directories) {
- var scanner = new MediaScanner(directories);
- return scanner.getFiles();
+ return scanner.scan(directories);
});
})
.then(

Powered by Google App Engine
This is Rietveld 408576698