Skip to content

Commit

Permalink
Updated Specs
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Mar 1, 2018
1 parent f516ed7 commit c997b4e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -115,15 +105,7 @@
"indices": 4,
"mode": 4,
"material": 1,
"extensions": {
"KHR_draco_mesh_compression": {
"bufferView": 1,
"attributes": {
"NORMAL": 0,
"POSITION": 1
}
}
}
"extensions": {}
},
{
"attributes": {
Expand Down
33 changes: 16 additions & 17 deletions Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2350,25 +2350,24 @@ defineSuite([
});
});

it('loading a glTF with unsupported draco geometry type throws runtime error', function() {
spyOn(Model._dracoDecoder, 'GetEncodedGeometryType').and.returnValue(0);
fit('error decoding a glTF causes 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() {
model.readyPromise.then(function () {
fail('should not resolve');
}).otherwise(function(e) {
expect(e).toBeDefined();
primitives.remove(model);
});
});
});

Expand Down

0 comments on commit c997b4e

Please sign in to comment.