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

Unified Diff: chrome/test/data/webui/cr_elements/cr_dialog_test.js

Issue 2884113002: WebUI: Stop keypresses on the close icon from firing the Enter handler. (Closed)
Patch Set: update tests Created 3 years, 7 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 | « no previous file | ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/cr_elements/cr_dialog_test.js
diff --git a/chrome/test/data/webui/cr_elements/cr_dialog_test.js b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
index 7a8c3b548a9230343c8130a1386749c2fa359ace..2aa8952fbc554e6e975beacc9163ae942fd66586 100644
--- a/chrome/test/data/webui/cr_elements/cr_dialog_test.js
+++ b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
@@ -51,6 +51,10 @@ suite('cr-dialog', function() {
clickedCounter++;
});
+ // Enter key on the action button should only fire the click handler once.
+ MockInteractions.tap(actionButton, 'keypress', 13, undefined, 'Enter');
+ assertEquals(1, clickedCounter);
+
// Enter keys on other buttons should be ignored.
clickedCounter = 0;
var otherButton = document.body.querySelector('#other-button');
@@ -58,9 +62,9 @@ suite('cr-dialog', function() {
pressEnter(otherButton);
assertEquals(0, clickedCounter);
- // Enter key on the action button should only fire the click handler once.
- MockInteractions.tap(actionButton, 'keypress', 13, undefined, 'Enter');
- assertEquals(1, clickedCounter);
+ // Enter keys on the close icon in the top-right corner should be ignored.
+ pressEnter(dialog.getCloseButton());
+ assertEquals(0, clickedCounter);
});
test('enter keys find the first non-hidden non-disabled button', function() {
« no previous file with comments | « no previous file | ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698