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

Unified Diff: ui/file_manager/file_manager/background/js/media_import_handler_unittest.js

Issue 980603003: Move content deduplication into the scan process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review comments. Created 5 years, 10 months 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: ui/file_manager/file_manager/background/js/media_import_handler_unittest.js
diff --git a/ui/file_manager/file_manager/background/js/media_import_handler_unittest.js b/ui/file_manager/file_manager/background/js/media_import_handler_unittest.js
index 173886534f5cd2097a4be1a92d9b191c6eee3824..767a69ccd3f0d874335b3af3485afa28ef010f9e 100644
--- a/ui/file_manager/file_manager/background/js/media_import_handler_unittest.js
+++ b/ui/file_manager/file_manager/background/js/media_import_handler_unittest.js
@@ -81,7 +81,6 @@ function setUp() {
mediaImporter = new importer.MediaImportHandler(
progressCenter,
importHistory,
- duplicateFinderFactory,
new TestTracker());
}
@@ -371,67 +370,6 @@ function testImportCancellation(callback) {
scanResult.finalize();
}
-function testImportWithDuplicates(callback) {
- var media = setupFileSystem([
- '/DCIM/photos0/IMG00001.jpg',
- '/DCIM/photos0/IMG00002.jpg',
- '/DCIM/photos0/IMG00003.jpg',
- '/DCIM/photos1/IMG00004.jpg',
- '/DCIM/photos1/IMG00005.jpg',
- '/DCIM/photos1/IMG00006.jpg'
- ]);
-
- /** @const {number} */
- var EXPECTED_COPY_COUNT = 3;
-
- var scanResult = new TestScanResult(media);
- var importTask = mediaImporter.importFromScanResult(
- scanResult,
- importer.Destination.GOOGLE_DRIVE,
- destinationFactory);
- var whenImportDone = new Promise(
- function(resolve, reject) {
- importTask.addObserver(
- /**
- * @param {!importer.TaskQueue.UpdateType} updateType
- * @param {!importer.TaskQueue.Task} task
- */
- function(updateType, task) {
- switch (updateType) {
- case importer.TaskQueue.UpdateType.COMPLETE:
- resolve();
- break;
- case importer.TaskQueue.UpdateType.ERROR:
- reject(new Error(importer.TaskQueue.UpdateType.ERROR));
- break;
- }
- });
- });
-
- // Simulate a known number of new imports followed by a bunch of duplicate
- // imports.
- var copyCount = 0;
- importTask.addObserver(function(updateType) {
- if (updateType ===
- importer.MediaImportHandler.ImportTask.UpdateType.ENTRY_CHANGED) {
- copyCount++;
- if (copyCount === EXPECTED_COPY_COUNT) {
- duplicateFinderFactory.instances[0].returnValue = true;
- }
- }
- });
-
- reportPromise(
- whenImportDone.then(
- function() {
- var copiedEntries = destinationFileSystem.root.getAllChildren();
- assertEquals(EXPECTED_COPY_COUNT, copiedEntries.length);
- }),
- callback);
-
- scanResult.finalize();
-}
-
function testImportWithErrors(callback) {
// Quiet the logger just in this test where we expect errors.

Powered by Google App Engine
This is Rietveld 408576698