From 1eea43e669a0b506c3460e8392ff0ffb158d26a4 Mon Sep 17 00:00:00 2001 From: Rens Groothuijsen Date: Thu, 17 Sep 2020 22:48:31 +0200 Subject: [PATCH] Add test for multiple raster threads --- test/spec/ol/source/raster.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/spec/ol/source/raster.test.js b/test/spec/ol/source/raster.test.js index e3ca585d20..8dc372f0c5 100644 --- a/test/spec/ol/source/raster.test.js +++ b/test/spec/ol/source/raster.test.js @@ -594,6 +594,23 @@ where('Uint8ClampedArray').describe('Processor', function () { done(); }, 1000); }); + + it('can run on multiple threads', function (done) { + const processor = new Processor({ + threads: 2, + operation: identity, + }); + + const input = newImageData(new Uint8ClampedArray([1, 2, 3, 4]), 1, 1); + processor.process([input], {}, function (err) { + if (err) { + done(err); + } + }); + + processor.dispose(); + setTimeout(done, 20); + }); }); describe('#process() - faux worker', function () {