mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Allow pages to finish loading when external stylesheets have network errors.
This commit is contained in:
parent
810735a846
commit
1b495de29c
2 changed files with 59 additions and 41 deletions
|
@ -7,17 +7,32 @@
|
|||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<script>
|
||||
//var t404 = async_test("Should get an error event for a 404 error.")
|
||||
//t404.step(function() {
|
||||
// var elt = document.createElement("link");
|
||||
// elt.onerror = t404.step_func(function() {
|
||||
// assert_true(true, "Got error event for 404 error.")
|
||||
// t404.done()
|
||||
// })
|
||||
// elt.rel = "stylesheet";
|
||||
// elt.href = 404 error;
|
||||
// document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
//})
|
||||
var t404 = async_test("Should get an error event for a 404 error.")
|
||||
t404.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = t404.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
t404.step_timeout(function() { t404.done() }, 0);
|
||||
})
|
||||
elt.onload = t404.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "nonexistent_stylesheet.css";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
|
||||
var tUnsupported = async_test("Should get an error event for an unsupported URL.")
|
||||
tUnsupported.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = tUnsupported.step_func(function() {
|
||||
assert_true(true, "Got error event for unsupported URL.")
|
||||
tUnsupported.step_timeout(function() { tUnsupported.done() }, 0);
|
||||
})
|
||||
elt.onload = tUnsupported.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "nonexistent:stylesheet.css";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue