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); |
}); |
}); |