Auto merge of #12277 - ConnorGBrewster:network_listener_cancellable, r=Manishearth

Make network listener runnable cancellable

<!-- Please describe your changes on the following line: -->
This keeps scripts from executing after its script thread has been shut down.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] These changes fix (maybe) #12048 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12277)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-08 09:56:31 -07:00 committed by GitHub
commit 12260b24d0
11 changed files with 60 additions and 7 deletions

View file

@ -37190,6 +37190,12 @@
"path": "html/semantics/embedded-content/the-img-element/invalid-src.html",
"url": "/html/semantics/embedded-content/the-img-element/invalid-src.html"
}
],
"html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html": [
{
"path": "html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html",
"url": "/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html"
}
]
}
},

View file

@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>Script is not executed after script thread is shutdown</title>
<script>
onload = function() {
script_executed = parent.script_executed;
s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'script-not-executed-after-shutdown.js?pipe=trickle(d3)';
document.body.appendChild(s);
};
</script>

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset="utf-8">
<title>Script is not executed after script thread is shutdown</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="testiframe" src="script-not-executed-after-shutdown-child.html"></iframe>
<script>
async_test(function(t) {
window.script_executed = t.unreached_func("script executed in removed iframe");
let iframe = document.getElementById("testiframe");
iframe.onload = function() {
iframe.parentNode.removeChild(iframe);
};
setTimeout(function() {
t.done();
}, 5000);
});
</script>