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

Unified Diff: chrome/test/data/webui/settings/reset_page_test.js

Issue 1822813002: MD Settings: Make <settings-dialog> respond to ESC key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ESC to Esc again. Created 4 years, 9 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/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/reset_page_test.js
diff --git a/chrome/test/data/webui/settings/reset_page_test.js b/chrome/test/data/webui/settings/reset_page_test.js
index 8eac5929f536c90bdfa0b5019053b75f4341ef0f..ae0714bc295e6af1e336d32328b2b6bb14a14596 100644
--- a/chrome/test/data/webui/settings/reset_page_test.js
+++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -93,12 +93,11 @@ cr.define('settings_reset_page', function() {
/**
- * @param {function(SettingsResetProfileDialogElemeent):!Element}
- * closeButtonFn A function that returns the button to be used for
- * closing the dialog.
+ * @param {function(SettingsResetProfileDialogElemeent)}
+ * closeDialogFn A function to call for closing the dialog.
* @return {!Promise}
*/
- function testOpenCloseResetProfileDialog(closeButtonFn) {
+ function testOpenCloseResetProfileDialog(closeDialogFn) {
var onShowResetProfileDialogCalled = whenChromeSendCalled(
'onShowResetProfileDialog');
var onHideResetProfileDialogCalled = whenChromeSendCalled(
@@ -112,7 +111,7 @@ cr.define('settings_reset_page', function() {
dialog.addEventListener('iron-overlay-closed', resolve);
});
- MockInteractions.tap(closeButtonFn(dialog));
+ closeDialogFn(dialog);
return Promise.all([
onShowResetProfileDialogCalled,
@@ -127,10 +126,20 @@ cr.define('settings_reset_page', function() {
return Promise.all([
// Test case where the 'cancel' button is clicked.
testOpenCloseResetProfileDialog(
- function(dialog) { return dialog.$.cancel;}),
+ function(dialog) {
+ MockInteractions.tap(dialog.$.cancel);
+ }),
// Test case where the 'close' button is clicked.
testOpenCloseResetProfileDialog(
- function(dialog) { return dialog.$.dialog.getCloseButton(); }),
+ function(dialog) {
+ MockInteractions.tap(dialog.$.dialog.getCloseButton());
+ }),
+ // Test case where the 'Esc' key is pressed.
+ testOpenCloseResetProfileDialog(
+ function(dialog) {
+ MockInteractions.pressAndReleaseKeyOn(
+ dialog, 27 /* 'Esc' key code */);
+ }),
]);
});
@@ -196,7 +205,9 @@ cr.define('settings_reset_page', function() {
}
return {
- registerBannerTests: registerBannerTests,
- registerDialogTests: registerDialogTests
+ registerTests: function() {
+ registerBannerTests();
+ registerDialogTests();
+ },
};
});
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698