From ad56b1b430514217e60da18dd820e63d4a69bef7 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 4 Oct 2019 00:48:46 +0000 Subject: [PATCH] Bug 1526598 [wpt PR 15255] - [html] Restore utility method for query encoding, a=testonly Automatic update from web-platform-tests [html] Restore utility method for query encoding The `poll_for_stash` function was relocated from `resolve-url.js` in service of a test refactoring [1]. However, the following tests depend on the presence of that function in that file: - html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html - html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html - html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html Restore the function to its original location and persist the copy. [1] https://github.com/web-platform-tests/wpt/pull/11300 -- wpt-commits: 9830c5ab1191c788adf006023da46aea07da46f8 wpt-pr: 15255 UltraBlame original commit: 2384c1c7af5a385461ca25c280aadaed4e46d3ad --- .../query-encoding/resources/resolve-url.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js index 84e3e9d95e41..479ba756f7a9 100644 --- a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js @@ -26,6 +26,29 @@ onload = function() { return 'expected substring '+expected+' got '+got; } + function poll_for_stash(test_obj, uuid, expected) { + var start = new Date(); + var poll = test_obj.step_func(function () { + var xhr = new XMLHttpRequest(); + xhr.open('GET', stash_take + uuid); + xhr.onload = test_obj.step_func(function(e) { + if (xhr.response == "") { + if (new Date() - start > 10000) { + + + test_obj.force_timeout(); + } + test_obj.step_timeout(poll, 200); + } else { + assert_equals(xhr.response, expected); + test_obj.done(); + } + }); + xhr.send(); + }) + test_obj.step_timeout(poll, 200); + } + function test_load_nested_browsing_context(tag, attr, spec_url) { async_test(function() {