| Index: chrome/test/data/webui/settings/privacy_page_test.js
|
| diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js
|
| index 0d949a4ab4d5a31f2a7e87cc195739c7e7616d8c..120096ceea5cd62747cc85158de6dbd073ddbedf 100644
|
| --- a/chrome/test/data/webui/settings/privacy_page_test.js
|
| +++ b/chrome/test/data/webui/settings/privacy_page_test.js
|
| @@ -21,26 +21,89 @@ cr.define('settings_privacy_page', function() {
|
| },
|
| };
|
|
|
| - suite('PrivacyPage', function() {
|
| - /** @type {settings.TestPrivacyPageBrowserProxy} */
|
| - var testBrowserProxy;
|
| -
|
| - /** @type {SettingsPrivacyPageElement} */
|
| - var page;
|
| -
|
| - setup(function() {
|
| - testBrowserProxy = new TestPrivacyPageBrowserProxy();
|
| - settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy;
|
| - PolymerTest.clearBody();
|
| - page = document.createElement('settings-privacy-page');
|
| - document.body.appendChild(page);
|
| + /**
|
| + * @constructor
|
| + * @extends {TestBrowserProxy}
|
| + * @implements {settings.ClearBrowsingDataBrowserProxy}
|
| + */
|
| + function TestClearBrowsingDataBrowserProxy() {
|
| + settings.TestBrowserProxy.call(this, ['clearBrowsingData']);
|
| + }
|
| +
|
| + TestClearBrowsingDataBrowserProxy.prototype = {
|
| + __proto__: settings.TestBrowserProxy.prototype,
|
| +
|
| + /** @override */
|
| + clearBrowsingData: function() {
|
| + this.methodCalled('clearBrowsingData');
|
| + return Promise.resolve();
|
| + },
|
| + };
|
| +
|
| + function registerNativeCertificateManagerTests() {
|
| + suite('NativeCertificateManager', function() {
|
| + /** @type {settings.TestPrivacyPageBrowserProxy} */
|
| + var testBrowserProxy;
|
| +
|
| + /** @type {SettingsPrivacyPageElement} */
|
| + var page;
|
| +
|
| + setup(function() {
|
| + testBrowserProxy = new TestPrivacyPageBrowserProxy();
|
| + settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy;
|
| + PolymerTest.clearBody();
|
| + page = document.createElement('settings-privacy-page');
|
| + document.body.appendChild(page);
|
| + });
|
| +
|
| + teardown(function() { page.remove(); });
|
| +
|
| + test('NativeCertificateManager', function() {
|
| + MockInteractions.tap(page.$.manageCertificates);
|
| + return testBrowserProxy.whenCalled('showManageSSLCertificates');
|
| + });
|
| });
|
| + }
|
| +
|
| + function registerClearBrowsingDataTests() {
|
| + suite('ClearBrowsingData', function() {
|
| + /** @type {settings.TestClearBrowsingDataBrowserProxy} */
|
| + var testBrowserProxy;
|
| +
|
| + /** @type {SettingsClearBrowsingDataDialogElement} */
|
| + var element;
|
| +
|
| + setup(function() {
|
| + testBrowserProxy = new TestClearBrowsingDataBrowserProxy();
|
| + settings.ClearBrowsingDataBrowserProxyImpl.instance_ = testBrowserProxy;
|
| + PolymerTest.clearBody();
|
| + element = document.createElement('settings-clear-browsing-data-dialog');
|
| + document.body.appendChild(element);
|
| + });
|
|
|
| - teardown(function() { page.remove(); });
|
| + teardown(function() { element.remove(); });
|
|
|
| - test('NativeCertificateManager', function() {
|
| - MockInteractions.tap(page.$.manageCertificates);
|
| - return testBrowserProxy.whenCalled('showManageSSLCertificates');
|
| + test('ClearBrowsingDataTap', function() {
|
| + element.open();
|
| + assertTrue(element.$.dialog.opened);
|
| + var clearBrowsingDataButton = element.$.clearBrowsingData;
|
| + assertTrue(!!clearBrowsingDataButton);
|
| +
|
| + MockInteractions.tap(clearBrowsingDataButton);
|
| + return testBrowserProxy.whenCalled('clearBrowsingData').then(
|
| + function() {
|
| + assertFalse(element.$.dialog.opened);
|
| + });
|
| + });
|
| });
|
| - });
|
| + }
|
| +
|
| + return {
|
| + registerTests: function() {
|
| + if (cr.isMac || cr.isWin)
|
| + registerNativeCertificateManagerTests();
|
| +
|
| + registerClearBrowsingDataTests();
|
| + },
|
| + };
|
| });
|
|
|