| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 this.clearBrowsingDataPromise_ = promise; | 49 this.clearBrowsingDataPromise_ = promise; |
| 50 }, | 50 }, |
| 51 | 51 |
| 52 /** @override */ | 52 /** @override */ |
| 53 clearBrowsingData: function() { | 53 clearBrowsingData: function() { |
| 54 this.methodCalled('clearBrowsingData'); | 54 this.methodCalled('clearBrowsingData'); |
| 55 return this.clearBrowsingDataPromise_ !== null ? | 55 return this.clearBrowsingDataPromise_ !== null ? |
| 56 this.clearBrowsingDataPromise_ : Promise.resolve(); | 56 this.clearBrowsingDataPromise_ : Promise.resolve(); |
| 57 }, | 57 }, |
| 58 | 58 |
| 59 /** @override */ | 59 /** @override {!Promise} promise */ |
| 60 initialize: function() { | 60 initialize: function() { |
| 61 this.methodCalled('initialize'); | 61 this.methodCalled('initialize'); |
| 62 return Promise.resolve(false); |
| 62 }, | 63 }, |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 function registerNativeCertificateManagerTests() { | 66 function registerNativeCertificateManagerTests() { |
| 66 suite('NativeCertificateManager', function() { | 67 suite('NativeCertificateManager', function() { |
| 67 /** @type {settings.TestPrivacyPageBrowserProxy} */ | 68 /** @type {settings.TestPrivacyPageBrowserProxy} */ |
| 68 var testBrowserProxy; | 69 var testBrowserProxy; |
| 69 | 70 |
| 70 /** @type {SettingsPrivacyPageElement} */ | 71 /** @type {SettingsPrivacyPageElement} */ |
| 71 var page; | 72 var page; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 98 | 99 |
| 99 /** @type {SettingsClearBrowsingDataDialogElement} */ | 100 /** @type {SettingsClearBrowsingDataDialogElement} */ |
| 100 var element; | 101 var element; |
| 101 | 102 |
| 102 setup(function() { | 103 setup(function() { |
| 103 testBrowserProxy = new TestClearBrowsingDataBrowserProxy(); | 104 testBrowserProxy = new TestClearBrowsingDataBrowserProxy(); |
| 104 settings.ClearBrowsingDataBrowserProxyImpl.instance_ = testBrowserProxy; | 105 settings.ClearBrowsingDataBrowserProxyImpl.instance_ = testBrowserProxy; |
| 105 PolymerTest.clearBody(); | 106 PolymerTest.clearBody(); |
| 106 element = document.createElement('settings-clear-browsing-data-dialog'); | 107 element = document.createElement('settings-clear-browsing-data-dialog'); |
| 107 document.body.appendChild(element); | 108 document.body.appendChild(element); |
| 109 return testBrowserProxy.whenCalled('initialize'); |
| 108 }); | 110 }); |
| 109 | 111 |
| 110 teardown(function() { element.remove(); }); | 112 teardown(function() { element.remove(); }); |
| 111 | 113 |
| 112 test('ClearBrowsingDataTap', function() { | 114 test('ClearBrowsingDataTap', function() { |
| 113 assertTrue(element.$.dialog.opened); | 115 assertTrue(element.$.dialog.opened); |
| 114 | 116 |
| 115 var cancelButton = element.$$('.cancel-button'); | 117 var cancelButton = element.$$('.cancel-button'); |
| 116 assertTrue(!!cancelButton); | 118 assertTrue(!!cancelButton); |
| 117 var actionButton = element.$$('.action-button'); | 119 var actionButton = element.$$('.action-button'); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 229 |
| 228 return { | 230 return { |
| 229 registerTests: function() { | 231 registerTests: function() { |
| 230 if (cr.isMac || cr.isWin) | 232 if (cr.isMac || cr.isWin) |
| 231 registerNativeCertificateManagerTests(); | 233 registerNativeCertificateManagerTests(); |
| 232 | 234 |
| 233 registerClearBrowsingDataTests(); | 235 registerClearBrowsingDataTests(); |
| 234 }, | 236 }, |
| 235 }; | 237 }; |
| 236 }); | 238 }); |
| OLD | NEW |