[Download Home] Add missing files to map
Problematically, new DownloadItems are created with no file name when a download first starts. This means that the DownloadHistoryItemWrapper is added to the wrong part of the FilePathsToDownloadItemsMap and can't be removed until the user re-opens Download Home, which correctly records the DownloadItem in the correct place. * Change the behavior so a download completion event also triggers the item to be added to the map -- this time with the correct file path. * Also make the FilePathsToDownloadItemsMap use a HashSet for its secondary data structure. It ends up slightly cleaner IMO. * Cleans up the StubbedProvider so that it can take in specific download percentages more easily. * Add a new test for this behavior. BUG=670583 TEST=DownloadHistoryAdapterTest* Review-Url: https://codereview.chromium.org/2626903005 Cr-Commit-Position: refs/heads/master@{#442960}
Showing
Please register or sign in to comment