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
3 // found in the LICENSE file.
5 GEN_INCLUDE(['downloads_ui_browsertest_base.js']);
6 GEN('#include "chrome/browser/ui/webui/downloads_ui_browsertest.h"');
8 // Test UI when removing entries is allowed.
9 TEST_F('BaseDownloadsWebUITest', 'DeleteAllowed', function() {
10 this.testHelper(true, false);
11 // TODO(pamg): Mock out the back-end calls, so we can also test removing a
16 TEST_F('BaseDownloadsWebUITest', 'NoResultsHiddenWhenDownloads', function() {
17 assertNotEquals(0, downloads.size());
18 expectFalse($('downloads-display').hidden);
19 expectTrue($('no-downloads-or-results').hidden);
24 * @extends {BaseDownloadsWebUITest}
26 function EmptyDownloadsWebUITest() {}
28 EmptyDownloadsWebUITest.prototype = {
29 __proto__: BaseDownloadsWebUITest.prototype,
33 // Doesn't create any fake downloads.
34 assertEquals(0, downloads.size());
38 TEST_F('EmptyDownloadsWebUITest', 'NoDownloadsMessageShowing', function() {
39 expectTrue($('downloads-display').hidden);
40 expectFalse($('no-downloads-or-results').hidden);
44 * Fixture for Downloads WebUI testing when deletions are prohibited.
45 * @extends {BaseDownloadsWebUITest}
48 function DownloadsWebUIDeleteProhibitedTest() {}
50 DownloadsWebUIDeleteProhibitedTest.prototype = {
51 __proto__: BaseDownloadsWebUITest.prototype,
54 testGenPreamble: function() {
55 GEN(' SetDeleteAllowed(false);');
59 // Test UI when removing entries is prohibited.
60 TEST_F('DownloadsWebUIDeleteProhibitedTest', 'DeleteProhibited', function() {
61 this.testHelper(false, false);
62 // TODO(pamg): Mock out the back-end calls, so we can also test removing a