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

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

Issue 2341493003: MD Settings: Deflake attempt for CrSettingsPrivacyPageTest.PrivacyPage. (Closed)
Patch Set: Use MutationObserver, refactor. Created 4 years, 3 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 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');
});
});
}

Powered by Google App Engine
This is Rietveld 408576698