OLD | NEW |
---|---|
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 /** @type {SettingsPrivacyPageElement} */ | 94 /** @type {SettingsPrivacyPageElement} */ |
95 var page; | 95 var page; |
96 | 96 |
97 setup(function() { | 97 setup(function() { |
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(done) { |
105 // Ensure that the dialog is fully opened before returning from this | |
106 // test, otherwise asynchronous code run in attached() can cause flaky | |
107 // errors. | |
108 page.addEventListener( | |
109 '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
| |
110 assertTrue(page.$$( | |
111 'settings-clear-browsing-data-dialog').$.dialog.open); | |
112 done(); | |
113 }); | |
114 | |
105 assertFalse(!!page.$$('settings-clear-browsing-data-dialog')); | 115 assertFalse(!!page.$$('settings-clear-browsing-data-dialog')); |
106 MockInteractions.tap(page.$.clearBrowsingData); | 116 MockInteractions.tap(page.$.clearBrowsingData); |
107 Polymer.dom.flush(); | 117 Polymer.dom.flush(); |
108 assertTrue(!!page.$$('settings-clear-browsing-data-dialog')); | 118 assertTrue(!!page.$$('settings-clear-browsing-data-dialog')); |
109 }); | 119 }); |
110 }); | 120 }); |
111 } | 121 } |
112 | 122 |
113 function registerClearBrowsingDataTests() { | 123 function registerClearBrowsingDataTests() { |
114 suite('ClearBrowsingData', function() { | 124 suite('ClearBrowsingData', function() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 return { | 262 return { |
253 registerTests: function() { | 263 registerTests: function() { |
254 if (cr.isMac || cr.isWin) | 264 if (cr.isMac || cr.isWin) |
255 registerNativeCertificateManagerTests(); | 265 registerNativeCertificateManagerTests(); |
256 | 266 |
257 registerClearBrowsingDataTests(); | 267 registerClearBrowsingDataTests(); |
258 registerPrivacyPageTests(); | 268 registerPrivacyPageTests(); |
259 }, | 269 }, |
260 }; | 270 }; |
261 }); | 271 }); |
OLD | NEW |