Chromium Code Reviews| 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, ['clearBrowsingData']); |
|
dschuyler
2016/04/26 17:29:49
I think this should have 'initializeFooter' added
msramek
2016/04/27 18:10:29
Done. Also fixed the missing this.methodCalled().
| |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * The promise to return from |clearBrowsingData|. | 33 * The promise to return from |clearBrowsingData|. |
| 34 * Allows testing code to test what happens after the call is made, and | 34 * Allows testing code to test what happens after the call is made, and |
| 35 * before the browser responds. | 35 * before the browser responds. |
| 36 * @private {?Promise} | 36 * @private {?Promise} |
| 37 */ | 37 */ |
| 38 this.clearBrowsingDataPromise_ = null; | 38 this.clearBrowsingDataPromise_ = null; |
| 39 } | 39 } |
| 40 | 40 |
| 41 TestClearBrowsingDataBrowserProxy.prototype = { | 41 TestClearBrowsingDataBrowserProxy.prototype = { |
| 42 __proto__: settings.TestBrowserProxy.prototype, | 42 __proto__: settings.TestBrowserProxy.prototype, |
| 43 | 43 |
| 44 /** @param {!Promise} promise */ | 44 /** @param {!Promise} promise */ |
| 45 setClearBrowsingDataPromise: function(promise) { | 45 setClearBrowsingDataPromise: function(promise) { |
| 46 this.clearBrowsingDataPromise_ = promise; | 46 this.clearBrowsingDataPromise_ = promise; |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 /** @override */ | 49 /** @override */ |
| 50 clearBrowsingData: function() { | 50 clearBrowsingData: function() { |
| 51 this.methodCalled('clearBrowsingData'); | 51 this.methodCalled('clearBrowsingData'); |
| 52 return this.clearBrowsingDataPromise_ !== null ? | 52 return this.clearBrowsingDataPromise_ !== null ? |
| 53 this.clearBrowsingDataPromise_ : Promise.resolve(); | 53 this.clearBrowsingDataPromise_ : Promise.resolve(); |
| 54 }, | 54 }, |
| 55 | |
| 56 /** @override */ | |
| 57 initializeFooter: function() {}, | |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 function registerNativeCertificateManagerTests() { | 60 function registerNativeCertificateManagerTests() { |
| 58 suite('NativeCertificateManager', function() { | 61 suite('NativeCertificateManager', function() { |
| 59 /** @type {settings.TestPrivacyPageBrowserProxy} */ | 62 /** @type {settings.TestPrivacyPageBrowserProxy} */ |
| 60 var testBrowserProxy; | 63 var testBrowserProxy; |
| 61 | 64 |
| 62 /** @type {SettingsPrivacyPageElement} */ | 65 /** @type {SettingsPrivacyPageElement} */ |
| 63 var page; | 66 var page; |
| 64 | 67 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 | 144 |
| 142 return { | 145 return { |
| 143 registerTests: function() { | 146 registerTests: function() { |
| 144 if (cr.isMac || cr.isWin) | 147 if (cr.isMac || cr.isWin) |
| 145 registerNativeCertificateManagerTests(); | 148 registerNativeCertificateManagerTests(); |
| 146 | 149 |
| 147 registerClearBrowsingDataTests(); | 150 registerClearBrowsingDataTests(); |
| 148 }, | 151 }, |
| 149 }; | 152 }; |
| 150 }); | 153 }); |
| OLD | NEW |