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

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

Issue 2722083003: MD Settings: Change "view reported settings" string. (Closed)
Patch Set: Add test. Created 3 years, 9 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/md_settings_localized_strings_provider.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 ResetProfileDialogAction: 'ResetProfileDialogAction', 10 ResetProfileDialogAction: 'ResetProfileDialogAction',
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // Tests that when user request to reset the profile the appropriate 93 // Tests that when user request to reset the profile the appropriate
94 // message is sent to the browser. 94 // message is sent to the browser.
95 test(TestNames.ResetProfileDialogAction, function() { 95 test(TestNames.ResetProfileDialogAction, function() {
96 // Open reset profile dialog. 96 // Open reset profile dialog.
97 MockInteractions.tap(resetPage.$.resetProfile); 97 MockInteractions.tap(resetPage.$.resetProfile);
98 Polymer.dom.flush(); 98 Polymer.dom.flush();
99 var dialog = resetPage.$$('settings-reset-profile-dialog'); 99 var dialog = resetPage.$$('settings-reset-profile-dialog');
100 assertTrue(!!dialog); 100 assertTrue(!!dialog);
101 101
102 var checkbox = dialog.$$('.footer paper-checkbox');
103 assertTrue(checkbox.checked);
102 var showReportedSettingsLink = dialog.$$('.footer a'); 104 var showReportedSettingsLink = dialog.$$('.footer a');
103 assertTrue(!!showReportedSettingsLink); 105 assertTrue(!!showReportedSettingsLink);
104 MockInteractions.tap(showReportedSettingsLink); 106 MockInteractions.tap(showReportedSettingsLink);
105 107
106 return resetPageBrowserProxy.whenCalled('showReportedSettings').then( 108 return resetPageBrowserProxy.whenCalled('showReportedSettings').then(
107 function() { 109 function() {
110 // Ensure that the checkbox was not toggled as a result of
111 // clicking the link.
112 assertTrue(checkbox.checked);
108 assertFalse(dialog.$.reset.disabled); 113 assertFalse(dialog.$.reset.disabled);
109 assertFalse(dialog.$.resetSpinner.active); 114 assertFalse(dialog.$.resetSpinner.active);
110 MockInteractions.tap(dialog.$.reset); 115 MockInteractions.tap(dialog.$.reset);
111 assertTrue(dialog.$.reset.disabled); 116 assertTrue(dialog.$.reset.disabled);
112 assertTrue(dialog.$.cancel.disabled); 117 assertTrue(dialog.$.cancel.disabled);
113 assertTrue(dialog.$.resetSpinner.active); 118 assertTrue(dialog.$.resetSpinner.active);
114 return resetPageBrowserProxy.whenCalled( 119 return resetPageBrowserProxy.whenCalled(
115 'performResetProfileSettings'); 120 'performResetProfileSettings');
116 }); 121 });
117 }); 122 });
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 assertTrue(!!dialog); 204 assertTrue(!!dialog);
200 MockInteractions.tap(dialog.$.powerwash); 205 MockInteractions.tap(dialog.$.powerwash);
201 return lifetimeBrowserProxy.whenCalled('factoryReset'); 206 return lifetimeBrowserProxy.whenCalled('factoryReset');
202 }); 207 });
203 } 208 }
204 }); 209 });
205 } 210 }
206 211
207 registerDialogTests(); 212 registerDialogTests();
208 }); 213 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698