-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cesium3DTileset tests #3367
Cesium3DTileset tests #3367
Conversation
Great, this fixes part of #3241:
|
Go for it. Perhaps assume the filename is tiles.json if one isn't provided. |
@@ -122,6 +122,9 @@ define([ | |||
this.state = Cesium3DTileContentState.LOADING; | |||
|
|||
loadArrayBuffer(this._url).then(function(arrayBuffer) { | |||
if (that.isDestroyed()) { | |||
throw new Error('tileset is destroyed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only throw DeveloperError
or RuntimeError
, not Error
; see https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/CodingGuide/README.md#throwing-exceptions
In this case, there was an outstanding request after the tileset was destroyed, right? That is not an exceptional case. Can we instead just silently destroy the tile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it can be silent. I did it this way so that the request scheduler and stats would get updated correctly, but since that all is changing anyways I think it's fine not to throw the errors.
Do we have any test cases for both additive and replacement refinement in the same tileset? |
|
return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function(tileset) { | ||
tileset.debugShowStatistics = true; | ||
scene.renderForSpecs(); | ||
// TODO : not sure how to test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a spy for console log. Don't too tightly couple this test to the implementation though, just a coarse-grained test is plenty.
The |
Can we add an explicit test for:
This is an important optimization for additive refinement. Basically, from one view we should not need to request the farther away children, then move the view closer and the children are requested. |
Can we add a test to make sure tiles are traversed (requested/rendered) in the a front-to-back order? I think there is an issue here. From #3241:
We can also punt on this until the request scheduler if that makes more sense. |
Let's test the case when the content url exists but it has an unknown extension, e.g.,
|
Do we need a test case for a traditional quadtree where all the interior tiles are empty and only the leafs have content? Or is |
Would some of these tests be better if we mocked out (or just spied on) It would make the tests more precise and depend on fewer moving parts. |
Also, this is up to you if you think it is cleaner. |
Did coverage bump to 94%? :) |
Not yet... |
That's all my comments. This looks really good. |
This will be easier to test in |
This is ready for another look. |
Coverage for |
For #3177
Cesium3DTileset
andTileset3DTileContentProvider
selectTiles
function. I'm still not 100% happy with the approach. I was experimenting with other approaches but it wasn't any better.CullingVolume
mask instead ofIntersect
.addToProcessingQueue
andremoveFromProcessingQueue
functions which weren't operating correctly in certain edge cases, like failed requests. This area in general will change again with the request scheduler.Cesium3DTileset.destroy
. In order to handle cases where the tileset is destroyed while content requests are still in progress, when the request completes I throw an error to reject the ready promise. However I'm open to different ideas.Cesium3DTileset
with a url to an explicittiles.json
file, right now you can only give it a folder.