| Index: chrome/test/data/webui/polymer_browser_test_base.js
|
| diff --git a/chrome/test/data/webui/polymer_browser_test_base.js b/chrome/test/data/webui/polymer_browser_test_base.js
|
| index ea1b659bd20acea58e321574394c39084e4cd107..b63110cd36f562c154c2028349724d90f5e5038f 100644
|
| --- a/chrome/test/data/webui/polymer_browser_test_base.js
|
| +++ b/chrome/test/data/webui/polymer_browser_test_base.js
|
| @@ -206,3 +206,16 @@ PolymerTest.getLibraries = function(basePath) {
|
| return basePath + library;
|
| });
|
| };
|
| +
|
| +/*
|
| + * Waits for queued up tasks to finish before proceeding. Inspired by:
|
| + * https://github.com/Polymer/web-component-tester/blob/master/browser/environment/helpers.js#L97
|
| + */
|
| +PolymerTest.flushTasks = function() {
|
| + Polymer.dom.flush();
|
| + // Promises have microtask timing, so we use setTimeout to explicity force a
|
| + // new task.
|
| + return new Promise(function(resolve, reject) {
|
| + window.setTimeout(resolve, 0);
|
| + });
|
| +};
|
|
|