Граф коммитов

110 Коммитов

Автор SHA1 Сообщение Дата
Marcos Cáceres 1699f2bb63 Bug 1484864 - Intermittent tier 2 test-verify dom/payments/test/browser_payment_in_different_tabs.js r=edenchuang 2018-08-27 21:47:00 +03:00
Eden Chuang 2f8de0fe6b Bug 1483470 - Improve the test case for responding a closed PaymentRequest. r=baku
1. Improving the testCloseByRedirectingAfterShow. Try to call
       PaymentRequestService::respondPayment when the PaymentRequest is closed.
    2. Adding a new test testUpdateWithRespondedPayment for the case the merchant
       calls PaymentRequestUpdateEvent::updateWith() and the PaymentRequest is
       rejected by the user.

--HG--
rename : dom/payments/test/test_cleanupPayment.html => dom/payments/test/test_closePayment.html
2018-08-24 11:28:50 +02:00
Eden Chuang a29e2c4da2 Bug 1483470 - Handling PaymentRequestUpdateEvent::updateWith() to a responed PaymentRequest. r=baku
1. Checking if the PaymentRequest::mState equals to eInteractive when calling
       PaymentRequest::UpdatePayment() and PaymentRequest::AbortUpdate.
    2. Removing the non-suitable MOZ_ASSERT in PaymentRequest::RespondShowPayment()
2018-08-22 03:10:45 +02:00
Eden Chuang 6fddec41b3 Bug 1483470 - Adding new method closePayment in nsIPaymentUIService.idl. r=baku
1. Adding a new method void closePayment(in AString requestId) in
       nsIPaymentUIService.idl
    2. Implementing the closePayment method in paymentUIService.js.
    3. Calling closePayment of paymentUIService.js in
       PaymentRequestService::LaunchUIAction()
2018-08-16 14:19:35 +02:00
Eden Chuang 68bb5bfa3c Bug 1483470 - Handling PaymentRequestService::RespondPayment() to a closed PaymentRequest. r=baku
1. Returning NS_ERROR_FAILURE in PaymentRequestService::RespondPayment() when
       the specified PaymentRequest does not exist in PaymentRequestService.
    2. Renaming "cleanup" to "close" in DOM::WebPayment codes to fit the actual
       behavior.
2018-08-16 14:27:24 +02:00
Kris Maglione 3a5c05e76f Bug 1484496: Part 5e - Convert remaining nsISimpleEnumerator users to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D3733

--HG--
extra : rebase_source : c0fac176d7b3d840c4dbb14f8d95ccfc7f83a5a8
extra : histedit_source : a92c40117d0808a3ad68c972f622a7a42c9ae8ba
2018-08-18 18:13:14 -07:00
Kris Maglione 2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.

Differential Revision: https://phabricator.services.mozilla.com/D3728

--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
2018-08-18 21:06:32 -07:00
Kris Maglione 65c28aa0ad Bug 1484496: Part 2 - Add common base class for all nsISimpleEnumerator implementations. r=froydnj
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.

This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.

Differential Revision: https://phabricator.services.mozilla.com/D3725

--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
2018-08-18 14:22:47 -07:00
Marcos Cáceres d9c9ac71d9 Bug 1483156 - Currency of PaymentItem total should be 'USD', but got BOB r=edenchuang
--HG--
extra : amend_source : 8bfb03ef649733c587b1b04bfea6260fb5b2b4fd
2018-08-21 20:16:00 +03:00
Jeff Walden e4f79e2a19 Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem 2018-08-20 07:54:45 -07:00
Marcos Cáceres 8f0ff24be1 Bug 1480872 - paymentDetails attributes should default to an empty arrays. r=edenchuang 2018-08-19 19:11:00 +03:00
Eden Chuang d532620f01 Bug 1408234 - mochitest for PaymentRequest cleanup after document closed. r=baku
1. add a set new mochitests to test cleanup function.
       By redirecting to another page.
       By redirecting to another page, when PaymentRequest.show() is called.
       By reloading
       By removing/closing the page.
    2. remove unnecessary PaymentRequestService.cleanup() call in the test suite.
2018-08-13 11:25:13 +02:00
Eden Chuang b4cd2e70aa Bug 1408234 - Cleanup the PaymentRequests when document close. r=baku
Let PaymentRequest inherit from nsIDocumentActivity interface.
    Calling RegisterActivityObserver() and UnregisterActivityObserver() in
    constructor and destructor to get activity notifications from document.
    When receiving the notification, NotifyOwnerDocumentActivityChanged() will
    check the owner document's activity status. If the status is disabled, calling
    PaymentRequestManager::CleanupPayment() to cleanup the PaymentRequest in
    content process and aslo sending the cleanup information to chrome process.
2018-08-13 11:24:54 +02:00
Zibi Braniecki 4432035f49 Bug 1480673 - Migrate all uses of JS_Stringify to nsContentUtils::StringifyJSON. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D2701

--HG--
extra : moz-landing-system : lando
2018-08-07 16:01:27 +00:00
Andi-Bogdan Postelnicu 88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Marcos Cáceres 60e5daf61c Bug 1468356 - Implement onpaymentmethodchange attribute. r=mrbkap
--HG--
extra : rebase_source : 220c160ce0a4ab0568285c276de7326d4a16da23
2018-06-30 10:11:00 +03:00
Dorel Luca bc2fbd0648 Merge mozilla-central to autoland
--HG--
extra : rebase_source : 0f5c3c308ce6ddd6fb9fcb49b83d4450a24d67dc
2018-06-27 13:33:04 +03:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Henri Sivonen 77eaf92c58 Bug 1447773 - Time out PaymentResponse after 5 seconds. r=mrbkap
MozReview-Commit-ID: JnoKgLC6yL6

--HG--
extra : rebase_source : 8fb0f553409b1ecf142568146f3f4cc7ad33ac4f
2018-05-29 12:31:22 +03:00
Sebastian Hengst b8ce168b05 Bug 1471255 - bugs in dom/payments should be filed in Core::DOM: Web Payments. r=MattN
MozReview-Commit-ID: LuQsheIcW48

--HG--
extra : rebase_source : f00a112dfbf7992bfe32f18f89559fa02a915bae
2018-06-26 18:44:17 +03:00
Sebastian Hengst c6864ae376 Bug 1470750 - Don't run DOM payment tests for non-Nightly. r=mrbkap
MozReview-Commit-ID: DqaSGheG7LE
2018-06-25 01:50:40 +03:00
Blake Kaplan 37c3abfe24 Bug 1470110 - Consistently disable payments off of Nightly. r=MattN
We only build the frontend parts of Web Payments on Nightly, but users could
futz with the prefs and expose the DOM API on Beta. We should be careful about
not allowing that mismatch.

This also adds some additional logging if we run into a bug like this again.

MozReview-Commit-ID: 9qcQTIsIHkg

--HG--
extra : rebase_source : cdaed71d79e6f8cedd1229ffd03cac21e3660367
2018-06-22 12:05:36 -07:00
Blake Kaplan 7616406bb3 Bug 1469433 - Remove an unused function. r=smaug
This was just sitting around.

MozReview-Commit-ID: 282neafD23x

--HG--
extra : rebase_source : 9f7257f9bebc8e063dd2ef2aca9bf0fa9c8300c0
2018-06-19 15:58:37 -07:00
Blake Kaplan 2597785450 Bug 1469433 - Handle shutdown more gracefully. r=smaug
If we end up shutting down the content process while there's a request active
we'll end up "leaking" the request and asserting. This makes sure that we
let go of the PaymentRequest in that edge case. I can cause this by forceably
closing the payment request window on Linux without hitting OK or cancel.

MozReview-Commit-ID: 6XDYIcqNkC6

--HG--
extra : rebase_source : d20d8fae4aa4fc3afcca8491d415c64b8af8bcb4
2018-06-19 15:55:32 -07:00
Blake Kaplan 5d09eec7de Bug 1469433 - Match the spec's error reporting more closely. r=smaug
MozReview-Commit-ID: LI13cA0okeu

--HG--
extra : rebase_source : 8ffb8db4fc0e4905f31cca2b41a954b89720e42a
2018-06-19 15:30:43 -07:00
Blake Kaplan dfb2d7b714 Bug 1442453 - Pass objects around instead of string IDs in the child. r=baku
The existing code only passed strings around to identify PaymentRequest
objects. That meant that we were constantly having to do hashtable lookups to
find the corresponding object. This patch just uses the single map that IPDL
maintains for us and passes objects around, obviating the need for more
hashtable lookups.

MozReview-Commit-ID: 6BBonrc6q4x

--HG--
extra : rebase_source : 041c6ce742d60a2c9e954a58582d09cd9ef7f2b1
2018-05-31 16:20:51 -07:00
Blake Kaplan 49d7053a3e Bug 1442453 - Create a single IPC actor per PaymentRequest. r=baku
There isn't any need to create an actor per call to the parent. This patch
lines up PaymentRequest with PPaymentRequestChild objects and links them
together. It also simplifies the maps and arrays we use to keep track of these
objects.

There's one tricky bit to note in this patch: in the case that a promise is
passed to paymentRequest.show(), we don't notify the parent process until the
promise resolves (when we call either UpdatePayment or AbortUpdate). In that
case, I needed to distinguish between an "update" because of the promise
resolving or a call to updateWith on an shippingaddresschange event in order
to get the bookkeeping right with the mActivePayments hashtable. In that case,
the PaymentRequest is kept alive by mShowingRequest alone. In all other cases,
mActivePayments keeps the PaymentRequest alive until we resolve or reject the
correct promise.

MozReview-Commit-ID: HoHjn8eqC4T

--HG--
extra : rebase_source : 4da1d65d1f791f4a5c18871ab3a3dcf94e833b90
2018-05-31 13:30:29 -07:00
Blake Kaplan 40ee64ba85 Bug 1442453 - Fix nits and get rid of needless QIs. r=baku
This removes some hard tabs that crept in and combines two if branches into a
single statement in order to avoid a bit of duplication.

The existing code here seems to treat any sort of upcast as needing a QI. That
is needlessly wasteful and causes a bunch of unneeded virtual calls.

MozReview-Commit-ID: 7WshYm9C4Xb

--HG--
extra : rebase_source : bc7b1b5157324158f627efd8dff54f078488f4fc
2018-05-30 14:13:07 -07:00
Blake Kaplan 5251fffd6b Bug 1442453 - Fix a typo in this member name. r=baku
MozReview-Commit-ID: Ds7yRFn04NK

--HG--
extra : rebase_source : 76fbce0f2599dec30f6a07bb7044e5446abcbf65
2018-05-30 14:05:42 -07:00
Blake Kaplan b1a13228be Bug 1442453 - Don't enforce "one interactive request" in the wrong place. r=baku
The existing code assumed that the only reason that there could be a
PaymentRequestChild was due to an active show() call. That is not the case. We
already know whether there's an "interactive" PaymentRequest through
mShowingRequest, so we should just use that instead.

MozReview-Commit-ID: IA9bXn7hS63

--HG--
extra : rebase_source : 0d65a6e05d224a5fddfdbb953ad28f2eecd80533
2018-05-30 14:04:32 -07:00
Joel Maher 50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Eden Chuang 130e426839 Bug 1435157 - mochitest for AddressErrors in WebPayment. r=baku
--HG--
extra : rebase_source : e1a782bab18fede5fe12e91ff26f1dd3037ccee2
2018-05-18 14:40:34 +08:00
Eden Chuang 029423a6e2 Bug 1435157 - Support AddressErrors in WebPayment. r=baku.
1. Add AddressErrors in PaymentRequest.webidl.
    2. IPC for passing AddressErrors.
    3. Getters for AddressErrors in nsIPaymentDetails.

--HG--
extra : rebase_source : 64c57003d57e064b5284cc64447c0c0740f16121
2018-05-17 19:59:16 +08:00
YUKI "Piro" Hiroshi dd7b3aab39 Bug 1457395 - Fix typo "proces" in comments. r=milan
--HG--
extra : amend_source : 36cf036803ff9bffaebb66fc31ff7b960f0c7509
2018-05-10 16:56:09 +09:00
Kris Maglione a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Eden Chuang 0471b5e543 Bug 1440041 - mochitest for nsIPaymentRequest.shippingOption. r=baku
This patch includes followings
    1. Test with no selected shipping options.
    2. Test with one selected shipping option when creating PaymentRequest.
    3. Test with multiple selected shipping options when creating PaymentRequest.
    4. Test with selecting shipping option by user.
    5. Test with modifying the user selection by merchant.
    6. Merges the mochitest for bug 1443914.

--HG--
rename : dom/payments/test/Bug1443914ChromeScript.js => dom/payments/test/ShippingOptionsChromeScript.js
rename : dom/payments/test/test_bug1443914.html => dom/payments/test/test_shippingOptions.html
extra : histedit_source : 19126dcb3870e0637ed8f4d0fbc6839cb5d682a0
2018-04-13 18:48:31 -07:00
Eden Chuang b206167b93 Bug 1440041 - Add a new readonly attribute nsIPaymentRequest.shippingOption. r=baku. 2018-04-13 18:47:20 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Boris Zbarsky 4292bca4ee Bug 1449631 part 6. Remove nsIDOMEventTarget::DispatchEvent. r=smaug
MozReview-Commit-ID: 8YMgmMwZkAL
2018-04-05 13:42:41 -04:00
Eden Chuang 2c1de92a07 Bug 1441709 - Mochitest for PaymentRequest.show(optional Promise<PaymentDetailsUpdate> detailsPromise). r=baku
1. Add testShowWithXXX tests to test PaymentRequest.show() with
   PaymentDetailsUpdate promise.
2. Improve the test case implementation by removing the redundant code.

--HG--
extra : histedit_source : 9c68ba8eb6ea4db7e6a158baf19f170b5736a9db
2018-03-30 22:42:38 +08:00
Eden Chuang 1537e9d304 Bug 1441709 - Support PaymentRequest.show() with an optional PaymentDetailsUpdate promise parameter. r=baku
1. Add "optional Promise<PaymentDetailsUpdate> detailsPromise" as a parameter
   of PaymentRequest.show() in PaymentRequest.webidl.
2. Let PaymentRequest inherit from PromiseNativeHandler, and implement the
   ResolvedCallback() and RejectedCallback() to handle the PaymentDetailsUpdate
   promise.
3. Update PaymentRequest.show() implementation. If PaymentDetailsUpdate Promise
   is not nullptr, the show request would not be transferred to chrome process
   immediately until the promise is resolved/rejected.
4. Update selectedShippingOption when requestShipping is true.
5. Change the PaymentMethod id validation sequence according to the spec.

--HG--
extra : histedit_source : e591c759037cce4f66701b2faa5ecbe01c00e246
2018-04-02 23:12:21 +08:00
Eden Chuang c0b77a99d3 Bug 1443914 - Mochitest for force updating PaymentDetails. r=baku
--HG--
extra : histedit_source : e2905ede4132942e43045f377dd8fe7ca364c626
2018-03-29 23:10:08 +08:00
Eden Chuang 1ec4751b5b Bug 1443914 - Force updating PaymentDetails when requestShipping is true. r=baku
Update the implementation according to the spec update.
Force updating the saved PaymentDetails when requestShipping is true, even
the data(shippingOptions) doesn't present in the DetailsUpdate.

--HG--
extra : histedit_source : b0a1c0b9cc7efe045ce330432b60bb6f86eb1878
2018-03-29 23:09:52 +08:00
Jonathan Guillotte-Blouin 673331c9c5 Bug 1442078 - Modify DOM tests that were broken by the change to the "show" specs. r=baku
MozReview-Commit-ID: KqecbNw496W

--HG--
extra : rebase_source : 4c6a120183286e52243356a74b3fdf522ca09c2b
2018-03-08 22:41:30 -05:00
Jonathan Guillotte-Blouin d02a6dc311 Bug 1442078 - throw "SecurityError" if `show` is not triggered by user activation. r=baku
MozReview-Commit-ID: 73gP1iJAvhf

--HG--
extra : rebase_source : 90c1cae77b2d7a15f856abdaf5bb58ab73d5c915
2018-03-02 16:17:45 -05:00
Jared Wein 3fa24ba667 Bug 1441683 - response.complete() should make the completeStatus available to the payment UI service. r=baku
MozReview-Commit-ID: TnszpuqAa

--HG--
extra : rebase_source : 81c53e6db13c49f85c1716598107c06129ec8d21
2018-03-13 10:30:08 -04:00
Henri Sivonen 2eb6c4eda3 Bug 1436903 - Avoid passing shipping options to the front end when shipping was not requested. r=baku
MozReview-Commit-ID: FdkC02izUy6

--HG--
extra : rebase_source : 4434a148379e33771950848c6cdf1350e33eb23b
2018-03-07 13:16:46 +02:00
Henri Sivonen 707e82855c Bug 1435155 - Redact the shipping address as it is visible before the promise from PaymentRequest.show() resolves successfully. r=baku
Spec PR: https://github.com/w3c/payment-request/pull/654

MozReview-Commit-ID: 2AiKI7htRhk

--HG--
extra : rebase_source : 3a1e41f8322424f1e57a5887d2d87862e609165d
2018-03-07 09:39:08 +02:00
Andreea Pavel dc797492f3 Backed out changeset 8a29a154e88d (bug 1435155) for browser chrome leakchecks (APZEventState, ActiveElementManager, Array, AsyncFreeSnowWhite, AsyncLatencyLogger, ...) on a CLOSED TREE 2018-03-07 18:19:29 +02:00