OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Stub out the metrics package. | 6 * Stub out the metrics package. |
7 * @type {!Object.<!string, !Function>} | 7 * @type {!Object.<!string, !Function>} |
8 */ | 8 */ |
9 var metrics = { | 9 var metrics = { |
10 recordTime: function() {}, | 10 recordTime: function() {}, |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 scan = scanner.scan([root]); | 334 scan = scanner.scan([root]); |
335 watcher.callback(); | 335 watcher.callback(); |
336 return invalidatePromise; | 336 return invalidatePromise; |
337 }), | 337 }), |
338 callback); | 338 callback); |
339 } | 339 } |
340 | 340 |
341 /** | 341 /** |
342 * Verifies the results of the media scan are as expected. | 342 * Verifies the results of the media scan are as expected. |
343 * @param {!Array.<string>} expected | 343 * @param {!Array.<string>} expected |
344 * @param {!impoter.ScanResults} results | 344 * @param {!importer.ScanResults} results |
345 */ | 345 */ |
346 function assertResults(expected, results) { | 346 function assertResults(expected, results) { |
347 assertFileEntryPathsEqual(expected, results.getFileEntries()); | 347 assertFileEntryPathsEqual(expected, results.getFileEntries()); |
348 // TODO(smckay): Add coverage for getScanDurationMs && getTotalBytes. | 348 // TODO(smckay): Add coverage for getScanDurationMs && getTotalBytes. |
349 } | 349 } |
350 | 350 |
351 /** | 351 /** |
352 * Creates a subdirectory within a temporary file system for testing. | 352 * Creates a subdirectory within a temporary file system for testing. |
353 * | 353 * |
354 * @param {string} directoryName Name of the test directory to create. Must be | 354 * @param {string} directoryName Name of the test directory to create. Must be |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 return new Promise( | 408 return new Promise( |
409 function(resolve, reject) { | 409 function(resolve, reject) { |
410 dir.getFile(filename, {create: true}, resolve, reject); | 410 dir.getFile(filename, {create: true}, resolve, reject); |
411 }); | 411 }); |
412 } | 412 } |
413 })).then( | 413 })).then( |
414 function() { | 414 function() { |
415 return dir; | 415 return dir; |
416 }); | 416 }); |
417 } | 417 } |
OLD | NEW |