|
@@ -687,4 +687,38 @@ describe('Babylon Scene Loader', function() {
|
|
|
expect(scene.lights.length).to.eq(0);
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ describe('#ArgumentPermutations', () => {
|
|
|
+ it('Typical', () => {
|
|
|
+ return BABYLON.SceneLoader.LoadAsync("/Playground/scenes/Box/", "Box.gltf");
|
|
|
+ });
|
|
|
+
|
|
|
+ it('Single url', () => {
|
|
|
+ return BABYLON.SceneLoader.LoadAsync("/Playground/scenes/Box/Box.gltf");
|
|
|
+ });
|
|
|
+
|
|
|
+ it('Direct load', () => {
|
|
|
+ return BABYLON.Tools.LoadFileAsync("/Playground/scenes/Box/Box.gltf", false).then((gltf) => {
|
|
|
+ return BABYLON.SceneLoader.LoadAsync("/Playground/scenes/Box/", `data:${gltf}`);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ it('File object', () => {
|
|
|
+ BABYLON.Tools.LoadFileAsync("/Playground/scenes/Box/Box.gltf").then((gltf) => {
|
|
|
+ return BABYLON.SceneLoader.LoadAsync("/Playground/scenes/Box/", new File([gltf], "Box.gltf"));
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ it('Files input', () => {
|
|
|
+ return Promise.all([
|
|
|
+ BABYLON.Tools.LoadFileAsync("/Playground/scenes/Box/Box.gltf", true),
|
|
|
+ BABYLON.Tools.LoadFileAsync("/Playground/scenes/Box/Box.bin", true)
|
|
|
+ ]).then(([gltf, bin]: [ArrayBuffer, ArrayBuffer]) => {
|
|
|
+ BABYLON.FilesInput.FilesToLoad["box.gltf"] = new File([gltf], "Box.gltf");
|
|
|
+ BABYLON.FilesInput.FilesToLoad["box.bin"] = new File([bin], "Box.bin");
|
|
|
+ return BABYLON.SceneLoader.LoadAsync("file:", "Box.gltf");
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
});
|