Title: [237381] trunk
Revision
237381
Author
[email protected]
Date
2018-10-24 07:15:15 -0700 (Wed, 24 Oct 2018)

Log Message

[macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=190650
<rdar://problem/45341914>

Reviewed by Alex Christensen.

Source/WebCore:

In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
weren't clearing exceptions generated from calling convert(), so they would end up being
logged as unhandled promise rejections.

Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
decoding paymentMethodErrors.

Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
rejections from calling PaymentRequest.abort().

Covered by existing test.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeErrors const):

LayoutTests:

* http/tests/resources/payment-request.js:
(updateDetailsOnShippingAddressChange):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (237380 => 237381)


--- trunk/LayoutTests/ChangeLog	2018-10-24 13:45:26 UTC (rev 237380)
+++ trunk/LayoutTests/ChangeLog	2018-10-24 14:15:15 UTC (rev 237381)
@@ -1,3 +1,14 @@
+2018-10-24  Andy Estes  <[email protected]>
+
+        [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=190650
+        <rdar://problem/45341914>
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/resources/payment-request.js:
+        (updateDetailsOnShippingAddressChange):
+
 2018-10-23  Jer Noble  <[email protected]>
 
         TextTrack cues should be updated more often than every 250ms.

Modified: trunk/LayoutTests/http/tests/resources/payment-request.js (237380 => 237381)


--- trunk/LayoutTests/http/tests/resources/payment-request.js	2018-10-24 13:45:26 UTC (rev 237380)
+++ trunk/LayoutTests/http/tests/resources/payment-request.js	2018-10-24 14:15:15 UTC (rev 237381)
@@ -68,7 +68,7 @@
                 event.updateWith(detailsUpdatePromise);
                 detailsUpdatePromise.then(() => {
                     resolve();
-                    request.abort();
+                    request.abort().catch(() => { });
                 });
             };
             request.show().catch(error => error);

Modified: trunk/Source/WebCore/ChangeLog (237380 => 237381)


--- trunk/Source/WebCore/ChangeLog	2018-10-24 13:45:26 UTC (rev 237380)
+++ trunk/Source/WebCore/ChangeLog	2018-10-24 14:15:15 UTC (rev 237381)
@@ -1,3 +1,26 @@
+2018-10-24  Andy Estes  <[email protected]>
+
+        [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=190650
+        <rdar://problem/45341914>
+
+        Reviewed by Alex Christensen.
+
+        In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
+        weren't clearing exceptions generated from calling convert(), so they would end up being
+        logged as unhandled promise rejections.
+
+        Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
+        decoding paymentMethodErrors.
+
+        Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
+        rejections from calling PaymentRequest.abort().
+
+        Covered by existing test.
+
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        (WebCore::ApplePayPaymentHandler::computeErrors const):
+
 2018-10-22  Antti Koivisto  <[email protected]>
 
         topPrivatelyControlledDomain is slow

Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp (237380 => 237381)


--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp	2018-10-24 13:45:26 UTC (rev 237380)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp	2018-10-24 14:15:15 UTC (rev 237381)
@@ -363,14 +363,15 @@
 #if ENABLE(APPLE_PAY_SESSION_V3)
     if (paymentMethodErrors) {
         auto& context = *scriptExecutionContext();
-        auto throwScope = DECLARE_THROW_SCOPE(context.vm());
+        auto catchScope = DECLARE_CATCH_SCOPE(context.vm());
         auto applePayErrors = convert<IDLSequence<IDLInterface<ApplePayError>>>(*context.execState(), paymentMethodErrors);
-        if (!throwScope.exception()) {
+        if (!catchScope.exception()) {
             for (auto& applePayError : applePayErrors) {
                 if (applePayError)
                     errors.append({ applePayError->code(), applePayError->message(), applePayError->contactField() });
             }
-        }
+        } else
+            catchScope.clearException();
     }
 #else
     UNUSED_PARAM(paymentMethodErrors);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to