From b1ab97617b5548616322819601db15ec6c2144dd Mon Sep 17 00:00:00 2001 From: ggetz Date: Thu, 1 Mar 2018 15:11:23 -0500 Subject: [PATCH] Updated specs --- .../ShouldError/CesiumMilkTruck.gltf | 20 ++---------- Specs/Scene/ModelSpec.js | 31 +++++++++---------- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/Specs/Data/Models/DracoCompression/ShouldError/CesiumMilkTruck.gltf b/Specs/Data/Models/DracoCompression/ShouldError/CesiumMilkTruck.gltf index 375aabbfc082..63d01a8ba725 100644 --- a/Specs/Data/Models/DracoCompression/ShouldError/CesiumMilkTruck.gltf +++ b/Specs/Data/Models/DracoCompression/ShouldError/CesiumMilkTruck.gltf @@ -95,17 +95,7 @@ }, "indices": 0, "mode": 4, - "material": 0, - "extensions": { - "KHR_draco_mesh_compression": { - "bufferView": 0, - "attributes": { - "TEXCOORD_0": 2, - "NORMAL": 0, - "POSITION": 1 - } - } - } + "material": 0 }, { "attributes": { @@ -134,13 +124,7 @@ "mode": 4, "material": 2, "extensions": { - "KHR_draco_mesh_compression": { - "bufferView": 2, - "attributes": { - "NORMAL": 0, - "POSITION": 1 - } - } + } } ], diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index f135a835328b..d3ee70091bb5 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -2350,25 +2350,22 @@ defineSuite([ }); }); - it('loading a glTF with unsupported draco geometry type throws runtime error', function() { - spyOn(Model._dracoDecoder, 'GetEncodedGeometryType').and.returnValue(0); + it('error decoding a glTF causing model loading to fail', function() { + var decoder = Model._getDecoderTaskProcessor(); + spyOn(decoder, 'scheduleTask').and.returnValue(when.reject('error')); - return loadModel(dracoCompressedModelUrl).otherwise(function (m) { - expect(function() { - scene.renderForSpecs(); - }).toThrowRuntimeError(); - - primitives.remove(m); - }); - }); - - it('error decoding a glTF throws runtime error', function() { - return loadModel(dracoCompressedModelWithErrorUrl).otherwise(function (m) { - expect(function() { - scene.renderForSpecs(); - }).toThrowRuntimeError(); + var model = primitives.add(Model.fromGltf({ + url : dracoCompressedModelWithErrorUrl + })); - primitives.remove(m); + return pollToPromise(function() { + scene.renderForSpecs(); + return model.ready; + }, { timeout: 10000 }).then(function() { + fail('should not resolve'); + }).otherwise(function(e) { + expect(e).toBeDefined(); + primitives.remove(model); }); });