From 3b9ab3460029b15fc0979883fa8523443851f713 Mon Sep 17 00:00:00 2001 From: CYBAI Date: Tue, 22 Jan 2019 22:53:09 +0800 Subject: [PATCH] Make a workaround for the test with about:blank onload As jdm mentioned in https://github.com/servo/servo/pull/22660#discussion_r249597546, the initial about:blank load event can be fired before the form navigation occurs. --- tests/wpt/metadata/MANIFEST.json | 2 +- .../form-submission-0/constructing-form-data-set.html.ini | 3 --- .../forms/form-submission-0/constructing-form-data-set.html | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 78ff1b06ae7..242904f4db2 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -631362,7 +631362,7 @@ "testharness" ], "html/semantics/forms/form-submission-0/constructing-form-data-set.html": [ - "914d61b07898867f2728c2d3cf9d7ad7bdd6aa1b", + "8dad6cdd01a43fa17694c67939e8e5a05ab529e2", "testharness" ], "html/semantics/forms/form-submission-0/contains.json": [ diff --git a/tests/wpt/metadata/html/semantics/forms/form-submission-0/constructing-form-data-set.html.ini b/tests/wpt/metadata/html/semantics/forms/form-submission-0/constructing-form-data-set.html.ini index 956dc69251e..ee52a142650 100644 --- a/tests/wpt/metadata/html/semantics/forms/form-submission-0/constructing-form-data-set.html.ini +++ b/tests/wpt/metadata/html/semantics/forms/form-submission-0/constructing-form-data-set.html.ini @@ -7,6 +7,3 @@ [The button cannot be setted if it is not a submitter.] expected: FAIL - - [Entries added to "formData" IDL attribute should be submitted.] - expected: FAIL diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html index 914d61b0789..8dad6cdd01a 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html @@ -102,8 +102,12 @@ t1.step(() => { e.formData.append('h1', 'vh1'); }); let iframe = form.previousSibling; - iframe.onload = t1.step_func_done(() => { + iframe.onload = t1.step_func(() => { + // The initial about:blank load event can be fired before the form navigation occurs. + // See https://github.com/whatwg/html/issues/490 for more information. + if (iframe.contentWindow.location.href == "about:blank") { return; } assert_true(iframe.contentWindow.location.search.indexOf('n1=v1&h1=vh1') != -1); + t1.done(); }); form.submit(); });