From 2f8d084b9fb6a7f258da211bda8ff022c669cfab Mon Sep 17 00:00:00 2001 From: ggetz Date: Mon, 23 Apr 2018 15:48:30 -0400 Subject: [PATCH] Cleanup taskProcessor spec --- Source/Core/TaskProcessor.js | 3 +-- Specs/Core/TaskProcessorSpec.js | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Core/TaskProcessor.js b/Source/Core/TaskProcessor.js index dbb301f5a337..3ba9bfa51e29 100644 --- a/Source/Core/TaskProcessor.js +++ b/Source/Core/TaskProcessor.js @@ -173,7 +173,7 @@ define([ }; // Web assembly not supported, use fallback js module if provided - if (!processor._supportsWasm) { + if (!FeatureDetection.supportsWebAssembly()) { if (!defined(wasmOptions.fallbackModulePath)) { throw new RuntimeError('This browser does not support Web Assembly, and no backup module was provided for ' + processor._workerName); } @@ -214,7 +214,6 @@ define([ this._activeTasks = 0; this._deferreds = {}; this._nextID = 0; - this._supportsWasm = FeatureDetection.supportsWebAssembly(); // exposed for testing purposes } var emptyTransferableObjectArray = []; diff --git a/Specs/Core/TaskProcessorSpec.js b/Specs/Core/TaskProcessorSpec.js index 6d020d40898f..f14e860c9e46 100644 --- a/Specs/Core/TaskProcessorSpec.js +++ b/Specs/Core/TaskProcessorSpec.js @@ -172,7 +172,7 @@ defineSuite([ }); }); - it('can load and compile web assembly module', function() { + fit('can load and compile web assembly module', function() { var binaryUrl = absolutize(require.toUrl('../TestWorkers/TestWasm/testWasm.wasm')); taskProcessor = new TaskProcessor('returnWasmConfig', 5); var promise = taskProcessor.initWebAssemblyModule({ @@ -187,10 +187,11 @@ defineSuite([ }); }); - it('uses a backup module if web assembly is not supported', function() { + fit('uses a backup module if web assembly is not supported', function() { var binaryUrl = absolutize(require.toUrl('../TestWorkers/TestWasm/testWasm.wasm')); taskProcessor = new TaskProcessor('returnWasmConfig', 5); - taskProcessor._supportsWasm = false; + + spyOn(FeatureDetection, 'supportsWebAssembly').and.returnValue(false); var promise = taskProcessor.initWebAssemblyModule({ modulePath : 'TestWasm/testWasmWrapper', @@ -205,10 +206,11 @@ defineSuite([ }); }); - it('throws runtime error if web assembly is not supported and no backup is provided', function() { + fit('throws runtime error if web assembly is not supported and no backup is provided', function() { var binaryUrl = absolutize(require.toUrl('../TestWorkers/TestWasm/testWasm.wasm')); taskProcessor = new TaskProcessor('returnWasmConfig', 5); - taskProcessor._supportsWasm = false; + + spyOn(FeatureDetection, 'supportsWebAssembly').and.returnValue(false); expect(function () { taskProcessor.initWebAssemblyModule({