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

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

Issue 2676643005: MD Settings: Fix reset_page_test.js in Vulcanized mode (Closed)
Patch Set: Un-unwrap 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
new file mode 100644
index 0000000000000000000000000000000000000000..811bc99c1090afa9e05a9c20fc4aa31101f40bfe
--- /dev/null
+++ b/chrome/test/data/webui/settings/reset_profile_banner_test.js
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+suite('BannerTests', function() {
+ var resetBanner = null;
+ var browserProxy = null;
+
+ setup(function() {
+ browserProxy = new reset_page.TestResetBrowserProxy();
+ settings.ResetBrowserProxyImpl.instance_ = browserProxy;
+ PolymerTest.clearBody();
+ resetBanner = document.createElement('settings-reset-profile-banner');
+ document.body.appendChild(resetBanner);
+ });
+
+ 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.
+ test('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);
+
+ 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('ResetBannerClose', function() {
+ MockInteractions.tap(resetBanner.$.close);
+ assertFalse(!!resetBanner.parentNode);
+ return browserProxy.whenCalled('onHideResetProfileBanner');
+ });
+});
« no previous file with comments | « chrome/test/data/webui/settings/reset_page_test.js ('k') | chrome/test/data/webui/settings/test_reset_browser_proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698