Commit graph

241 commits

Author SHA1 Message Date
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
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
2019-01-17 10:18:31 -08:00
Margareta Eliza Balazs
413dd3a1fa Merge inbound to mozilla-central. a=merge 2018-12-21 11:37:24 +02:00
Narcis Beleuzu
2b363fce3a Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-12-21 00:06:08 +02:00
Jared Wein
4bf1467ca5 Bug 1474905 - Use a dropdown for the state/province field when possible. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11854

--HG--
extra : moz-landing-system : lando
2018-12-20 22:10:00 +00:00
Matthew Noorenberghe
91692c277f Bug 1515048 - Disable the Payment Request UI and tests by default on Nightly. r=jaws,baku
Differential Revision: https://phabricator.services.mozilla.com/D14885

--HG--
extra : moz-landing-system : lando
2018-12-20 15:08:47 +00:00
Cosmin Sabou
1d49103119 Backed out changeset c4d1729c029e (bug 1474905) for browser chrome failures on browser_editCreditCardDialog.js. CLOSED TREE 2018-12-14 21:44:32 +02:00
Jared Wein
91e9a06355 Bug 1474905 - Use a dropdown for the state/province field when possible. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11854

--HG--
extra : moz-landing-system : lando
2018-12-14 18:52:19 +00:00
Jared Wein
6989ff6cec Bug 1477113 - Dispatch paymentmethodchange event from the front-end. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D13740

--HG--
extra : moz-landing-system : lando
2018-12-13 18:48:54 +00:00
Narcis Beleuzu
99f7b49656 Backed out changeset 3fa420b71260 (bug 1477113) for bc failures on browser_total.js. CLOSED TREE 2018-12-13 09:53:39 +02:00
Jared Wein
bbfb132319 Bug 1477113 - Dispatch paymentmethodchange event from the front-end. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D13740

--HG--
extra : moz-landing-system : lando
2018-12-13 06:35:30 +00:00
Coroiu Cristina
59f79d44b0 Merge mozilla-central to inbound a=merge on a CLOSED TREE 2018-12-12 00:01:36 +02:00
Matthew Noorenberghe
865adcf2a7 Bug 1495549 - Clear paymentMethod errors when the paymentMethod changes. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D13451

--HG--
extra : moz-landing-system : lando
2018-12-11 18:18:15 +00:00
Matthew Noorenberghe
b82e3514a4 Bug 1495549 - Clear merchant payer errors when the payer address changes. r=jaws
Depends on D12605

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

--HG--
extra : moz-landing-system : lando
2018-12-11 18:17:31 +00:00
Matthew Noorenberghe
a41a15391f Bug 1495549 - Clear merchant shipping errors when the shipping address changes. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D12605

--HG--
rename : browser/components/payments/test/browser/browser_retry.js => browser/components/payments/test/browser/browser_retry_fieldErrors.js
extra : moz-landing-system : lando
2018-12-11 18:16:30 +00:00
Jeff Walden
e5132ffa4b Bug 1492932 - Load JS components and modules as UTF-8, not as Latin-1. r=kmag
--HG--
extra : rebase_source : d09627655e9c72e674356e996f936ec65a80b6f0
2018-12-04 17:01:06 -05:00
Diego Pino Garcia
be8ed17778 Bug 1429198 - Account for supportedNetworks in payment modifiers. r=MattN 2018-12-20 07:24:00 +02:00
Cosmin Sabou
20c5475d6d Merge mozilla-central to autoland. 2018-11-28 06:11:15 +02:00
Matthew Noorenberghe
f34b971aa6 Bug 1510470 - Disable OS re-auth for credit cards by default. r=timdream
Differential Revision: https://phabricator.services.mozilla.com/D13169

--HG--
extra : moz-landing-system : lando
2018-11-28 01:08:35 +00:00
Sam Foster
44f245f69d Bug 1481481 - Create separate forms for shipping, payer and billing address r=MattN
* New AddressForm instances for each address type
* Move selected-state-key out of state for the address forms, and into an attribute
* Remove passing form title via state, just use data-title-edit and data-title-add on the element
* Remove shippingOption form title logic from address picker, just set the right attribute values from PaymentDialog
* Move setting the extraRequiredFields data attribute the payer form needs out to the payment-dialog's render.
* Amend onboarding logic to direct to billing address form when necessary
* Fix-up tests

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

--HG--
extra : moz-landing-system : lando
2018-11-21 19:23:27 +00:00
Matthew Noorenberghe
8cc7e92622 Bug 1505141 - Test that address fields hidden from edit forms aren't blanked unnecessarily. r=jaws
Depends on D12190

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

--HG--
rename : browser/components/payments/test/browser/browser_address_edit.js => browser/components/payments/test/browser/browser_address_edit_hidden_fields.js
extra : moz-landing-system : lando
2018-11-21 00:43:46 +00:00
Matthew Noorenberghe
4d0cbeac7f Bug 1505141 - Always preserveOldProperties for payment request but blank mailing address fields by default. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D12190

--HG--
extra : moz-landing-system : lando
2018-11-21 00:46:23 +00:00
Sebastian Hengst
30252fd68c Bug 1508577 - disable browser/components/payments/test/browser/browser_tab_modal.js on Linux opt-ish for permafails (reason unknown). a=test-disabling 2018-11-20 11:05:40 +02:00
Jared Wein
a75e459698 Bug 1495122 - Support regionCode and dependentLocality for merchant errors. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11844

--HG--
extra : moz-landing-system : lando
2018-11-16 04:47:15 +00:00
Csoregi Natalia
9b0f48f9d3 Backed out changeset 081704356a93 (bug 1495122) for bc failures on browser_shippingaddresschange_error.js. CLOSED TREE 2018-11-16 00:13:55 +02:00
Jared Wein
cfab10d500 Bug 1495122 - Support regionCode and dependentLocality for merchant errors. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11844

--HG--
extra : moz-landing-system : lando
2018-11-15 21:19:43 +00:00
shindli
5770e9cf94 Backed out changeset 3df92480890e (bug 1495122) as it was requested by the dev on irc 2018-11-15 23:13:12 +02:00
Jared Wein
d934d7d74c Bug 1495122 - Support regionCode and dependentLocality for merchant errors. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11844

--HG--
extra : moz-landing-system : lando
2018-11-15 21:08:07 +00:00
Matthew Noorenberghe
7130ce9204 Bug 1435880 - Handle moving/detaching tabs between windows when a Payment Request is showing. r=jaws
Depends on D10180

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

--HG--
rename : browser/components/payments/test/browser/browser_show_dialog.js => browser/components/payments/test/browser/browser_tab_modal.js
extra : moz-landing-system : lando
2018-11-15 15:06:21 +00:00
Matthew Noorenberghe
b22b368fd6 Bug 1435880 - Put the payment dialog <browser> directly in the ChromeWindow. r=jaws
Remove the intermediate <html:iframe> as it makes support of detaching impossible since we would need
to swap both the <browser> and <html:iframe> contents during a tab detach.
Since a docshell swap requires both docshells to have a frame and document loaded and the move of the
tab won't wait on payments code to do async work to get frames and documents ready for swapping, I
couldn't see a way to get detaching to work with the nested frames.

* Swapping the docshell of only the outer <html:iframe> still caused a reload of the inner <browser>.

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

--HG--
extra : moz-landing-system : lando
2018-11-15 15:05:12 +00:00
Jared Wein
f01bbdcfcd Bug 1501170 - Render the defaultValue in the CSC input if one has been provided. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11541

--HG--
extra : moz-landing-system : lando
2018-11-13 17:45:23 +00:00
Marcos Cáceres
da6078096e Bug 1504032 - Remove concept of card types, supportedTypes, BasicCardType enum r=MattN,baku
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
2018-11-10 06:59:26 +00:00
Matthew Noorenberghe
993a88ccc2 Bug 1505707 - Sandbox the template frame for payment mochitests to prevent JS execution errors. r=jaws
We only want the frame to be able to share markup, we don't need JS to execute and the JS was causing an unhandled rejection error.

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

--HG--
extra : moz-landing-system : lando
2018-11-09 20:11:46 +00:00
Sam Foster
8401d41400 Bug 1492399 - honor preserveFieldValues when generating billing address options. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11129

--HG--
extra : moz-landing-system : lando
2018-11-07 18:41:37 +00:00
Sam Foster
aa95912b8b Bug 1482689 - Use AddressPicker for the card billing address UI. r=MattN
* New BillingAddressPicker subclass of AddressPicker which just overrides some of the state-related behavior that
* Allow the RichSelect's popupBox (<select>) to be assigned after the constructor
* A couple new mochitests for the new/different behavior
* Update the test to expect 'edit' to be hidden when the empty option is selected

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

--HG--
extra : moz-landing-system : lando
2018-11-06 00:28:46 +00:00
Brindusan Cristian
94b707cdd4 Backed out changeset ea5d6df24de0 (bug 1482689) as requested by sfoster. 2018-11-06 02:20:51 +02:00
Sam Foster
47668991be Bug 1482689 - Use AddressPicker for the card billing address UI. r=MattN
* New BillingAddressPicker subclass of AddressPicker which just overrides some of the state-related behavior that
* Allow the RichSelect's popupBox (<select>) to be assigned after the constructor
* A couple new mochitests for the new/different behavior
* Update the test to expect 'edit' to be hidden when the empty option is selected

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

--HG--
extra : moz-landing-system : lando
2018-11-06 00:04:42 +00:00
Cosmin Sabou
d5f49855cd Backed out 2 changesets (bug 1482689) for browser chrome failures on browser_address_edit.js
Backed out changeset 61b49da4b9cb (bug 1482689)
Backed out changeset c810cab5dbdb (bug 1482689)
2018-11-05 18:28:15 +02:00
Sam Foster
2dbcd5bcca Bug 1482689 - Use AddressPicker for the card billing address UI. r=MattN
* New BillingAddressPicker subclass of AddressPicker which just overrides some of the state-related behavior that isn't applicable to billing addresses.
* A couple new mochitests for the new/different behavior

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

--HG--
extra : moz-landing-system : lando
2018-11-05 15:16:02 +00:00
Jared Wein
ed95c3076b Bug 1497225 - Update the required asterisk display when changing countries. r=sfoster,MattN
Differential Revision: https://phabricator.services.mozilla.com/D10637

--HG--
extra : moz-landing-system : lando
2018-11-02 20:53:12 +00:00
Noemi Erli
bc6ac5be87 Backed out changeset 8cd7b1c3737a (bug 1497225) for failures in browser_editAddressDialog.js 2018-11-02 22:11:24 +02:00
Jared Wein
d29ee44549 Bug 1497225 - Update the required asterisk display when changing countries. r=sfoster,MattN
Differential Revision: https://phabricator.services.mozilla.com/D10637

--HG--
extra : moz-landing-system : lando
2018-11-02 19:03:39 +00:00
Jared Wein
9d2ad063d8 Bug 1483412 - Make the telephone number field required on the payer form if requestPayerPhone is true. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D10597

--HG--
extra : moz-landing-system : lando
2018-11-01 22:38:03 +00:00
Timothy Guan-tin Chien
f611c1e93c Bug 1429265 - Re-authenticate the user on Windows and macOS before decryption r=MattN
This patch restores the re-auth test pref previously comment out,
and redirect the re-auth to nsIOSReauthenticator on Windows and macOS.

Noted that nsIOSReauthenticator is never called during tests because we can't automate that dialog.

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

--HG--
extra : moz-landing-system : lando
2018-10-31 23:18:54 +00:00
Eden Chuang
74e578d048 Bug 1497215 - Refactor the IPC structure for PaymentResponse.details r=baku
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
2018-10-29 13:56:32 +01:00
Diego Pino Garcia
f1008b35ec Bug 1509147 - Rename payer and paymentMethod on nsIPaymentDetails to payerErrors and paymentMethodErrors respectively r=baku 2018-11-26 03:08:00 +02:00
Matthew Noorenberghe
319c718b8d Bug 1465673 - Disable browser_card_edit.js in macOS debug builds due to high failure rates. r=me 2018-10-23 15:14:11 -07:00
Margareta Eliza Balazs
1a7c7d8823 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-10-23 12:31:53 +03:00
Matthew Noorenberghe
9d8e99883d Bug 1486954 - Fix browser/components/payments/test/browser/head.js eslint issue. r=me 2018-10-22 23:13:54 -07:00
Julian Descottes
73e3a16c0d Bug 1499096 - Use ok() with 2 arguments instead of 3 when possible;r=Standard8
Depends on D8740.
This changeset replaces calls to ok with 3 arguments to calls with 2 arguments
in situations where the switch does not have a significant impact on the assert.

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

--HG--
extra : moz-landing-system : lando
2018-10-23 07:13:35 +00:00
Julian Descottes
2fcd6cb020 Bug 1499096 - Update tests using ok() to is();r=Standard8
This changeset updates all the test that were wrongly using ok() and wanted to
use is() AND for which the assert is still passing without any modification
required.

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

--HG--
extra : moz-landing-system : lando
2018-10-23 07:12:23 +00:00