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

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

Issue 1758973002: MD Settings: Creating a <settings-dialog> element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra blank line Created 4 years, 10 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
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 24457187da9202670e24fd37edd7f7706f4a07ab..8eac5929f536c90bdfa0b5019053b75f4341ef0f 100644
--- a/chrome/test/data/webui/settings/reset_page_test.js
+++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -93,11 +93,12 @@ cr.define('settings_reset_page', function() {
/**
- * @param {string} closeButtonId The ID of the button that closes the
- * dialog.
+ * @param {function(SettingsResetProfileDialogElemeent):!Element}
+ * closeButtonFn A function that returns the button to be used for
+ * closing the dialog.
* @return {!Promise}
*/
- function testOpenCloseResetProfileDialog(closeButtonId) {
+ function testOpenCloseResetProfileDialog(closeButtonFn) {
var onShowResetProfileDialogCalled = whenChromeSendCalled(
'onShowResetProfileDialog');
var onHideResetProfileDialogCalled = whenChromeSendCalled(
@@ -111,7 +112,7 @@ cr.define('settings_reset_page', function() {
dialog.addEventListener('iron-overlay-closed', resolve);
});
- MockInteractions.tap(dialog.$[closeButtonId]);
+ MockInteractions.tap(closeButtonFn(dialog));
return Promise.all([
onShowResetProfileDialogCalled,
@@ -125,9 +126,11 @@ cr.define('settings_reset_page', function() {
test(TestNames.ResetProfileDialogOpenClose, function() {
return Promise.all([
// Test case where the 'cancel' button is clicked.
- testOpenCloseResetProfileDialog('cancel'),
+ testOpenCloseResetProfileDialog(
+ function(dialog) { return dialog.$.cancel;}),
// Test case where the 'close' button is clicked.
- testOpenCloseResetProfileDialog('close')
+ testOpenCloseResetProfileDialog(
+ function(dialog) { return dialog.$.dialog.getCloseButton(); }),
]);
});
@@ -144,11 +147,12 @@ cr.define('settings_reset_page', function() {
if (cr.isChromeOS) {
/**
- * @param {string} closeButtonId The ID of the button that closes the
- * dialog.
+ * @param {function(SettingsPowerwashDialogElemeent):!Element}
+ * closeButtonFn A function that returns the button to be used for
+ * closing the dialog.
* @return {!Promise}
*/
- function testOpenClosePowerwashDialog(closeButtonId) {
+ function testOpenClosePowerwashDialog(closeButtonFn) {
var onPowerwashDialogShowCalled = whenChromeSendCalled(
'onPowerwashDialogShow');
@@ -160,7 +164,7 @@ cr.define('settings_reset_page', function() {
dialog.addEventListener('iron-overlay-closed', resolve);
});
- MockInteractions.tap(dialog.$[closeButtonId]);
+ MockInteractions.tap(closeButtonFn(dialog));
return Promise.all([onPowerwashDialogShowCalled, onDialogClosed]);
}
@@ -169,9 +173,11 @@ cr.define('settings_reset_page', function() {
test(TestNames.PowerwashDialogOpenClose, function() {
return Promise.all([
// Test case where the 'cancel' button is clicked.
- testOpenClosePowerwashDialog('cancel'),
+ testOpenClosePowerwashDialog(
+ function(dialog) { return dialog.$.cancel; }),
// Test case where the 'close' button is clicked.
- testOpenClosePowerwashDialog('close')
+ testOpenClosePowerwashDialog(
+ function(dialog) { return dialog.$.dialog.getCloseButton(); }),
]);
});
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | chrome/test/data/webui/settings/search_engines_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698