| <!DOCTYPE html><!-- webkit-test-runner [ ModelElementEnabled=true ] --> |
| <html> |
| <body> |
| <model id="model"> |
| <source src="resources/does-not-exist.usdz"> |
| </model> |
| <p>This test passes if you see the word "Passed" below:</p> |
| <p id="result">Failed</p> |
| <script> |
| if (window.testRunner) { |
| testRunner.waitUntilDone(); |
| testRunner.dumpAsText(); |
| } |
| |
| let result = document.getElementById("result"); |
| let model = document.getElementById("model"); |
| |
| model.ready.then(value => { |
| result.textContent = "Failed. Model should not have loaded, but did."; |
| }, reason => { |
| if (reason.name == "NetworkError") |
| result.textContent = `Passed`; |
| else |
| result.textContent = `Failed. Wrong error type: ${reason}.`; |
| }).finally(() => { |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }); |
| </script> |
| </body> |
| </html> |