Auto merge of #20780 - gterzian:fix_beforeunload_test, r=cbrewster

update "navigation within beforeunload" test to match the spec

<!-- Please describe your changes on the following line: -->
 Follow up on https://github.com/servo/servo/pull/20329#issuecomment-387138449
@cbrewster

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

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

<!-- 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/20780)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-05-19 23:46:30 -04:00 committed by GitHub
commit b9407adb04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions

View file

@ -1560,7 +1560,7 @@ impl Window {
let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();
// Step 4
// Step 4 and 5
let window_proxy = self.window_proxy();
if let Some(active) = window_proxy.currently_active() {
if pipeline_id == active {

View file

@ -564742,7 +564742,7 @@
"support"
],
"html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html": [
"8e48ede5ef227e88a091f1d33b385d0b3dff713c",
"49a3e27670f5902309f45be654ad9e12d7f9c500",
"testharness"
],
"html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html": [

View file

@ -1,5 +0,0 @@
[navigation-within-beforeunload.html]
type: testharness
[Triggering navigation from within beforeunload event]
expected: FAIL

View file

@ -15,7 +15,10 @@ onload = function() {setTimeout(function() {
iframe.onload = function() {
setTimeout(function() {iframe.contentWindow.location="navigation-within-beforeunload-2.html";}, 100);
iframe.onload = t.step_func(function() {assert_equals(counter, 1000); t.done()});
// Step 4 of https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents
// doesn't seem to allow navigation within a beforeunload handler,
// so the counter should not go beyond 1.
iframe.onload = t.step_func(function() {assert_equals(counter, 1); t.done()});
};
iframe.src = "navigation-within-beforeunload-1.html?" + Math.random();