Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Patch was r+ed downstream
  • Loading branch information
youennf committed Jan 12, 2021
1 parent ddcca80 commit cec2feb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions beacon/beacon-common.sub.js
Expand Up @@ -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.
Expand All @@ -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}`);
};
}
Expand Down

0 comments on commit cec2feb

Please sign in to comment.