diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-12-12 13:16:44 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-12-12 16:49:02 -0800 |
commit | 3718e1fa15b6ad7feaacd0102cd943fd48cb1a7b (patch) | |
tree | 105e1f84dc0bffa2b0dd782d3612a70ddb6f6947 /platform/node | |
parent | b65b2f1c299eb545ae0dab454c51f11c5833fdd8 (diff) | |
download | qtlocation-mapboxgl-3718e1fa15b6ad7feaacd0102cd943fd48cb1a7b.tar.gz |
[tests] Implement "wait" command with Map#render
This ensures that a "wait" command will always fully flush pending update flags. This was not the case with the prior conditional map.loaded() logic.
Diffstat (limited to 'platform/node')
-rw-r--r-- | platform/node/test/suite_implementation.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/platform/node/test/suite_implementation.js b/platform/node/test/suite_implementation.js index 28c2068345..05b8113afb 100644 --- a/platform/node/test/suite_implementation.js +++ b/platform/node/test/suite_implementation.js @@ -61,14 +61,9 @@ module.exports = function (style, options, callback) { callback(); } else if (operation[0] === 'wait') { - var wait = function () { - if (map.loaded()) { - applyOperations(operations.slice(1), callback); - } else { - map.render(options, wait); - } - }; - wait(); + map.render(options, function () { + applyOperations(operations.slice(1), callback); + }); } else { // Ensure that the next `map.render(options)` does not overwrite this change. |