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

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

Issue 2375223002: md-settings: Fix back navigation from /resetProfileSettings. (Closed)
Patch Set: Fix failing test. 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
« no previous file with comments | « chrome/test/data/webui/polymer_browser_test_base.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 964c26bb6ce25cd5c870acd1fc723eb4f6dc90b0..9fa0cb1232184d4b20ae96ba065e0103276dcc87 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(PolymerTest.flushTasks)
+ .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');
});
@@ -160,14 +167,16 @@ cr.define('settings_reset_page', function() {
});
});
- return resetPageBrowserProxy.whenCalled(
- 'onShowResetProfileDialog').then(function() {
- assertTrue(dialog.$.dialog.open);
- closeDialogFn(dialog);
- return Promise.all([
- onDialogClosed,
- resetPageBrowserProxy.whenCalled('onHideResetProfileDialog'),
- ]);
+ return PolymerTest.flushTasks().then(function() {
+ resetPageBrowserProxy.whenCalled('onShowResetProfileDialog')
+ .then(function() {
+ assertTrue(dialog.$.dialog.open);
+ closeDialogFn(dialog);
+ return Promise.all([
+ onDialogClosed,
+ resetPageBrowserProxy.whenCalled('onHideResetProfileDialog'),
+ ]);
+ });
});
}
@@ -177,7 +186,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(PolymerTest.flushTasks).then(function() {
return testOpenCloseResetProfileDialog(function(dialog) {
// Test case where the 'close' button is clicked.
MockInteractions.tap(dialog.$.dialog.getCloseButton());
« no previous file with comments | « chrome/test/data/webui/polymer_browser_test_base.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698