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

Side by Side Diff: chrome/test/data/webui/settings/reset_page_test.js

Issue 1911573003: MD Settings: Reset profile dialog, display settings in new tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 8 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
« no previous file with comments | « chrome/browser/ui/webui/settings/reset_settings_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('settings_reset_page', function() { 5 cr.define('settings_reset_page', function() {
6 /** @enum {string} */ 6 /** @enum {string} */
7 var TestNames = { 7 var TestNames = {
8 PowerwashDialogAction: 'PowerwashDialogAction', 8 PowerwashDialogAction: 'PowerwashDialogAction',
9 PowerwashDialogOpenClose: 'PowerwashDialogOpenClose', 9 PowerwashDialogOpenClose: 'PowerwashDialogOpenClose',
10 ResetBannerClose: 'ResetBannerClose', 10 ResetBannerClose: 'ResetBannerClose',
11 ResetBannerReset: 'ResetBannerReset', 11 ResetBannerReset: 'ResetBannerReset',
12 ResetProfileDialogAction: 'ResetProfileDialogAction', 12 ResetProfileDialogAction: 'ResetProfileDialogAction',
13 ResetProfileDialogOpenClose: 'ResetProfileDialogOpenClose', 13 ResetProfileDialogOpenClose: 'ResetProfileDialogOpenClose',
14 }; 14 };
15 15
16 /** 16 /**
17 * @constructor 17 * @constructor
18 * @implements {settings.ResetBrowserProxy} 18 * @implements {settings.ResetBrowserProxy}
19 * @extends {settings.TestBrowserProxy} 19 * @extends {settings.TestBrowserProxy}
20 */ 20 */
21 var TestResetBrowserProxy = function() { 21 var TestResetBrowserProxy = function() {
22 settings.TestBrowserProxy.call(this, [ 22 settings.TestBrowserProxy.call(this, [
23 'performResetProfileSettings', 23 'performResetProfileSettings',
24 'onHideResetProfileDialog', 24 'onHideResetProfileDialog',
25 'onHideResetProfileBanner', 25 'onHideResetProfileBanner',
26 'onShowResetProfileDialog', 26 'onShowResetProfileDialog',
27 'getReportedSettings',
27 'onPowerwashDialogShow', 28 'onPowerwashDialogShow',
28 'requestFactoryResetRestart', 29 'requestFactoryResetRestart',
29 ]); 30 ]);
30 }; 31 };
31 32
32 TestResetBrowserProxy.prototype = { 33 TestResetBrowserProxy.prototype = {
33 __proto__: settings.TestBrowserProxy.prototype, 34 __proto__: settings.TestBrowserProxy.prototype,
34 35
35 /** @override */ 36 /** @override */
36 performResetProfileSettings: function(sendSettings) { 37 performResetProfileSettings: function(sendSettings) {
(...skipping 10 matching lines...) Expand all
47 onHideResetProfileBanner: function() { 48 onHideResetProfileBanner: function() {
48 this.methodCalled('onHideResetProfileBanner'); 49 this.methodCalled('onHideResetProfileBanner');
49 }, 50 },
50 51
51 /** @override */ 52 /** @override */
52 onShowResetProfileDialog: function() { 53 onShowResetProfileDialog: function() {
53 this.methodCalled('onShowResetProfileDialog'); 54 this.methodCalled('onShowResetProfileDialog');
54 }, 55 },
55 56
56 /** @override */ 57 /** @override */
58 getReportedSettings: function() {
59 this.methodCalled('getReportedSettings');
60 return Promise.resolve([]);
61 },
62
63 /** @override */
57 onPowerwashDialogShow: function() { 64 onPowerwashDialogShow: function() {
58 this.methodCalled('onPowerwashDialogShow'); 65 this.methodCalled('onPowerwashDialogShow');
59 }, 66 },
60 67
61 /** @override */ 68 /** @override */
62 requestFactoryResetRestart: function() { 69 requestFactoryResetRestart: function() {
63 this.methodCalled('requestFactoryResetRestart'); 70 this.methodCalled('requestFactoryResetRestart');
64 }, 71 },
65 }; 72 };
66 73
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 ]); 184 ]);
178 }); 185 });
179 186
180 // Tests that when user request to reset the profile the appropriate 187 // Tests that when user request to reset the profile the appropriate
181 // message is sent to the browser. 188 // message is sent to the browser.
182 test(TestNames.ResetProfileDialogAction, function() { 189 test(TestNames.ResetProfileDialogAction, function() {
183 // Open reset profile dialog. 190 // Open reset profile dialog.
184 MockInteractions.tap(resetPage.$.resetProfile); 191 MockInteractions.tap(resetPage.$.resetProfile);
185 var dialog = resetPage.$$('settings-reset-profile-dialog'); 192 var dialog = resetPage.$$('settings-reset-profile-dialog');
186 assertTrue(!!dialog); 193 assertTrue(!!dialog);
187 MockInteractions.tap(dialog.$.reset); 194
188 return browserProxy.whenCalled('performResetProfileSettings'); 195 var showReportedSettingsButton = dialog.$$('iron-icon');
196 assertTrue(!!showReportedSettingsButton);
197 MockInteractions.tap(showReportedSettingsButton);
198
199 return browserProxy.whenCalled('getReportedSettings').then(function() {
200 MockInteractions.tap(dialog.$.reset);
201 return browserProxy.whenCalled('performResetProfileSettings');
202 });
189 }); 203 });
190 204
191 if (cr.isChromeOS) { 205 if (cr.isChromeOS) {
192 /** 206 /**
193 * @param {function(SettingsPowerwashDialogElemeent):!Element} 207 * @param {function(SettingsPowerwashDialogElemeent):!Element}
194 * closeButtonFn A function that returns the button to be used for 208 * closeButtonFn A function that returns the button to be used for
195 * closing the dialog. 209 * closing the dialog.
196 * @return {!Promise} 210 * @return {!Promise}
197 */ 211 */
198 function testOpenClosePowerwashDialog(closeButtonFn) { 212 function testOpenClosePowerwashDialog(closeButtonFn) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 }); 253 });
240 } 254 }
241 255
242 return { 256 return {
243 registerTests: function() { 257 registerTests: function() {
244 registerBannerTests(); 258 registerBannerTests();
245 registerDialogTests(); 259 registerDialogTests();
246 }, 260 },
247 }; 261 };
248 }); 262 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/reset_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698