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

Unified Diff: chrome/browser/resources/downloads/item_view.js

Issue 1111593002: Fix incorrect assert() for interrupted/paused/in progress downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests i'm running locally Created 5 years, 8 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 | chrome/browser/ui/webui/downloads_ui_browsertest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/downloads/item_view.js
diff --git a/chrome/browser/resources/downloads/item_view.js b/chrome/browser/resources/downloads/item_view.js
index 4611ca8d6fbdfe26de6bdf68761677347fb65a5c..bf2a09ad6095cfae98dda05add7ec010ee11efb3 100644
--- a/chrome/browser/resources/downloads/item_view.js
+++ b/chrome/browser/resources/downloads/item_view.js
@@ -346,13 +346,15 @@ cr.define('downloads', function() {
switch (data.state) {
case Item.States.IN_PROGRESS:
case Item.States.PAUSED: // Fallthrough.
- return assert(data.progress_status_text);
+ assert(typeof data.progress_status_text == 'string');
+ return data.progress_status_text;
case Item.States.CANCELLED:
return loadTimeData.getString('status_cancelled');
case Item.States.DANGEROUS:
break; // Intentionally hit assertNotReached(); at bottom.
case Item.States.INTERRUPTED:
- return assert(data.last_reason_text);
+ assert(typeof data.last_reason_text == 'string');
+ return data.last_reason_text;
case Item.States.COMPLETE:
return data.file_externally_removed ?
loadTimeData.getString('status_removed') : '';
« no previous file with comments | « no previous file | chrome/browser/ui/webui/downloads_ui_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698