Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5035)

Unified Diff: chrome/test/data/webui/settings/privacy_page_test.js

Issue 1899853004: MD Settings: Clear Browsing Data dialog, dismiss when clearing is done. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ },
+ };
});
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698