Title: [237238] trunk
Revision
237238
Author
aes...@apple.com
Date
2018-10-17 16:10:33 -0700 (Wed, 17 Oct 2018)

Log Message

[Apple Pay] Increment the API version to 5
https://bugs.webkit.org/show_bug.cgi?id=190686
<rdar://problem/45348523>

Reviewed by Simon Fraser.

Source/WebCore:

Test: http/tests/ssl/applepay/ApplePaySessionV5.html

* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::supportsVersion):

Source/WebKit:

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion):

LayoutTests:

* http/tests/ssl/applepay/ApplePaySessionV5-expected.txt: Added.
* http/tests/ssl/applepay/ApplePaySessionV5.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (237237 => 237238)


--- trunk/LayoutTests/ChangeLog	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/LayoutTests/ChangeLog	2018-10-17 23:10:33 UTC (rev 237238)
@@ -1,3 +1,15 @@
+2018-10-17  Andy Estes  <aes...@apple.com>
+
+        [Apple Pay] Increment the API version to 5
+        https://bugs.webkit.org/show_bug.cgi?id=190686
+        <rdar://problem/45348523>
+
+        Reviewed by Simon Fraser.
+
+        * http/tests/ssl/applepay/ApplePaySessionV5-expected.txt: Added.
+        * http/tests/ssl/applepay/ApplePaySessionV5.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2018-10-17  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: Certain tags should identify their context to iOS API

Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5-expected.txt (0 => 237238)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5-expected.txt	2018-10-17 23:10:33 UTC (rev 237238)
@@ -0,0 +1,23 @@
+Test basic creation of an ApplePaySession object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing supportsVersion
+
+PASS ApplePaySession.supportsVersion(0) threw exception InvalidAccessError: The object does not support the operation or argument..
+PASS ApplePaySession.supportsVersion(1) is true
+PASS ApplePaySession.supportsVersion(2) is true
+PASS ApplePaySession.supportsVersion(3) is true
+PASS ApplePaySession.supportsVersion(4) is true
+PASS ApplePaySession.supportsVersion(5) is true
+
+Testing PaymentRequest (v5)
+
+PASS new ApplePaySession(5, { }) threw exception TypeError: Member ApplePayPaymentRequest.countryCode is required and must be an instance of DOMString.
+PASS new ApplePaySession(5, validRequest()) did not throw exception.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5.html (0 => 237238)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySessionV5.html	2018-10-17 23:10:33 UTC (rev 237238)
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test basic creation of an ApplePaySession object.");
+
+window.jsTestIsAsync = true;
+
+function validRequest() {
+    return {
+          countryCode: 'US',
+          currencyCode: 'USD',
+          supportedNetworks: ['visa', 'masterCard', 'carteBancaire'],
+          merchantCapabilities: ['supports3DS'],
+          total: { label: 'Your Label', amount: '10.00' },
+    }
+}
+
+function logAndShouldThrow(setup, test) {
+    debug("SETUP: " + setup)
+    eval(setup);
+    shouldThrow(test);
+    debug("")
+}
+
+function logAndShouldNotThrow(setup, test) {
+    debug("SETUP: " + setup)
+    eval(setup);
+    shouldNotThrow(test);
+    debug("")
+}
+
+function go() {
+    debug("Testing supportsVersion");
+    debug("");
+    shouldThrow("ApplePaySession.supportsVersion(0)");
+    shouldBeTrue("ApplePaySession.supportsVersion(1)");
+    shouldBeTrue("ApplePaySession.supportsVersion(2)");
+    shouldBeTrue("ApplePaySession.supportsVersion(3)");
+    shouldBeTrue("ApplePaySession.supportsVersion(4)");
+    shouldBeTrue("ApplePaySession.supportsVersion(5)");
+    debug("");
+
+    debug("Testing PaymentRequest (v5)")
+    debug("");
+    shouldThrow("new ApplePaySession(5, { })");
+    shouldNotThrow("new ApplePaySession(5, validRequest())");
+    debug("");
+
+    document.querySelector("button").remove();
+
+    finishJSTest();
+}
+
+function clickElement(element) {
+    let x = element.offsetLeft + 2;
+    let y = element.offsetTop + 2;
+
+    var supportsTouchEvents = "TouchEvent" in window;
+    if (supportsTouchEvents && window.testRunner && testRunner.runUIScript) {
+        testRunner.runUIScript(`(function() { uiController.singleTapAtPoint(${x}, ${y}, function() { }); })();`, function () { });
+    } else if (window.eventSender) {
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+window._onload_ = function() {
+    clickElement(document.querySelector("button"));
+}
+
+</script>
+<button _onclick_='go()'>Go</button>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (237237 => 237238)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-10-17 23:10:33 UTC (rev 237238)
@@ -26,10 +26,12 @@
 [ Sierra ] http/tests/ssl/applepay/ApplePayError.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePaySessionV3.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Skip ]
+[ Sierra ] http/tests/ssl/applepay/ApplePaySessionV5.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html [ Skip ]
 [ HighSierra ] http/tests/ssl/applepay/ApplePayButtonV4.html [ Skip ]
 [ HighSierra ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Skip ]
+[ HighSierra ] http/tests/ssl/applepay/ApplePaySessionV5.html [ Skip ]
 
 fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
 fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html  [ Pass ]
@@ -755,6 +757,7 @@
 [ HighSierra+ ] http/tests/ssl/applepay/ApplePayError.html [ Pass ]
 [ HighSierra+ ] http/tests/ssl/applepay/ApplePaySessionV3.html [ Pass ]
 [ Mojave+ ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Pass ]
+[ Mojave+ ] http/tests/ssl/applepay/ApplePaySessionV5.html [ Pass ]
 [ HighSierra+ ] http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html [ Pass ]
 [ HighSierra+ ] http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html [ Pass ]
 # <rdar://problem/31634451>

Modified: trunk/Source/WebCore/ChangeLog (237237 => 237238)


--- trunk/Source/WebCore/ChangeLog	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/Source/WebCore/ChangeLog	2018-10-17 23:10:33 UTC (rev 237238)
@@ -1,3 +1,16 @@
+2018-10-17  Andy Estes  <aes...@apple.com>
+
+        [Apple Pay] Increment the API version to 5
+        https://bugs.webkit.org/show_bug.cgi?id=190686
+        <rdar://problem/45348523>
+
+        Reviewed by Simon Fraser.
+
+        Test: http/tests/ssl/applepay/ApplePaySessionV5.html
+
+        * testing/MockPaymentCoordinator.cpp:
+        (WebCore::MockPaymentCoordinator::supportsVersion):
+
 2018-10-17  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] Consolidate all image conversion and resizing into one class

Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp (237237 => 237238)


--- trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp	2018-10-17 23:10:33 UTC (rev 237238)
@@ -61,7 +61,7 @@
 #elif !ENABLE(APPLE_PAY_SESSION_V4)
     static const unsigned currentVersion = 3;
 #else
-    static const unsigned currentVersion = 4;
+    static const unsigned currentVersion = 5;
 #endif
 
     return version <= currentVersion;

Modified: trunk/Source/WebKit/ChangeLog (237237 => 237238)


--- trunk/Source/WebKit/ChangeLog	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/Source/WebKit/ChangeLog	2018-10-17 23:10:33 UTC (rev 237238)
@@ -1,3 +1,14 @@
+2018-10-17  Andy Estes  <aes...@apple.com>
+
+        [Apple Pay] Increment the API version to 5
+        https://bugs.webkit.org/show_bug.cgi?id=190686
+        <rdar://problem/45348523>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+        (WebKit::WebPaymentCoordinator::supportsVersion):
+
 2018-10-17  Alex Christensen  <achristen...@webkit.org>
 
         BackForwardClient needs to be able to support UIProcess-only back/forward lists

Modified: trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp (237237 => 237238)


--- trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp	2018-10-17 23:06:02 UTC (rev 237237)
+++ trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp	2018-10-17 23:10:33 UTC (rev 237238)
@@ -60,7 +60,7 @@
 #elif !ENABLE(APPLE_PAY_SESSION_V4)
     static const unsigned currentVersion = 3;
 #else
-    static const unsigned currentVersion = 4;
+    static const unsigned currentVersion = 5;
 #endif
 
     return version <= currentVersion;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to