OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/data/webui/history_ui_browsertest.h"'); | 5 GEN('#include "chrome/test/data/webui/history_ui_browsertest.h"'); |
6 | 6 |
7 /** @const */ var TOTAL_RESULT_COUNT = 160; | 7 /** @const */ var TOTAL_RESULT_COUNT = 160; |
8 /** @const */ var WAIT_TIMEOUT = 200; | 8 /** @const */ var WAIT_TIMEOUT = 200; |
9 | 9 |
10 /** | 10 /** |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 | 866 |
867 var left = document.createEvent('KeyboardEvent'); | 867 var left = document.createEvent('KeyboardEvent'); |
868 left.initKeyboardEvent('keydown', true, true, window, 'Left'); | 868 left.initKeyboardEvent('keydown', true, true, window, 'Left'); |
869 assertEquals('Left', left.keyIdentifier); | 869 assertEquals('Left', left.keyIdentifier); |
870 expectFalse(visit.dropDown.dispatchEvent(left)); | 870 expectFalse(visit.dropDown.dispatchEvent(left)); |
871 | 871 |
872 expectEquals(visit.titleLink, document.activeElement); | 872 expectEquals(visit.titleLink, document.activeElement); |
873 testDone(); | 873 testDone(); |
874 }); | 874 }); |
875 | 875 |
| 876 TEST_F('HistoryWebUIRealBackendTest', 'showConfirmDialogAndCancel', function() { |
| 877 waitForCallback('deleteComplete', function() { |
| 878 testDone([false, "history deleted when it shouldn't have been"]); |
| 879 }); |
| 880 |
| 881 document.querySelector('input[type=checkbox]').click(); |
| 882 $('remove-selected').click(); |
| 883 |
| 884 assertTrue($('alertOverlay').classList.contains('showing')); |
| 885 assertFalse($('history-page').contains(document.activeElement)); |
| 886 |
| 887 var esc = document.createEvent('KeyboardEvent'); |
| 888 esc.initKeyboardEvent('keydown', true, true, window, 'U+001B'); |
| 889 |
| 890 document.dispatchEvent(esc); |
| 891 assertFalse($('alertOverlay').classList.contains('showing')); |
| 892 |
| 893 testDone(); |
| 894 }); |
| 895 |
| 896 TEST_F('HistoryWebUIRealBackendTest', 'showConfirmDialogAndRemove', function() { |
| 897 document.querySelector('input[type=checkbox]').click(); |
| 898 $('remove-selected').click(); |
| 899 |
| 900 assertTrue($('alertOverlay').classList.contains('showing')); |
| 901 assertFalse($('history-page').contains(document.activeElement)); |
| 902 |
| 903 waitForCallback('deleteComplete', testDone); |
| 904 |
| 905 var enter = document.createEvent('KeyboardEvent'); |
| 906 enter.initKeyboardEvent('keydown', true, true, window, 'Enter'); |
| 907 document.dispatchEvent(enter); |
| 908 assertFalse($('alertOverlay').classList.contains('showing')); |
| 909 }); |
| 910 |
876 /** | 911 /** |
877 * Fixture for History WebUI testing when deletions are prohibited. | 912 * Fixture for History WebUI testing when deletions are prohibited. |
878 * @extends {HistoryWebUIRealBackendTest} | 913 * @extends {HistoryWebUIRealBackendTest} |
879 * @constructor | 914 * @constructor |
880 */ | 915 */ |
881 function HistoryWebUIDeleteProhibitedTest() {} | 916 function HistoryWebUIDeleteProhibitedTest() {} |
882 | 917 |
883 HistoryWebUIDeleteProhibitedTest.prototype = { | 918 HistoryWebUIDeleteProhibitedTest.prototype = { |
884 __proto__: HistoryWebUIRealBackendTest.prototype, | 919 __proto__: HistoryWebUIRealBackendTest.prototype, |
885 | 920 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 TEST_F('HistoryWebUIWithSchemesTest', 'groupingWithSchemes', function() { | 1053 TEST_F('HistoryWebUIWithSchemesTest', 'groupingWithSchemes', function() { |
1019 // Switch to the week view. | 1054 // Switch to the week view. |
1020 $('timeframe-filter-week').click(); | 1055 $('timeframe-filter-week').click(); |
1021 waitForCallback('historyResult', function() { | 1056 waitForCallback('historyResult', function() { |
1022 // Each URL should be organized under a different "domain". | 1057 // Each URL should be organized under a different "domain". |
1023 expectEquals(document.querySelectorAll('.entry').length, 4); | 1058 expectEquals(document.querySelectorAll('.entry').length, 4); |
1024 expectEquals(document.querySelectorAll('.site-domain-wrapper').length, 4); | 1059 expectEquals(document.querySelectorAll('.site-domain-wrapper').length, 4); |
1025 testDone(); | 1060 testDone(); |
1026 }); | 1061 }); |
1027 }); | 1062 }); |
OLD | NEW |