Auto merge of #20068 - paavininanda:autocloseworker, r=jdm

added AutoCloseWorker for closing related workers when a page/another worker is closed.

<!-- Please describe your changes on the following line: -->
Followed steps as suggested in issue.
Error is not yet resolved!

---
<!-- 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 #17977 (https://github.com/servo/servo/issues/17977?).

<!-- Either: -->
- [x] These changes do not require tests because it will have manual test case.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20068)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-22 13:34:55 -05:00 committed by GitHub
commit 9c484452c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 0 deletions

3
tests/html/child.html Normal file
View file

@ -0,0 +1,3 @@
<script>
var w = new Worker('work.js');
</script>

8
tests/html/parent.html Normal file
View file

@ -0,0 +1,8 @@
<body>
<script>
var iframe = document.createElement('iframe');
iframe.src = "child.html";
iframe.onload = function() { iframe.remove(); }
document.body.appendChild(iframe);
</script>
</body>

4
tests/html/work.js Normal file
View file

@ -0,0 +1,4 @@
console.log("reached inside work.js file");
setInterval(function() {
console.log('hi');
}, 500);