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 c42bbe0f9ba0a1f3d96285ec1cd70d4c7d0ddebd..f317e13c415e53ef5bcaef4dcc7c75887f84d27c 100644 |
--- a/chrome/test/data/webui/settings/privacy_page_test.js |
+++ b/chrome/test/data/webui/settings/privacy_page_test.js |
@@ -101,7 +101,17 @@ cr.define('settings_privacy_page', function() { |
teardown(function() { page.remove(); }); |
- test('showClearBrowsingDataDialog', function() { |
+ test('showClearBrowsingDataDialog', function(done) { |
+ // Ensure that the dialog is fully opened before returning from this |
+ // test, otherwise asynchronous code run in attached() can cause flaky |
+ // errors. |
+ page.addEventListener( |
+ 'clear-browsing-data-dialog-opened', function() { |
Dan Beam
2016/09/14 01:15:58
can we just use 'show' instead of making this even
dpapad
2016/09/15 16:56:17
Do you mean use show() instead of showModal() to d
Dan Beam
2016/09/15 17:11:06
i thought, for some reason, that a 'show' event wa
dpapad
2016/09/15 17:58:22
I followed similar approach, but I did not add it
|
+ assertTrue(page.$$( |
+ 'settings-clear-browsing-data-dialog').$.dialog.open); |
+ done(); |
+ }); |
+ |
assertFalse(!!page.$$('settings-clear-browsing-data-dialog')); |
MockInteractions.tap(page.$.clearBrowsingData); |
Polymer.dom.flush(); |