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

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: add a test 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..eca65fb31485e0e770f461a9c3eef896f5a96d1a 100644
--- a/chrome/test/data/webui/cr_elements/cr_dialog_test.js
+++ b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
@@ -58,6 +58,12 @@ suite('cr-dialog', function() {
pressEnter(otherButton);
assertEquals(0, clickedCounter);
+ // Enter keys on the close icon in the top-right corner should be ignored.
+ var closeButton = document.body.querySelector('* /deep/ #close');
dpapad 2017/05/15 23:38:56 Can we use dialog.getCloseButton() instead? See ht
tommycli 2017/05/15 23:43:04 Done.
+ assertTrue(!!closeButton);
+ pressEnter(closeButton);
+ assertEquals(0, clickedCounter);
+
// Enter key on the action button should only fire the click handler once.
MockInteractions.tap(actionButton, 'keypress', 13, undefined, 'Enter');
dpapad 2017/05/15 23:38:56 Is the dialog closed (because of the code added ab
tommycli 2017/05/15 23:43:04 I reordered the tests just to be safe.
assertEquals(1, clickedCounter);
« 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