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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc

Issue 1691543002: [Downloads] Enforce state transition integrity and state invariants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 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
« no previous file with comments | « no previous file | content/browser/download/download_item_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
index 26c0f57bad50d653a2b1471224eceba089115b5b..e3d02abbb533e4d8d5cac8d522f28414210069f2 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -428,32 +428,23 @@ class DownloadExtensionTest : public ExtensionApiTest {
DownloadItem* item = GetOnRecordManager()->CreateDownloadItem(
content::DownloadItem::kInvalidId + 1 + i,
downloads_directory().Append(history_info[i].filename),
- downloads_directory().Append(history_info[i].filename),
- url_chain, GURL(), // URL Chain, referrer
- std::string(), std::string(), // mime_type, original_mime_type
- current, current, // start_time, end_time
- std::string(), std::string(), // etag, last_modified
- 1, 1, // received_bytes, total_bytes
- history_info[i].state, // state
- content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- (history_info[i].state != content::DownloadItem::CANCELLED ?
- content::DOWNLOAD_INTERRUPT_REASON_NONE :
- content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED),
- false); // opened
+ downloads_directory().Append(history_info[i].filename), url_chain,
+ GURL(), // URL Chain, referrer
+ std::string(), std::string(), // mime_type, original_mime_type
+ current, current, // start_time, end_time
+ std::string(), std::string(), // etag, last_modified
+ 1, 1, // received_bytes, total_bytes
+ history_info[i].state, // state
+ history_info[i].danger_type,
+ (history_info[i].state != content::DownloadItem::CANCELLED
+ ? content::DOWNLOAD_INTERRUPT_REASON_NONE
+ : content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED),
+ false); // opened
items->push_back(item);
}
// Order by ID so that they are in the order that we created them.
std::sort(items->begin(), items->end(), download_id_comparator);
- // Set the danger type if necessary.
- for (size_t i = 0; i < count; ++i) {
- if (history_info[i].danger_type !=
- content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) {
- EXPECT_EQ(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT,
- history_info[i].danger_type);
- items->at(i)->OnContentCheckCompleted(history_info[i].danger_type);
- }
- }
return true;
}
« no previous file with comments | « no previous file | content/browser/download/download_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698