diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-29 18:57:45 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-29 18:57:45 +0000 |
commit | fe752272420b287bd97512d86668bae1371f0419 (patch) | |
tree | fab7814bba055c5592d0d8861a7c30fd88a3f9b4 /chrome/browser/extensions/api/downloads/downloads_api_unittest.cc | |
parent | ee54df992ca2a943a5f0b51daef56ae4e30426f5 (diff) | |
download | chromium_src-fe752272420b287bd97512d86668bae1371f0419.zip chromium_src-fe752272420b287bd97512d86668bae1371f0419.tar.gz chromium_src-fe752272420b287bd97512d86668bae1371f0419.tar.bz2 |
[Downloads] Allow acquiring dangerous download file.
A dangerous download can be accepted by the user or rejected. If
rejected, the downloaded file used to be deleted. This change adds
DownloadItem::AcquireFileAndDeleteDownload() which allows the caller to
acquire the dangerous file.
The intended consumer of this feature is SafeBrowsing where the caller
may want to acquire a dangerous file that's being discarded for the
purpose of further analysis.
Also change the logic during shutdown to no longer delete dangerous
downloads, but to cancel them.
TBR=rdsmith
BUG=244604
Review URL: https://chromiumcodereview.appspot.com/14947007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api/downloads/downloads_api_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/api/downloads/downloads_api_unittest.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc index 5d78e13..5034052 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc @@ -1099,7 +1099,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, // Once the download item is deleted, we should return kInvalidOperationError. int id = download_item->GetId(); - download_item->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); + download_item->Remove(); download_item = NULL; EXPECT_EQ(static_cast<DownloadItem*>(NULL), GetCurrentManager()->GetDownload(id)); @@ -2369,7 +2369,7 @@ IN_PROC_BROWSER_TEST_F( " \"current\":false}}]", result_id))); - item->DangerousDownloadValidated(); + item->ValidateDangerousDownload(); ASSERT_TRUE(WaitFor(events::kOnDownloadChanged, base::StringPrintf("[{\"id\": %d," " \"dangerAccepted\": {" |