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

79 Коммитов

Автор SHA1 Сообщение Дата
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
Henri Sivonen a4da46bb89 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 : 77ea27abe066bd62a0ac84f52731fa52ea938b73
2018-03-07 09:39:08 +02:00
Henri Sivonen 44e4383f36 Bug 1432079 - Implement PaymentItemType. r=baku
MozReview-Commit-ID: Jpj9arQ9MaE

--HG--
extra : rebase_source : 75dff1a752b2f85b162e6cfbc67fd563cee12993
2018-02-28 15:00:05 +02:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Eden Chuang 6b14fc7125 Bug 1403079 - Add mAllowPaymentRequest and related methods on nsIDocument to check if PaymentRequest API is allowed to use. r=smaug
Add a new member mAllowPaymentRequest on nsIDocument and following related
methods,
  bool AllowPaymentRequest() const
  void SetAllowPaymentRequest(bool aAllowPaymentRequest)
mAllowPaymentRequest is used to check if PaymentRequest is allowed to use on
the document. According to the spec
  https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use
the mAllowPaymentRequest should be true under following situations
  1. The document is the top level content document.
  2. The document is the same origin with its parent document and its parent
     document's mAllowPaymentRequest is true.
  3. The document is different origin with its parent document but its
     parent node is an iframe with allowpaymentrequest flag and the parent
     document's mAllowPaymentRquest is true.

This patch also include following mochitests
  1. test for allowpaymentrequest flag changing. The flag change effect should
     not be applied to the document immediately, it should be updated while
     the browsing context is updated.
  2. test for effect propagation in the nested iframe.
2017-10-19 15:56:51 +08:00
Andrew McCreight 298aa82710 Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL

--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
2017-10-26 15:08:41 -07:00
Eden Chuang 8eaa630afe Bug 1408250 - Don't expose PaymentRequest API in non-e10s. r=baku
1. PaymentRequest::PrefEnabled() returns false under non-e10s situation.
2. Add a new mochitest test_block_none10s.html to expect to get ReferenceError
   in non-e10s mode.
2017-10-20 00:10:25 +08:00
Masatoshi Kimura dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09:00
Eden Chuang 3d2f4c7cfc Bug 1403080 - Return null DOMString while PaymentOptions.requestShipping is false. r=baku
--HG--
extra : rebase_source : ec5f87928253c69d834f2a7a9a0c9b3b1f523c45
2017-09-28 15:20:19 +08:00
Eden Chuang f04fc2e524 Bug 1389418 - Mochitest for payment method identifier validation support in PaymentRequest API. r=baku
1. Test PaymentRequest construction with valid PMIs.
2. Test PaymentRequest construction with Invalid PMIs.
3. Test PaymentRequestUpdateEvent::updateWith with a valid PMI.
4. Test PaymentRequestUpdateEvent::updateWith with a invalid PMI.

Remove unnecessary html tags in html files.
2017-09-11 11:10:10 +08:00
Eden Chuang 150de62804 Bug 1389418 - Support payment method identifier validation in PaymentRequest API. r=baku
This patch implements payment method identifier validation algorithm
according to the spec https://w3c.github.io/payment-method-id/.

The steps to validate a payment method identifier with a string pmi are
given by the following algorithm. It returns true if the pmi is valid.

1. Let url be the result of running the basic URL parser with pmi.
2. If url is failure, validate a standardized payment method identifier with
   pmi and return the result.
3. Otherwise, validate a URL-based payment method identifier passing url and
   return the result.
2017-09-11 09:52:24 +08:00
Eden Chuang 62b089b5ed Bug 1398991 - Mochitest for spec change on PaymentRequest.shippingOption. r=baku
This patch changes the test_construction.html with following modification.
1. Modify the test testWithDuplicateShippingOptionsParameters to expect a
   TypeError when constructing wiht duplicate shippingOption ids.
2. Add test testShippingOtpionAttribute for shippingOption setting checking
   with following conditions
   1. No selected shippingOption and PaymentOptions.requestShipping is false
   2. One selected shippingOption and PaymentOptions.requestShipping is false
   3. One selected shippingOption and PaymentOptions.requestShipping is true
   4. Multiple selected shippingOptions and PaymentOptions.requestShipping is
      true.
2017-09-15 14:20:05 +08:00
Eden Chuang a15d19dc9d Bug 1398991 - Set PaymentRequest.ShippingOption only if options.requestShipping is true. r=baku
This patch implements the following changes according to the spec change.
See https://w3c.github.io/payment-request/#constructor step 8 for more
details.

1. Return TypeError during PaymentRequest construction with duplicate
   shippingOption id.
2. Set PaymentRequest.shippingOption with the selected shippingOption only
   if options.requestShipping is true.
2017-09-15 14:19:52 +08:00
Eden Chuang 066f794bbc Bug 1388661 - Mochitest for PaymentRequest API currency amount validation. r=baku
1. Create a new test test_currency_amount_validation.html to test validation
       with following scenarios
       * test with well formed currency codes.
       * test with invalid currency codes.
       * test with valid lower case currency codes and check is it converted to
         upper case.
       * test with invalid currency codes while calling
         PaymentRequestUpdateEvent::updateWith().
       * test with invalid amount value with calling
         PaymentRequestUpdateEvent::updateWith().
    2. Move tests of test_validate_decimal_value.html to
       test_currency_amount_validation.html
2017-09-06 14:38:33 +08:00
Eden Chuang 2638e37728 Bug 1388661 - Support currency validation in PaymentRequet API. r=baku
This patch implements currency validation algorithm according to the spec
    https://w3c.github.io/payment-request/#validity-checkers.

    1. amount.currencySystem must be "urn:iso:std:iso:4217".
    2. amount.currency is valid with following criteria
       1. The currency length must be 3.
       2. The currency contains any character that must be in the range "A" to
          "Z"(U+0041 to U+005A) or the range "a" to "z"(U+0061 to U+007A).

    According to the spec, converting the currency to upper case and save it in
    nsIPaymentRequest.
2017-09-06 14:36:24 +08:00
Andrew McCreight 78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Eden Chuang e87f1be933 Bug 1385187 - Mochitest for rejecting PaymentRequest.show() with NotSupportedError DOMException if no supported method. r=baku
Adding a new test testCannotMakePaymentShow() to test the implementation.
2017-08-21 11:35:58 +08:00
Eden Chuang af95d86b7f Bug 1385187 - Reject PaymentRequest.show() with NotSupportedError DOMException if no supported method. r=baku
1. Create a new action response status PAYMENT_NOTSUPPORTED and get rid of
   unnecessary method isAccpeted() from nsIPaymentActionResponse.idl.
2. Create canMakePayment() in PaymentRequestService and run it before
   launching UI. If canMakePayment() returns false, send PAYMENT_NOTSUPPORTED
   back to content process.
3. If chrome process returns PAYMENT_NOTSUPPORTED when calling showPayment(),
   throw NotSupportedError DOMException to merchant side.
2017-08-28 11:55:59 +08:00
Eden Chuang 608ad8a775 Bug 1387385 - Remove all nsIJSON usage in PaymentRequestUtils.cpp. r=baku
Instead of using nsIJSON, directly calling JS_Stringify and JS_ParseJSON for
JSON object serialization/deserialization.
2017-08-09 17:25:02 +08:00
Eden Chuang 283e59c25e Bug 1383293 - Mochitest for testing the new readonly attribute topLevelPrincipal in nsIPaymentRequest. r=baku
1. Adding new checks in ConstructorChromeScript.js to checking the top level
   document's principal information.
2. Adding a new test testCrossOriginTopLevelPrincipal in
   test_constructor.html to testing the topLevelPrincipal attribute under
   cross origin situation.
3. Removing some useless mochitest browser-chrome testcase.
2017-08-23 15:23:18 +08:00
Eden Chuang 34196fb87f Bug 1383293 - Add a new readonly attribute topLevelPrincipal in nsIPaymentRequest for UI support. r=baku
Getting the top level document's principal when constructing PaymentRequest,
then sending it to chrome process and saving it in nsIPaymentRequest.
Creating a new readonly attribute nsIPrincipal topLevelPrincipal in
nsIPaymentRequest for UI to query the top level document's principal
information.
2017-08-23 14:26:51 +08:00
Eden Chuang 97081209f0 Bug 1390737 - Run test_canMakePayment.html in nightly build only because it depends on nightly only UI service. r=btian 2017-08-16 12:53:25 +08:00
Eden Chuang d66800c204 Bug 1390018 - Build and test Payments UI code on Nightly builds only. r=MattN
--HG--
extra : source : 8df491f3dcdfa4430bccac3242ee9cfb9fa3634b
2017-08-16 07:16:25 +08:00
Ryan VanderMeulen 629d98cad7 Backed out changeset 8df491f3dcdf for landing with the wrong bug number in the commit message. 2017-08-15 19:27:16 -04:00
Eden Chuang a86c240986 Bug 1380018 - Build and test Payments UI code on Nightly builds only. r=MattN
--HG--
extra : rebase_source : 50f99532eefea866b67c7455dab4e430a9f09dfa
2017-08-16 07:16:25 +08:00
Masatoshi Kimura dec070e4cf Bug 1389460 - Remove @deprecated nsIDOMEventTarget.DispatchDOMEvent. r=smaug
MozReview-Commit-ID: E88DZK5sfwx

--HG--
extra : rebase_source : 64e1a47c9366a970f20ec459dde9b379a207e802
2017-08-07 02:28:52 +09:00