Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar Shehata committed Aug 29, 2018
1 parent 0c3d711 commit 1e73469
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Apps/SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0",
"tilesetVersion": "1.2.3"
},
"extras": { "hey":12 },
"properties": {
"id": {
"minimum": 0,
Expand Down Expand Up @@ -61,6 +62,7 @@
]
},
"geometricError": 0,
"extras": { "special": true },
"content": {
"uri": "ll.b3dm"
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
124 changes: 124 additions & 0 deletions Specs/Data/Cesium3DTiles/Tilesets/TilesetWithExtras/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"asset": {
"version": "1.0",
"tilesetVersion": "1.2.3"
},
"properties": {
"id": {
"minimum": 0,
"maximum": 9
},
"Longitude": {
"minimum": -1.3197192952275933,
"maximum": -1.319644104024109
},
"Latitude": {
"minimum": 0.698848878034009,
"maximum": 0.6989046192460953
},
"Height": {
"minimum": 6.161747192963958,
"maximum": 85.41026367992163
}
},
"geometricError": 240,
"extras": {
"key": "value"
},
"root": {
"boundingVolume": {
"region": [
-1.3197209591796106,
0.6988424218,
-1.3196390408203893,
0.6989055782,
0,
88
]
},
"geometricError": 70,
"extras": {
"key": "value"
},
"refine": "ADD",
"content": {
"uri": "parent.b3dm",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
88
]
}
},
"children": [
{
"boundingVolume": {
"region": [
-1.3197209591796106,
0.6988424218,
-1.31968,
0.698874,
0,
20
]
},
"geometricError": 0,
"content": {
"uri": "ll.b3dm"
}
},
{
"boundingVolume": {
"region": [
-1.31968,
0.6988424218,
-1.3196390408203893,
0.698874,
0,
20
]
},
"geometricError": 0,
"content": {
"uri": "lr.b3dm"
}
},
{
"boundingVolume": {
"region": [
-1.31968,
0.698874,
-1.3196390408203893,
0.6989055782,
0,
20
]
},
"geometricError": 0,
"content": {
"uri": "ur.b3dm"
}
},
{
"boundingVolume": {
"region": [
-1.3197209591796106,
0.698874,
-1.31968,
0.6989055782,
0,
20
]
},
"geometricError": 0,
"content": {
"uri": "ul.b3dm"
}
}
]
}
}
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ defineSuite([
var pointCloudUrl = 'Data/Cesium3DTiles/PointCloud/PointCloudRGB/tileset.json';
var pointCloudBatchedUrl = 'Data/Cesium3DTiles/PointCloud/PointCloudBatched/tileset.json';

var tilesetWithExtras = 'Data/Cesium3DTiles/Tilesets/TilesetWithExtras/tileset.json';

beforeAll(function() {
scene = createScene();
});
Expand Down Expand Up @@ -356,6 +358,16 @@ defineSuite([
});
});

fit('loads tileset with extras', function() {
return Cesium3DTilesTester.loadTileset(scene, tilesetWithExtras).then(function(tileset) {
expect(tileset.extras).toBeDefined();
expect(tileset.extras).toEqual({'key': 'value'});

expect(tileset.root.extras).toBeDefined();
expect(tileset.root.extras).toEqual({'key': 'value'});
});
});

it('gets root tile', function() {
var tileset = scene.primitives.add(new Cesium3DTileset({
url : tilesetUrl
Expand Down

0 comments on commit 1e73469

Please sign in to comment.