| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_privacy_page', function() { | 5 cr.define('settings_privacy_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @extends {TestBrowserProxy} | 8 * @extends {TestBrowserProxy} |
| 9 * @implements {settings.PrivacyPageBrowserProxy} | 9 * @implements {settings.PrivacyPageBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 var notice = element.$$('#notice'); | 176 var notice = element.$$('#notice'); |
| 177 assertTrue(!!notice); | 177 assertTrue(!!notice); |
| 178 var noticeActionButton = notice.$$('.action-button'); | 178 var noticeActionButton = notice.$$('.action-button'); |
| 179 assertTrue(!!noticeActionButton); | 179 assertTrue(!!noticeActionButton); |
| 180 | 180 |
| 181 assertTrue(element.$.dialog.open); | 181 assertTrue(element.$.dialog.open); |
| 182 assertTrue(notice.$.dialog.open); | 182 assertTrue(notice.$.dialog.open); |
| 183 | 183 |
| 184 MockInteractions.tap(noticeActionButton); | 184 MockInteractions.tap(noticeActionButton); |
| 185 | 185 |
| 186 // Tapping the action button will close the notice. Move to the | 186 return new Promise(function(resolve, reject) { |
| 187 // end of the message loop to allow the closing event to propagate | 187 // Tapping the action button will close the notice. Move to the |
| 188 // to the parent dialog. The parent dialog should subsequently | 188 // end of the message loop to allow the closing event to |
| 189 // close as well. | 189 // propagate to the parent dialog. The parent dialog should |
| 190 setTimeout(function() { | 190 // subsequently close as well. |
| 191 var notice = element.$$('#notice'); | 191 setTimeout(function() { |
| 192 assertFalse(!!notice); | 192 var notice = element.$$('#notice'); |
| 193 assertFalse(element.$.dialog.open); | 193 assertFalse(!!notice); |
| 194 }, 0); | 194 assertFalse(element.$.dialog.open); |
| 195 resolve(); |
| 196 }, 0); |
| 197 }); |
| 195 }); | 198 }); |
| 196 }); | 199 }); |
| 197 | 200 |
| 198 test('Counters', function() { | 201 test('Counters', function() { |
| 199 assertTrue(element.$.dialog.open); | 202 assertTrue(element.$.dialog.open); |
| 200 | 203 |
| 201 // Initialize the browsing history pref, which should belong to the | 204 // Initialize the browsing history pref, which should belong to the |
| 202 // first checkbox in the dialog. | 205 // first checkbox in the dialog. |
| 203 element.set('prefs', { | 206 element.set('prefs', { |
| 204 browser: { | 207 browser: { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 231 | 234 |
| 232 return { | 235 return { |
| 233 registerTests: function() { | 236 registerTests: function() { |
| 234 if (cr.isMac || cr.isWin) | 237 if (cr.isMac || cr.isWin) |
| 235 registerNativeCertificateManagerTests(); | 238 registerNativeCertificateManagerTests(); |
| 236 | 239 |
| 237 registerClearBrowsingDataTests(); | 240 registerClearBrowsingDataTests(); |
| 238 }, | 241 }, |
| 239 }; | 242 }; |
| 240 }); | 243 }); |
| OLD | NEW |