OLD | NEW |
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 var dialog = resetPage.$$('settings-reset-profile-dialog'); | 125 var dialog = resetPage.$$('settings-reset-profile-dialog'); |
126 assertTrue(!!dialog); | 126 assertTrue(!!dialog); |
127 MockInteractions.tap(dialog.$.reset); | 127 MockInteractions.tap(dialog.$.reset); |
128 return resetPageBrowserProxy.whenCalled( | 128 return resetPageBrowserProxy.whenCalled( |
129 'performResetProfileSettings').then(function(resetRequest) { | 129 'performResetProfileSettings').then(function(resetRequest) { |
130 assertEquals(expectedOrigin, resetRequest); | 130 assertEquals(expectedOrigin, resetRequest); |
131 }); | 131 }); |
132 } | 132 } |
133 | 133 |
134 test(TestNames.ResetProfileDialogOriginUnknown, function() { | 134 test(TestNames.ResetProfileDialogOriginUnknown, function() { |
135 settings.navigateTo(settings.Route.RESET_DIALOG); | 135 settings.navigateTo(settings.routes.RESET_DIALOG); |
136 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') | 136 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') |
137 .then(function() { return testResetRequestOrigin(''); }); | 137 .then(function() { return testResetRequestOrigin(''); }); |
138 }); | 138 }); |
139 | 139 |
140 test(TestNames.ResetProfileDialogOriginUserClick, function() { | 140 test(TestNames.ResetProfileDialogOriginUserClick, function() { |
141 MockInteractions.tap(resetPage.$.resetProfile); | 141 MockInteractions.tap(resetPage.$.resetProfile); |
142 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') | 142 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') |
143 .then(function() { return testResetRequestOrigin('userclick'); }); | 143 .then(function() { return testResetRequestOrigin('userclick'); }); |
144 }); | 144 }); |
145 | 145 |
146 test(TestNames.ResetProfileDialogOriginTriggeredReset, function() { | 146 test(TestNames.ResetProfileDialogOriginTriggeredReset, function() { |
147 settings.navigateTo(settings.Route.TRIGGERED_RESET_DIALOG); | 147 settings.navigateTo(settings.routes.TRIGGERED_RESET_DIALOG); |
148 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') | 148 return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') |
149 .then(function() { | 149 .then(function() { |
150 return testResetRequestOrigin('triggeredreset'); | 150 return testResetRequestOrigin('triggeredreset'); |
151 }); | 151 }); |
152 }); | 152 }); |
153 | 153 |
154 if (cr.isChromeOS) { | 154 if (cr.isChromeOS) { |
155 /** | 155 /** |
156 * @param {function(SettingsPowerwashDialogElemeent):!Element} | 156 * @param {function(SettingsPowerwashDialogElemeent):!Element} |
157 * closeButtonFn A function that returns the button to be used for | 157 * closeButtonFn A function that returns the button to be used for |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 assertTrue(!!dialog); | 204 assertTrue(!!dialog); |
205 MockInteractions.tap(dialog.$.powerwash); | 205 MockInteractions.tap(dialog.$.powerwash); |
206 return lifetimeBrowserProxy.whenCalled('factoryReset'); | 206 return lifetimeBrowserProxy.whenCalled('factoryReset'); |
207 }); | 207 }); |
208 } | 208 } |
209 }); | 209 }); |
210 } | 210 } |
211 | 211 |
212 registerDialogTests(); | 212 registerDialogTests(); |
213 }); | 213 }); |
OLD | NEW |