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

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

Issue 2625263002: MD Settings: Convert reset profile banner to a dialog. (Closed)
Patch Set: Nit. Created 3 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_profile_banner_test.js
diff --git a/chrome/test/data/webui/settings/reset_profile_banner_test.js b/chrome/test/data/webui/settings/reset_profile_banner_test.js
index 811bc99c1090afa9e05a9c20fc4aa31101f40bfe..a01829a9b6e03f0c1b7db90c639d798a5aa5ddf8 100644
--- a/chrome/test/data/webui/settings/reset_profile_banner_test.js
+++ b/chrome/test/data/webui/settings/reset_profile_banner_test.js
@@ -12,40 +12,26 @@ suite('BannerTests', function() {
PolymerTest.clearBody();
resetBanner = document.createElement('settings-reset-profile-banner');
document.body.appendChild(resetBanner);
+ assertTrue(resetBanner.$.dialog.open);
});
teardown(function() { resetBanner.remove(); });
- // 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.
+ // Tests that the reset profile banner navigates to the Reset profile dialog
+ // URL when the "reset all settings" button is clicked.
test('ResetBannerReset', function() {
- var dialog = resetBanner.$$('settings-reset-profile-dialog');
- assertFalse(!!dialog);
+ assertNotEquals(settings.Route.RESET_DIALOG, settings.getCurrentRoute());
MockInteractions.tap(resetBanner.$.reset);
- Polymer.dom.flush();
- assertTrue(resetBanner.showResetProfileDialog_)
- dialog = resetBanner.$$('settings-reset-profile-dialog');
- assertTrue(!!dialog);
-
- MockInteractions.tap(dialog.$.reset);
-
- return browserProxy.whenCalled('performResetProfileSettings')
- .then(PolymerTest.flushTasks)
- .then(function() {
- assertFalse(resetBanner.showResetProfileDialog_);
- dialog = resetBanner.$$('settings-reset-profile-dialog');
- assertFalse(!!dialog);
- });
+ assertEquals(settings.Route.RESET_DIALOG, settings.getCurrentRoute());
+ assertFalse(resetBanner.$.dialog.open);
});
- // Tests that the reset profile banner removes itself from the DOM when
- // the close button is clicked and that |onHideResetProfileBanner| is
- // called.
- test('ResetBannerClose', function() {
- MockInteractions.tap(resetBanner.$.close);
- assertFalse(!!resetBanner.parentNode);
- return browserProxy.whenCalled('onHideResetProfileBanner');
+ // Tests that the reset profile banner closes itself when the OK button is
+ // clicked and that |onHideResetProfileBanner| is called.
+ test('ResetBannerOk', function() {
+ MockInteractions.tap(resetBanner.$.ok);
+ return browserProxy.whenCalled('onHideResetProfileBanner').then(function() {
+ assertFalse(resetBanner.$.dialog.open);
+ });
});
});

Powered by Google App Engine
This is Rietveld 408576698