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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('settings_privacy_page', function() { 5 cr.define('settings_privacy_page', function() {
6 /** 6 /**
7 * @constructor 7 * @constructor
8 * @extends {TestBrowserProxy} 8 * @extends {TestBrowserProxy}
9 * @implements {settings.PrivacyPageBrowserProxy} 9 * @implements {settings.PrivacyPageBrowserProxy}
10 */ 10 */
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 page = document.createElement('settings-privacy-page'); 98 page = document.createElement('settings-privacy-page');
99 document.body.appendChild(page); 99 document.body.appendChild(page);
100 }); 100 });
101 101
102 teardown(function() { page.remove(); }); 102 teardown(function() { page.remove(); });
103 103
104 test('showClearBrowsingDataDialog', function() { 104 test('showClearBrowsingDataDialog', function() {
105 assertFalse(!!page.$$('settings-clear-browsing-data-dialog')); 105 assertFalse(!!page.$$('settings-clear-browsing-data-dialog'));
106 MockInteractions.tap(page.$.clearBrowsingData); 106 MockInteractions.tap(page.$.clearBrowsingData);
107 Polymer.dom.flush(); 107 Polymer.dom.flush();
108 assertTrue(!!page.$$('settings-clear-browsing-data-dialog')); 108
109 var dialog = page.$$('settings-clear-browsing-data-dialog');
110 assertTrue(!!dialog);
111
112 // Ensure that the dialog is fully opened before returning from this
113 // test, otherwise asynchronous code run in attached() can cause flaky
114 // errors.
115 return dialog.$.dialog.open ?
116 Promise.resolve() :
117 test_util.whenAttributeChanges(dialog.$.dialog, 'open');
109 }); 118 });
110 }); 119 });
111 } 120 }
112 121
113 function registerClearBrowsingDataTests() { 122 function registerClearBrowsingDataTests() {
114 suite('ClearBrowsingData', function() { 123 suite('ClearBrowsingData', function() {
115 /** @type {settings.TestClearBrowsingDataBrowserProxy} */ 124 /** @type {settings.TestClearBrowsingDataBrowserProxy} */
116 var testBrowserProxy; 125 var testBrowserProxy;
117 126
118 /** @type {SettingsClearBrowsingDataDialogElement} */ 127 /** @type {SettingsClearBrowsingDataDialogElement} */
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 return { 261 return {
253 registerTests: function() { 262 registerTests: function() {
254 if (cr.isMac || cr.isWin) 263 if (cr.isMac || cr.isWin)
255 registerNativeCertificateManagerTests(); 264 registerNativeCertificateManagerTests();
256 265
257 registerClearBrowsingDataTests(); 266 registerClearBrowsingDataTests();
258 registerPrivacyPageTests(); 267 registerPrivacyPageTests();
259 }, 268 },
260 }; 269 };
261 }); 270 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698