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

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

Issue 2375223002: md-settings: Fix back navigation from /resetProfileSettings. (Closed)
Patch Set: Updated tests. Created 4 years, 3 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') | chrome/test/data/webui/test_util.js » ('j') | 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..98edfbd688580baf3a2e8048a5f2ec72e215248c 100644
--- a/chrome/test/data/webui/settings/reset_page_test.js
+++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -86,19 +86,25 @@ 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']);
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']);
tommycli 2016/10/03 20:47:46 nit: the dialog.$['foo'] pattern seems odd. Any re
alito 2016/10/03 23:27:17 No particular reason. I was just following the sam
+ flush().then(function() {
tommycli 2016/10/03 20:47:46 I wonder if this the then() may be skipped in some
alito 2016/10/03 23:27:17 I think your suggestion seems safer so I've change
+ assertFalse(resetBanner.showResetProfileDialog_);
+ dialog = resetBanner.$$('settings-reset-profile-dialog');
+ assertFalse(!!dialog);
+ });
+
+ return browserProxy.whenCalled('performResetProfileSettings');
});
// Tests that the reset profile banner removes itself from the DOM when
@@ -178,9 +184,11 @@ cr.define('settings_reset_page', function() {
// Test case where the 'cancel' button is clicked.
MockInteractions.tap(dialog.$.cancel);
}).then(function() {
- return testOpenCloseResetProfileDialog(function(dialog) {
- // Test case where the 'close' button is clicked.
- MockInteractions.tap(dialog.$.dialog.getCloseButton());
+ return flush().then(function() {
tommycli 2016/10/03 20:47:46 nit: i think we can linearize the promise chain li
alito 2016/10/03 23:27:17 Done.
+ 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/settings/cr_settings_browsertest.js ('k') | chrome/test/data/webui/test_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698