Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /* | |
| 6 * Waits for queued up tasks to finish before proceeding. Inspired by: | |
| 7 * https://github.com/Polymer/web-component-tester/blob/master/browser/environme nt/helpers.js#L97 | |
| 8 */ | |
| 9 function flush() { | |
|
michaelpg
2016/10/04 05:40:49
please don't call this "flush" -- the more recogni
alito
2016/10/04 21:22:59
I renamed this to flushTasks() which sound quite e
michaelpg
2016/10/04 22:12:15
great, thanks!
| |
| 10 Polymer.dom.flush(); | |
|
michaelpg
2016/10/04 05:40:49
Use a more specific filename, or maybe just add to
alito
2016/10/04 21:22:59
Moved the function to polymer_browser_test_base.js
| |
| 11 // Promises have microtask timing, so we use setTimeout to explicity force a | |
| 12 // new task. | |
| 13 return new Promise(function(resolve, reject) { | |
| 14 window.setTimeout(resolve, 0); | |
| 15 }); | |
| 16 } | |
| OLD | NEW |