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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 suite('BannerTests', function() {
6 var resetBanner = null;
7 var browserProxy = null;
8
9 setup(function() {
10 browserProxy = new reset_page.TestResetBrowserProxy();
11 settings.ResetBrowserProxyImpl.instance_ = browserProxy;
12 PolymerTest.clearBody();
13 resetBanner = document.createElement('settings-reset-profile-banner');
14 document.body.appendChild(resetBanner);
15 });
16
17 teardown(function() { resetBanner.remove(); });
18
19 // Tests that the reset profile banner
20 // - opens the reset profile dialog when the reset button is clicked.
21 // - reset happens when clicking on the dialog's reset button.
22 // - the reset profile dialog is closed after reset is done.
23 test('ResetBannerReset', function() {
24 var dialog = resetBanner.$$('settings-reset-profile-dialog');
25 assertFalse(!!dialog);
26 MockInteractions.tap(resetBanner.$.reset);
27 Polymer.dom.flush();
28 assertTrue(resetBanner.showResetProfileDialog_)
29 dialog = resetBanner.$$('settings-reset-profile-dialog');
30 assertTrue(!!dialog);
31
32 MockInteractions.tap(dialog.$.reset);
33
34 return browserProxy.whenCalled('performResetProfileSettings')
35 .then(PolymerTest.flushTasks)
36 .then(function() {
37 assertFalse(resetBanner.showResetProfileDialog_);
38 dialog = resetBanner.$$('settings-reset-profile-dialog');
39 assertFalse(!!dialog);
40 });
41 });
42
43 // Tests that the reset profile banner removes itself from the DOM when
44 // the close button is clicked and that |onHideResetProfileBanner| is
45 // called.
46 test('ResetBannerClose', function() {
47 MockInteractions.tap(resetBanner.$.close);
48 assertFalse(!!resetBanner.parentNode);
49 return browserProxy.whenCalled('onHideResetProfileBanner');
50 });
51 });
OLDNEW
« 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