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.ClearBrowsingDataBrowserProxy} | 9 * @implements {settings.ClearBrowsingDataBrowserProxy} |
10 */ | 10 */ |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 page = document.createElement('settings-privacy-page'); | 253 page = document.createElement('settings-privacy-page'); |
254 }); | 254 }); |
255 | 255 |
256 teardown(function() { page.remove(); }); | 256 teardown(function() { page.remove(); }); |
257 | 257 |
258 test('test whether extended reporting is enabled/managed', function() { | 258 test('test whether extended reporting is enabled/managed', function() { |
259 return testBrowserProxy.whenCalled( | 259 return testBrowserProxy.whenCalled( |
260 'getSafeBrowsingExtendedReporting').then(function() { | 260 'getSafeBrowsingExtendedReporting').then(function() { |
261 Polymer.dom.flush(); | 261 Polymer.dom.flush(); |
262 | 262 |
263 // Checkbox starts checked by default | 263 // Control starts checked by default |
264 var checkbox = page.$.safeBrowsingExtendedReportingCheckbox; | 264 var control = page.$.safeBrowsingExtendedReportingControl; |
265 assertEquals(true, checkbox.checked); | 265 assertEquals(true, control.checked); |
266 | 266 |
267 // Notification from browser can uncheck the box | 267 // Notification from browser can uncheck the box |
268 cr.webUIListenerCallback('safe-browsing-extended-reporting-change', | 268 cr.webUIListenerCallback('safe-browsing-extended-reporting-change', |
269 false); | 269 false); |
270 Polymer.dom.flush(); | 270 Polymer.dom.flush(); |
271 assertEquals(false, checkbox.checked); | 271 assertEquals(false, control.checked); |
272 | 272 |
273 // Tapping on the box will check it again. | 273 // Tapping on the box will check it again. |
274 MockInteractions.tap(checkbox); | 274 MockInteractions.tap(control); |
275 return testBrowserProxy.whenCalled('getSafeBrowsingExtendedReporting', | 275 return testBrowserProxy.whenCalled('getSafeBrowsingExtendedReporting', |
276 true); | 276 true); |
277 }); | 277 }); |
278 }); | 278 }); |
279 }); | 279 }); |
280 } | 280 } |
281 | 281 |
282 return { | 282 return { |
283 registerTests: function() { | 283 registerTests: function() { |
284 if (cr.isMac || cr.isWin) | 284 if (cr.isMac || cr.isWin) |
285 registerNativeCertificateManagerTests(); | 285 registerNativeCertificateManagerTests(); |
286 | 286 |
287 registerClearBrowsingDataTests(); | 287 registerClearBrowsingDataTests(); |
288 registerPrivacyPageTests(); | 288 registerPrivacyPageTests(); |
289 registerSafeBrowsingExtendedReportingTests(); | 289 registerSafeBrowsingExtendedReportingTests(); |
290 }, | 290 }, |
291 }; | 291 }; |
292 }); | 292 }); |
OLD | NEW |