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

Side by Side Diff: chrome/browser/ui/webui/downloads_ui_browsertest.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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/downloads/item_view.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 GEN_INCLUDE(['downloads_ui_browsertest_base.js']); 5 GEN_INCLUDE(['downloads_ui_browsertest_base.js']);
6 GEN('#include "chrome/browser/ui/webui/downloads_ui_browsertest.h"'); 6 GEN('#include "chrome/browser/ui/webui/downloads_ui_browsertest.h"');
7 7
8 // Test UI when removing entries is allowed. 8 // Test UI when removing entries is allowed.
9 TEST_F('BaseDownloadsWebUITest', 'DeleteAllowed', function() { 9 TEST_F('BaseDownloadsWebUITest', 'DeleteAllowed', function() {
10 this.expectDeleteControlsVisible(true); 10 this.expectDeleteControlsVisible(true);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 expectEquals(numDownloads + 1, manager.size()); 90 expectEquals(numDownloads + 1, manager.size());
91 expectEquals(1, datesShowing()); 91 expectEquals(1, datesShowing());
92 92
93 var firstContainer = document.querySelector('.date-container'); 93 var firstContainer = document.querySelector('.date-container');
94 assertFalse(firstContainer.hidden); 94 assertFalse(firstContainer.hidden);
95 expectGT(firstContainer.querySelector('.since').textContent.trim().length, 0); 95 expectGT(firstContainer.querySelector('.since').textContent.trim().length, 0);
96 expectGT(firstContainer.querySelector('.date').textContent.trim().length, 0); 96 expectGT(firstContainer.querySelector('.date').textContent.trim().length, 0);
97 }); 97 });
98 98
99 TEST_F('BaseDownloadsWebUITest', 'EmptyProgressStatusText', function() {
100 this.createdDownloads[0].state = downloads.Item.States.PAUSED;
101 this.createdDownloads[0].progress_status_text = '';
102 downloads.Manager.updateItem(this.createdDownloads[0]); // Might assert().
103 });
104
105 TEST_F('BaseDownloadsWebUITest', 'EmptyLastStatusText', function() {
106 this.createdDownloads[0].state = downloads.Item.States.INTERRUPTED;
107 this.createdDownloads[0].last_reason_text = '';
108 downloads.Manager.updateItem(this.createdDownloads[0]); // Might assert().
109 });
110
99 /** 111 /**
100 * @constructor 112 * @constructor
101 * @extends {BaseDownloadsWebUITest} 113 * @extends {BaseDownloadsWebUITest}
102 */ 114 */
103 function EmptyDownloadsWebUITest() {} 115 function EmptyDownloadsWebUITest() {}
104 116
105 EmptyDownloadsWebUITest.prototype = { 117 EmptyDownloadsWebUITest.prototype = {
106 __proto__: BaseDownloadsWebUITest.prototype, 118 __proto__: BaseDownloadsWebUITest.prototype,
107 119
108 /** @override */ 120 /** @override */
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 this.expectDeleteControlsVisible(false); 160 this.expectDeleteControlsVisible(false);
149 // TODO(pamg): Mock out the back-end calls, so we can also test removing a 161 // TODO(pamg): Mock out the back-end calls, so we can also test removing a
150 // single item. 162 // single item.
151 }); 163 });
152 164
153 TEST_F('DownloadsWebUIDeleteProhibitedTest', 'ClearLeavesSearch', function() { 165 TEST_F('DownloadsWebUIDeleteProhibitedTest', 'ClearLeavesSearch', function() {
154 downloads.Manager.setSearchText('muhahaha'); 166 downloads.Manager.setSearchText('muhahaha');
155 $('clear-all').click(); 167 $('clear-all').click();
156 expectGE(downloads.Manager.getInstance().searchText_.length, 0); 168 expectGE(downloads.Manager.getInstance().searchText_.length, 0);
157 }); 169 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/downloads/item_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698