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

Unified Diff: chrome/test/data/webui/history_browsertest.js

Issue 591353002: history: fix focus regression when showing "Remove history" confirmation dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 3 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 | « chrome/browser/resources/history/history.js ('k') | ui/webui/resources/js/cr/ui/overlay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/history_browsertest.js
diff --git a/chrome/test/data/webui/history_browsertest.js b/chrome/test/data/webui/history_browsertest.js
index 36cad2925c738ed97ff9509591c3a51d6c41b961..f9a985ed923307b43cf4feab113cd1fb8bfbb00f 100644
--- a/chrome/test/data/webui/history_browsertest.js
+++ b/chrome/test/data/webui/history_browsertest.js
@@ -873,6 +873,41 @@ TEST_F('HistoryWebUIRealBackendTest', 'leftRightChangeFocus', function() {
testDone();
});
+TEST_F('HistoryWebUIRealBackendTest', 'showConfirmDialogAndCancel', function() {
+ waitForCallback('deleteComplete', function() {
+ testDone([false, "history deleted when it shouldn't have been"]);
+ });
+
+ document.querySelector('input[type=checkbox]').click();
+ $('remove-selected').click();
+
+ assertTrue($('alertOverlay').classList.contains('showing'));
+ assertFalse($('history-page').contains(document.activeElement));
+
+ var esc = document.createEvent('KeyboardEvent');
+ esc.initKeyboardEvent('keydown', true, true, window, 'U+001B');
+
+ document.dispatchEvent(esc);
+ assertFalse($('alertOverlay').classList.contains('showing'));
+
+ testDone();
+});
+
+TEST_F('HistoryWebUIRealBackendTest', 'showConfirmDialogAndRemove', function() {
+ document.querySelector('input[type=checkbox]').click();
+ $('remove-selected').click();
+
+ assertTrue($('alertOverlay').classList.contains('showing'));
+ assertFalse($('history-page').contains(document.activeElement));
+
+ waitForCallback('deleteComplete', testDone);
+
+ var enter = document.createEvent('KeyboardEvent');
+ enter.initKeyboardEvent('keydown', true, true, window, 'Enter');
+ document.dispatchEvent(enter);
+ assertFalse($('alertOverlay').classList.contains('showing'));
+});
+
/**
* Fixture for History WebUI testing when deletions are prohibited.
* @extends {HistoryWebUIRealBackendTest}
« no previous file with comments | « chrome/browser/resources/history/history.js ('k') | ui/webui/resources/js/cr/ui/overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698