Title: [271434] trunk/LayoutTests/imported/w3c
Revision
271434
Author
[email protected]
Date
2021-01-13 01:50:12 -0800 (Wed, 13 Jan 2021)

Log 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):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (271433 => 271434)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-01-13 07:24:08 UTC (rev 271433)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-01-13 09:50:12 UTC (rev 271434)
@@ -1,3 +1,17 @@
+2021-01-13  Youenn Fablet  <[email protected]>
+
+        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):
+
 2021-01-12  Cathie Chen  <[email protected]>
 
         The rootBounds of IntersectionObserverEntry is not correct when {root:document}

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-common.sub.js (271433 => 271434)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-common.sub.js	2021-01-13 07:24:08 UTC (rev 271433)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-common.sub.js	2021-01-13 09:50:12 UTC (rev 271434)
@@ -98,8 +98,7 @@
     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 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 = ""
             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}`);
     };
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to