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

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

Issue 2098633002: Migrate the one-time notice into the MD settings CBD dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_counters
Patch Set: Created 4 years, 6 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
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 4bc41793f60f461211bb4401adead7c494d49522..1733cabc1a7e75d1adddac0da80668e5069191e7 100644
--- a/chrome/test/data/webui/settings/privacy_page_test.js
+++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -141,6 +141,46 @@ cr.define('settings_privacy_page', function() {
assertFalse(cancelButton.disabled);
assertFalse(actionButton.disabled);
assertFalse(spinner.active);
+ assertFalse(!!element.$$('#notice'));
+ });
+ });
+
+ test('showOtherFormsOfBrowsingHistoryNotice', function() {
+ assertTrue(element.$.dialog.opened);
+ var actionButton = element.$$('.action-button');
+ assertTrue(!!actionButton);
+
+ var promiseResolver = new PromiseResolver();
+ testBrowserProxy.setClearBrowsingDataPromise(promiseResolver.promise);
+ MockInteractions.tap(actionButton);
+
+ return testBrowserProxy.whenCalled('clearBrowsingData').then(
+ function() {
+ // Passing showNotice = true should trigger the notice about other
+ // forms of browsing history to open, and the dialog to stay open.
+ promiseResolver.resolve(true /* showNotice */);
+
+ // Yields to the message loop to allow the callback chain of the
+ // Promise that was just resolved to execute before the
+ // assertions.
+ }).then(function() {
+ // The callback should have triggered the condition to create
+ // the notice, but we must spin the message loop again until
+ // the dom-if template is notified and actually creates it.
dschuyler 2016/06/25 01:34:54 Can a Polymer.dom.flush() be used rather than spin
msramek 2016/06/27 15:24:59 Yes! Thanks :)
+ }).then(function() {
+ var notice = element.$$('#notice');
+ assertTrue(!!notice);
+ var noticeActionButton = notice.$$('.action-button');
+ assertTrue(!!noticeActionButton);
+
+ assertTrue(element.$.dialog.opened);
+ assertTrue(notice.$.dialog.opened);
+
+ MockInteractions.tap(noticeActionButton);
+ }).then(function() {
+ var notice = element.$$('#notice');
+ assertFalse(!!notice);
+ assertFalse(element.$.dialog.opened);
});
});

Powered by Google App Engine
This is Rietveld 408576698