| 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);
|
| });
|
| }
|
| @@ -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(
|
|
|