OLD | NEW |
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.testHelper(true, false); | 10 this.testHelper(true, false); |
11 // TODO(pamg): Mock out the back-end calls, so we can also test removing a | 11 // TODO(pamg): Mock out the back-end calls, so we can also test removing a |
12 // single item. | 12 // single item. |
13 testDone(); | 13 testDone(); |
14 }); | 14 }); |
15 | 15 |
16 // Test that clicking <a href=#> doesn't actually go to #. | |
17 TEST_F('BaseDownloadsWebUITest', 'PoundLinkClicksDontChangeUrl', function() { | |
18 assertEquals(this.browsePreload, document.location.href); | |
19 document.querySelector('.clear-all-link').click(); | |
20 assertEquals(this.browsePreload, document.location.href); | |
21 testDone(); | |
22 }); | |
23 | |
24 /** | 16 /** |
25 * Fixture for Downloads WebUI testing when deletions are prohibited. | 17 * Fixture for Downloads WebUI testing when deletions are prohibited. |
26 * @extends {BaseDownloadsWebUITest} | 18 * @extends {BaseDownloadsWebUITest} |
27 * @constructor | 19 * @constructor |
28 */ | 20 */ |
29 function DownloadsWebUIDeleteProhibitedTest() {} | 21 function DownloadsWebUIDeleteProhibitedTest() {} |
30 | 22 |
31 DownloadsWebUIDeleteProhibitedTest.prototype = { | 23 DownloadsWebUIDeleteProhibitedTest.prototype = { |
32 __proto__: BaseDownloadsWebUITest.prototype, | 24 __proto__: BaseDownloadsWebUITest.prototype, |
33 | 25 |
34 /** @override */ | 26 /** @override */ |
35 testGenPreamble: function() { | 27 testGenPreamble: function() { |
36 GEN(' SetDeleteAllowed(false);'); | 28 GEN(' SetDeleteAllowed(false);'); |
37 }, | 29 }, |
38 }; | 30 }; |
39 | 31 |
40 // Test UI when removing entries is prohibited. | 32 // Test UI when removing entries is prohibited. |
41 TEST_F('DownloadsWebUIDeleteProhibitedTest', 'DeleteProhibited', function() { | 33 TEST_F('DownloadsWebUIDeleteProhibitedTest', 'DeleteProhibited', function() { |
42 this.testHelper(false, false); | 34 this.testHelper(false, false); |
43 // TODO(pamg): Mock out the back-end calls, so we can also test removing a | 35 // TODO(pamg): Mock out the back-end calls, so we can also test removing a |
44 // single item. | 36 // single item. |
45 testDone(); | 37 testDone(); |
46 }); | 38 }); |
OLD | NEW |