| 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 */ |
| 11 function TestClearBrowsingDataBrowserProxy() { | 11 function TestClearBrowsingDataBrowserProxy() { |
| 12 settings.TestBrowserProxy.call( | 12 TestBrowserProxy.call( |
| 13 this, ['initialize', 'clearBrowsingData', 'getImportantSites']); | 13 this, ['initialize', 'clearBrowsingData', 'getImportantSites']); |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * The promise to return from |clearBrowsingData|. | 16 * The promise to return from |clearBrowsingData|. |
| 17 * Allows testing code to test what happens after the call is made, and | 17 * Allows testing code to test what happens after the call is made, and |
| 18 * before the browser responds. | 18 * before the browser responds. |
| 19 * @private {?Promise} | 19 * @private {?Promise} |
| 20 */ | 20 */ |
| 21 this.clearBrowsingDataPromise_ = null; | 21 this.clearBrowsingDataPromise_ = null; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Response for |getImportantSites|. | 24 * Response for |getImportantSites|. |
| 25 * @private {!Array<!ImportantSite>} | 25 * @private {!Array<!ImportantSite>} |
| 26 */ | 26 */ |
| 27 this.importantSites_ = []; | 27 this.importantSites_ = []; |
| 28 } | 28 } |
| 29 | 29 |
| 30 TestClearBrowsingDataBrowserProxy.prototype = { | 30 TestClearBrowsingDataBrowserProxy.prototype = { |
| 31 __proto__: settings.TestBrowserProxy.prototype, | 31 __proto__: TestBrowserProxy.prototype, |
| 32 | 32 |
| 33 /** @param {!Promise} promise */ | 33 /** @param {!Promise} promise */ |
| 34 setClearBrowsingDataPromise: function(promise) { | 34 setClearBrowsingDataPromise: function(promise) { |
| 35 this.clearBrowsingDataPromise_ = promise; | 35 this.clearBrowsingDataPromise_ = promise; |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 /** @override */ | 38 /** @override */ |
| 39 clearBrowsingData: function(importantSites) { | 39 clearBrowsingData: function(importantSites) { |
| 40 this.methodCalled('clearBrowsingData', importantSites); | 40 this.methodCalled('clearBrowsingData', importantSites); |
| 41 cr.webUIListenerCallback('browsing-data-removing', true); | 41 cr.webUIListenerCallback('browsing-data-removing', true); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 registerTests: function() { | 382 registerTests: function() { |
| 383 if (cr.isMac || cr.isWin) | 383 if (cr.isMac || cr.isWin) |
| 384 registerNativeCertificateManagerTests(); | 384 registerNativeCertificateManagerTests(); |
| 385 | 385 |
| 386 registerClearBrowsingDataTests(); | 386 registerClearBrowsingDataTests(); |
| 387 registerPrivacyPageTests(); | 387 registerPrivacyPageTests(); |
| 388 registerSafeBrowsingExtendedReportingTests(); | 388 registerSafeBrowsingExtendedReportingTests(); |
| 389 }, | 389 }, |
| 390 }; | 390 }; |
| 391 }); | 391 }); |
| OLD | NEW |