| 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 */ |
| 11 function TestPrivacyPageBrowserProxy() { | 11 function TestPrivacyPageBrowserProxy() { |
| 12 settings.TestBrowserProxy.call(this, ['showManageSSLCertificates']); | 12 settings.TestBrowserProxy.call(this, ['showManageSSLCertificates']); |
| 13 } | 13 } |
| 14 | 14 |
| 15 TestPrivacyPageBrowserProxy.prototype = { | 15 TestPrivacyPageBrowserProxy.prototype = { |
| 16 __proto__: settings.TestBrowserProxy.prototype, | 16 __proto__: settings.TestBrowserProxy.prototype, |
| 17 | 17 |
| 18 /** @override */ | 18 /** @override */ |
| 19 showManageSSLCertificates: function() { | 19 showManageSSLCertificates: function() { |
| 20 this.methodCalled('showManageSSLCertificates'); | 20 this.methodCalled('showManageSSLCertificates'); |
| 21 }, | 21 }, |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @constructor | 25 * @constructor |
| 26 * @extends {TestBrowserProxy} | 26 * @extends {TestBrowserProxy} |
| 27 * @implements {settings.ClearBrowsingDataBrowserProxy} | 27 * @implements {settings.ClearBrowsingDataBrowserProxy} |
| 28 */ | 28 */ |
| 29 function TestClearBrowsingDataBrowserProxy() { | 29 function TestClearBrowsingDataBrowserProxy() { |
| 30 settings.TestBrowserProxy.call(this, ['clearBrowsingData']); | 30 settings.TestBrowserProxy.call(this, [ |
| 31 'initialize', |
| 32 'clearBrowsingData', |
| 33 ]); |
| 31 | 34 |
| 32 /** | 35 /** |
| 33 * The promise to return from |clearBrowsingData|. | 36 * The promise to return from |clearBrowsingData|. |
| 34 * Allows testing code to test what happens after the call is made, and | 37 * Allows testing code to test what happens after the call is made, and |
| 35 * before the browser responds. | 38 * before the browser responds. |
| 36 * @private {?Promise} | 39 * @private {?Promise} |
| 37 */ | 40 */ |
| 38 this.clearBrowsingDataPromise_ = null; | 41 this.clearBrowsingDataPromise_ = null; |
| 39 } | 42 } |
| 40 | 43 |
| 41 TestClearBrowsingDataBrowserProxy.prototype = { | 44 TestClearBrowsingDataBrowserProxy.prototype = { |
| 42 __proto__: settings.TestBrowserProxy.prototype, | 45 __proto__: settings.TestBrowserProxy.prototype, |
| 43 | 46 |
| 44 /** @param {!Promise} promise */ | 47 /** @param {!Promise} promise */ |
| 45 setClearBrowsingDataPromise: function(promise) { | 48 setClearBrowsingDataPromise: function(promise) { |
| 46 this.clearBrowsingDataPromise_ = promise; | 49 this.clearBrowsingDataPromise_ = promise; |
| 47 }, | 50 }, |
| 48 | 51 |
| 49 /** @override */ | 52 /** @override */ |
| 50 clearBrowsingData: function() { | 53 clearBrowsingData: function() { |
| 51 this.methodCalled('clearBrowsingData'); | 54 this.methodCalled('clearBrowsingData'); |
| 52 return this.clearBrowsingDataPromise_ !== null ? | 55 return this.clearBrowsingDataPromise_ !== null ? |
| 53 this.clearBrowsingDataPromise_ : Promise.resolve(); | 56 this.clearBrowsingDataPromise_ : Promise.resolve(); |
| 54 }, | 57 }, |
| 58 |
| 59 /** @override */ |
| 60 initialize: function() { |
| 61 this.methodCalled('initialize'); |
| 62 }, |
| 55 }; | 63 }; |
| 56 | 64 |
| 57 function registerNativeCertificateManagerTests() { | 65 function registerNativeCertificateManagerTests() { |
| 58 suite('NativeCertificateManager', function() { | 66 suite('NativeCertificateManager', function() { |
| 59 /** @type {settings.TestPrivacyPageBrowserProxy} */ | 67 /** @type {settings.TestPrivacyPageBrowserProxy} */ |
| 60 var testBrowserProxy; | 68 var testBrowserProxy; |
| 61 | 69 |
| 62 /** @type {SettingsPrivacyPageElement} */ | 70 /** @type {SettingsPrivacyPageElement} */ |
| 63 var page; | 71 var page; |
| 64 | 72 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 148 |
| 141 return { | 149 return { |
| 142 registerTests: function() { | 150 registerTests: function() { |
| 143 if (cr.isMac || cr.isWin) | 151 if (cr.isMac || cr.isWin) |
| 144 registerNativeCertificateManagerTests(); | 152 registerNativeCertificateManagerTests(); |
| 145 | 153 |
| 146 registerClearBrowsingDataTests(); | 154 registerClearBrowsingDataTests(); |
| 147 }, | 155 }, |
| 148 }; | 156 }; |
| 149 }); | 157 }); |
| OLD | NEW |