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

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

Issue 2375223002: md-settings: Fix back navigation from /resetProfileSettings. (Closed)
Patch Set: Fixed promise chains Created 4 years, 2 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 964c26bb6ce25cd5c870acd1fc723eb4f6dc90b0..f8d091afffaea70add4cae481e0801384bf185c4 100644
--- a/chrome/test/data/webui/settings/reset_page_test.js
+++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -86,26 +86,33 @@ cr.define('settings_reset_page', function() {
// Tests that the reset profile banner
// - opens the reset profile dialog when the reset button is clicked.
+ // - reset happens when clicking on the dialog's reset button.
// - the reset profile dialog is closed after reset is done.
test(TestNames.ResetBannerReset, function() {
var dialog = resetBanner.$$('settings-reset-profile-dialog');
assertFalse(!!dialog);
- MockInteractions.tap(resetBanner.$['reset']);
+ MockInteractions.tap(resetBanner.$.reset);
Polymer.dom.flush();
+ assertTrue(resetBanner.showResetProfileDialog_)
dialog = resetBanner.$$('settings-reset-profile-dialog');
assertTrue(!!dialog);
- dialog.fire('reset-done');
- Polymer.dom.flush();
- assertEquals('none', dialog.style.display);
- return Promise.resolve();
+ MockInteractions.tap(dialog.$.reset);
+
+ return browserProxy.whenCalled('performResetProfileSettings')
+ .then(flush)
+ .then(function() {
+ assertFalse(resetBanner.showResetProfileDialog_);
+ dialog = resetBanner.$$('settings-reset-profile-dialog');
+ assertFalse(!!dialog);
+ });
});
// Tests that the reset profile banner removes itself from the DOM when
// the close button is clicked and that |onHideResetProfileBanner| is
// called.
test(TestNames.ResetBannerClose, function() {
- MockInteractions.tap(resetBanner.$['close']);
+ MockInteractions.tap(resetBanner.$.close);
assertFalse(!!resetBanner.parentNode);
return browserProxy.whenCalled('onHideResetProfileBanner');
});
@@ -177,7 +184,7 @@ cr.define('settings_reset_page', function() {
return testOpenCloseResetProfileDialog(function(dialog) {
// Test case where the 'cancel' button is clicked.
MockInteractions.tap(dialog.$.cancel);
- }).then(function() {
+ }).then(flush).then(function() {
return testOpenCloseResetProfileDialog(function(dialog) {
// Test case where the 'close' button is clicked.
MockInteractions.tap(dialog.$.dialog.getCloseButton());

Powered by Google App Engine
This is Rietveld 408576698