From cec2feb8e056cd259f20aec358ad294dde601c58 Mon Sep 17 00:00:00 2001 From: youennf Date: Tue, 12 Jan 2021 19:38:23 +0100 Subject: [PATCH] WebKit export of https://bugs.webkit.org/show_bug.cgi?id=220541 (#27144) Patch was r+ed downstream --- beacon/beacon-common.sub.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/beacon/beacon-common.sub.js b/beacon/beacon-common.sub.js index 3635da73b75400..279ad2229ba3e9 100644 --- a/beacon/beacon-common.sub.js +++ b/beacon/beacon-common.sub.js @@ -98,8 +98,7 @@ function CreateFormDataFromPayload(payload) { return formData; } -// Schedules async_test's for each of the test cases, treating them as a single session, -// and wires up the continueAfterSendingBeacon() and waitForResults() calls. +// Schedules promise_test's for each of the test cases. // Parameters: // testCases: An array of test cases. // suffix [optional]: A string used for the suffix for each test case name. @@ -108,10 +107,10 @@ function CreateFormDataFromPayload(payload) { function runTests(testCases, suffix = '', buildUrl = self.buildUrl, sendData = self.sendData) { for (const testCase of testCases) { const id = token(); - async_test((test) => { + promise_test((test) => { const url = buildUrl(id); assert_true(sendData(url, testCase.data), 'sendBeacon should succeed'); - waitForResult(id).then(() => test.done(), test.step_func((e) => {throw e;})); + return waitForResult(id); }, `Verify 'navigator.sendbeacon()' successfully sends for variant: ${testCase.name}${suffix}`); }; }