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..a5610d8143581bda300541b2852ffc93e712bbcd 100644 |
--- a/chrome/test/data/webui/settings/privacy_page_test.js |
+++ b/chrome/test/data/webui/settings/privacy_page_test.js |
@@ -105,7 +105,16 @@ cr.define('settings_privacy_page', function() { |
assertFalse(!!page.$$('settings-clear-browsing-data-dialog')); |
MockInteractions.tap(page.$.clearBrowsingData); |
Polymer.dom.flush(); |
- assertTrue(!!page.$$('settings-clear-browsing-data-dialog')); |
+ |
+ var dialog = page.$$('settings-clear-browsing-data-dialog'); |
+ assertTrue(!!dialog); |
+ |
+ // Ensure that the dialog is fully opened before returning from this |
+ // test, otherwise asynchronous code run in attached() can cause flaky |
+ // errors. |
+ return dialog.$.dialog.open ? |
+ Promise.resolve() : |
+ test_util.whenAttributeChanges(dialog.$.dialog, 'open'); |
}); |
}); |
} |