| <!DOCTYPE html><!-- webkit-test-runner [ ModelElementEnabled=true ] --> |
| <html> |
| <body> |
| <model id="model" style="border-radius: 5px"> |
| <source> |
| </model> |
| <pre id="layers"></pre> |
| <script> |
| window.testRunner?.waitUntilDone(); |
| window.testRunner?.dumpAsText(); |
| |
| const layers = document.getElementById("layers"); |
| const source = document.querySelector("source"); |
| const model = document.getElementById("model"); |
| |
| const modelDidLoadFirstSource = () => { |
| layers.textContent = "Before Changing Source:\n"; |
| layers.textContent += window.internals?.platformLayerTreeAsText(model, window.internals.PLATFORM_LAYER_TREE_INCLUDE_MODELS) ?? "This test requires testRunner."; |
| |
| model.addEventListener("load", event => { |
| layers.textContent += "After Changing Source:\n"; |
| layers.textContent += window.internals?.platformLayerTreeAsText(model, window.internals.PLATFORM_LAYER_TREE_INCLUDE_MODELS) ?? "This test requires testRunner."; |
| window.testRunner?.notifyDone(); |
| }, { once: true }); |
| |
| model.addEventListener("error", event => { |
| layers.textContent = `Failed. Second model did not load.`; |
| window.testRunner?.notifyDone(); |
| }, { once: true }); |
| |
| source.src = "resources/cube.usdz"; |
| }; |
| |
| model.addEventListener("load", modelDidLoadFirstSource, { once: true }); |
| model.addEventListener("error", event => { |
| layers.textContent = `Failed. First model did not load.`; |
| window.testRunner?.notifyDone(); |
| }, { once: true }); |
| |
| source.src = "resources/heart.usdz"; |
| |
| </script> |
| </body> |
| </html> |