There are few things that are either Fennec-specific or don't work
currently under GeckoView w/ e10s under TestRunnerActivity. Disable
these so we can get some testing going in automation.
This also replaces 'isFennec' with the more correct 'is_fennec'.
Differential Revision: https://phabricator.services.mozilla.com/D19016
--HG--
extra : moz-landing-system : lando
For cases where the class has direct calls (that is, we cast `this` to the
subclass before making the call) no longer declare Recv/Answer methods on the
base class at all. This should ensure that slots for them are not generated in
vtables, and also allow the derived class to choose the method signature (e.g.
whether it wants to take something by reference or by value).
Differential Revision: https://phabricator.services.mozilla.com/D18132
--HG--
extra : moz-landing-system : lando
When calling a Recv/Alloc/Dealloc method on most types, cast `this` to the
derived class.
There is a heuristic to figure out what the correct derived type is. There is a
blacklist of types which we can't do direct calls on for the moment, as well as
an override for types that do work with direct calls but which don't match the
heuristic.
Differential Revision: https://phabricator.services.mozilla.com/D16492
--HG--
extra : moz-landing-system : lando
The current document of a window can change in between the time when a
PaymentRequest registers as an activity observer and when it attempts
to unregister, so keep a strong reference to the document. This is the
same issue as bug 1317805.
Differential Revision: https://phabricator.services.mozilla.com/D17540
--HG--
extra : moz-landing-system : lando
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8
This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:
ChromeUtils.import("resource://gre/modules/Services.jsm");
is approximately the same as the following, in the new model:
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs
This was done using the followng script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16750
--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
1. Warning to browser console when calling with empty error fields.
2. Warning to browser console when calling with non-empty payer errors but
corresponding PaymentOptions.requestPayerXXX is false.
--HG--
extra : histedit_source : 816c44a0ceca5202886a48eee96d2ef7f7315487
PaymentRequest API is not supported when the PaymentRequest is not in the
fully active document. Adding bool a PaymentRequest::InFullyActiveDocument()
method to check if the PaymentRequest is in fully active document. This
method should be called at the start of any PaymentRequest APIs. If the
PaymentRequest is not in fully active document, ignoring the API call and
throw the NS_ERROR_DOM_ABORT_ERR if needed.
--HG--
extra : histedit_source : 3e8e4a73f69c639f9cc528afa586af22597ff320
1. Set nsIPaymentRequest.completeStatus as 'updating' when calling
nsIPaymentRequestService::Change*. After event handling done, set
nsIPaymentRequest.completeStatus as '' and call
nsIPaymentUIService::UpdatePayment()
2. When the page handles PaymentRequestUpdateEvent or the Promise of
PaymentRequest::Show() over the dom.payments.response.timeout, set
nsIPaymentRequest.completeStatus as 'timeout' and call
PaymentUIService::UpdatePayment() automatically
3. Set nsIPaymentRequest.completeStatus as 'nohandler' when dispatching
PaymentRequestUpdateEvent and no event handler for it.
4. Set the initial valud of dom.payments.response.timeout to 20000 ms.
--HG--
extra : rebase_source : 7fe64a05bf7d20726c95aadd6e85bc14cb26bd3f
Save the changing method information in PaymentMethodChangeEvent and
dispatch it.
--HG--
extra : histedit_source : 583cc4efd19d22d21864527db9bb479f772839e4
1. Add a new method nsIPaymentRequestService::ChangePaymentMethod for UI to
inform merchant the payment method is changed by user.
2. Add a new method in PPaymentRequest.ipdl to passing the changing method
information from chrome process to content process.
3. Add BasicCardChangeDetails dictionary in BasicCardPayment.webidl
4. Create ChangeDetails, GeneralDetails and BasicCardDetails for saving the
the method information in content process.
--HG--
extra : histedit_source : 8426da9c1d070daa35623b3431341c13cb361aed
1. Add a new attribute nsIPaymentOptions.requestBillingAddress.
2. Add new XPCOM interfaces MethodChangeDetails, GeneralChangeDetails and
BasicCardMethodChangeDetails for passing the method change details from
UI code.
--HG--
extra : histedit_source : 680bff71f0d8a9d9333a3699fcc6a4fd9630fe1b
1. Add a new method nsIPaymentRequestService::ChangePaymentMethod for UI to
inform merchant the payment method is changed by user.
2. Add a new method in PPaymentRequest.ipdl to passing the changing method
information from chrome process to content process.
3. Add BasicCardChangeDetails dictionary in BasicCardPayment.webidl
4. Create ChangeDetails, GeneralDetails and BasicCardDetails for saving the
the method information in content process.
1. Add a new attribute nsIPaymentOptions.requestBillingAddress.
2. Add new XPCOM interfaces MethodChangeDetails, GeneralChangeDetails and
BasicCardMethodChangeDetails for passing the method change details from
UI code.
1. Adding a new completeStatus 'initial' for nsIPaymentRequest.completeStatus
to indicate the status of the showing PaymentRequest for Payment UI component.
2. Removing the PaymentRequest::mDeferredShow and calling
PaymentRequestManager::showPayment() when PaymentRequest::Show() called
with a detailsUpdate parameter to inform UI component to support better
user experience.
The concept of card types, supportedTypes, BasicCardType enum, were removed from the Basic Card spec.
Differential Revision: https://phabricator.services.mozilla.com/D10646
--HG--
extra : moz-landing-system : lando
In original design, payment method response data is passed between processes
through a simple nsString. It means a special encoder/decoder is needed for
special response data, ex. BasicCardResponse, to serialize/deserialize
into/from the nsString. However, when a token spliter, ':', ';' and '@', is
used in response data, it makes the encoder/decoder can not work normally.
It is hard to define a suitable token spliter set for encoder/decoder.
So instead of using an error-prone encoder/decoder, this patch defining a new
IPC structure for response data.
--HG--
extra : rebase_source : 4972033516bc861ea3f975a27b7688fc6eb89a94
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.
Differential Revision: https://phabricator.services.mozilla.com/D6861
--HG--
extra : moz-landing-system : lando
Removing PaymentRequestManager::mShowingRequest and related code.
PaymentRequest showing is controlled by PaymentRequestService in chrome
process, before we come out the solution for bug 1469419, we don't need
showing control in content process.
1. Adding a checking before clearing PaymentRequestService::mShowingRequest.
Clearing PaymentRequestService::mShowingRequest when it is rejected.
2. Adding an internal method nsresult ShowPayment(const nsAString& requestId)
to remove the duplicate code in PaymentRequestService.
Add state checking when calling RespondPayment(), ChangeShippingAddress()
and ChangeShippingOption().
Calling ChangeShippingXXX is valid when the PaymentRequest state is interactive.
Calling RespondPayment is valid when following situations
1. PaymentRequest state is interactive
2. PaymentRequest state is closed but the response is for CompleteAction.
3. PaymentRequest state is created but the response is for CanMakeAction.
--HG--
extra : histedit_source : 9ae63e409813154de42cc33024835ac5f0c96893
Adding testcase for interacting with PaymentRequest in wrong PaymentRequest
state. Calling RespondPayment(), ChangeShippingOption() and
ChangeShippingAddress() in wrong state should return error. This test case
verifying the behavior when calling these methods when PaymentRequest state
is eClosed and after PaymentResponse::complete() called.
--HG--
extra : histedit_source : 3e70e64ac739dd7d8cbc4627dbdbd64462ae4211
To support merchants providing the payment details with errors by
PaymentRequestUpdateEvent.updateWith() during PaymentResponse.retry(),
PaymentDetailsUpdate needs to add more two attributes in webidl.
dictionary PaymentDetailsUpdate {
...
PayerErrorFields payerErrors;
object paymentMethodErrors;
};
And transfer these error field to UI component
1. Add PaymentValidationErrors and PayerErrorFields in PaymentRequest.webidl
and PaymentResponse.retry() in PaymentResponse.webidl
2. Implement PaymentRequest.retryPayment() and
PaymentRequestManager.retryPayment() in content process.
3. Add IPCPaymentRetryActionRequest in PPaymentRequest.ipdl to transfer the
error fields to chrome process.
4. Implement PaymentResponse.retry() by reusing the code of show() and
updateWith() of PaymentRequestService in chrome process.
Remove the unnecessary XPCOM component nsIPaymentActionRequest and
nsIPaymentActionCallback. These two components are only used in C++ and they
need not to expose to the front end.
1. Add testcase testRetryAfterComplete to test the behavior of retry() after
complete().
2. Add testcase testRetryAfterRetry to test the multiple retry()s in the same
round.
3. Add testcase testRetryWithEmptyErrors to test the retry() called with an
empty PaymentValidationErrors.
4. Add testcase testRetry to test the normal flow of retry().
5. Add testcase testRetryAbortByUser to test the retry() aborted by user.