⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271434 in webkit


Ignore:
Timestamp:
Jan 13, 2021, 1:50:12 AM (6 years ago)
Author:
youenn@apple.com
Message:

Use promise_test in WPT beacon/beacon-common.sub.js instead of async_test
https://bugs.webkit.org/show_bug.cgi?id=220541
<rdar://problem/72940308>

Reviewed by Geoffrey Garen.

Use promise_test to limit the number of requests sent in parallel.
This helps the server responds properly.

  • web-platform-tests/beacon/beacon-common.sub.js:

(runTests):

Location:
trunk/LayoutTests/imported/w3c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r271433 r271434  
     12021-01-13  Youenn Fablet  <youenn@apple.com>
     2
     3        Use promise_test in WPT beacon/beacon-common.sub.js instead of async_test
     4        https://bugs.webkit.org/show_bug.cgi?id=220541
     5        <rdar://problem/72940308>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Use promise_test to limit the number of requests sent in parallel.
     10        This helps the server responds properly.
     11
     12        * web-platform-tests/beacon/beacon-common.sub.js:
     13        (runTests):
     14
    1152021-01-12  Cathie Chen  <cathiechen@igalia.com>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-common.sub.js

    r263595 r271434  
    9999}
    100100
    101 // Schedules async_test's for each of the test cases, treating them as a single session,
    102 // and wires up the continueAfterSendingBeacon() and waitForResults() calls.
     101// Schedules promise_test's for each of the test cases.
    103102// Parameters:
    104103//     testCases: An array of test cases.
     
    109108    for (const testCase of testCases) {
    110109        const id = token();
    111         async_test((test) => {
     110        promise_test((test) => {
    112111            const url = buildUrl(id);
    113112            assert_true(sendData(url, testCase.data), 'sendBeacon should succeed');
    114             waitForResult(id).then(() => test.done(), test.step_func((e) => {throw e;}));
     113            return waitForResult(id);
    115114        }, `Verify 'navigator.sendbeacon()' successfully sends for variant: ${testCase.name}${suffix}`);
    116115    };
Note: See TracChangeset for help on using the changeset viewer.