| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |