Commit graph

76 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
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
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
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
Diego Pino Garcia
be8ed17778 Bug 1429198 - Account for supportedNetworks in payment modifiers. r=MattN 2018-12-20 07:24:00 +02: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
Timothy Guan-tin Chien
9ac2863a64 Bug 1504268 - Show proper OS login dialog labels when filling/editing credit cards r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D11095

--HG--
extra : moz-landing-system : lando
2018-11-19 21:00:02 +00: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
Matthew Noorenberghe
fc94384b79 Bug 1486954 - Part IV, Recover from decryption errors in some places. r=MattN
In case of loss of OS key store key, we should still allow users to go into the manage credit cards dialog and fill the numbers back in.

This is not the migration strategy, see Part III.

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

--HG--
extra : rebase_source : dc710a2512b0d9b20e0fa74e641867525098eba2
extra : histedit_source : 4983a480565380ce4da6a0f099a5e4ae0e65797d
2018-10-22 22:57:29 -07:00
Timothy Guan-tin Chien
b2023e958b Bug 1486954 - Part I, Encrypt credit card numbers with OS key store. r=MattN
This patch morphs MasterPassword.jsm to OSKeyStore.jsm while keeping the same
API, as an adaptor between the API and the native API exposed as nsIOSKeyStore.idl.

Noted that OS Key Store has the concept of "recovery phrase" that we won't
be adopting here. The recovery phrase, together with our label, allow
the user to re-create the same key in OS key store.

Test case changes are needed because we have started asking for login in
places where we'll only do previously when "master password is enabled".
This also made some "when master password is enabled" tests invalid because
it is always considered enabled.

Some more test changes are needed simply because they previously rely on the
stable order of microtask resolutions (and the stable # of promises for a
specific operation). That has certainly changed with OSKeyStore.

The credit card form autofill is only enabled on Nightly.

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

--HG--
rename : browser/extensions/formautofill/MasterPassword.jsm => browser/extensions/formautofill/OSKeyStore.jsm
rename : browser/extensions/formautofill/test/browser/browser_creditCard_fill_master_password.js => browser/extensions/formautofill/test/browser/browser_creditCard_fill_cancel_login.js
extra : rebase_source : cabbd8cdec86e5b3965cf1c8b6e635b73b6c2095
extra : histedit_source : 65e71057104465553fefa1d0b293580efed53075
2018-10-17 02:31:04 +00:00
Matthew Noorenberghe
ec9bd73e34 Bug 1435871 - Open prefs from Payment Request in a tab. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D8497

--HG--
extra : moz-landing-system : lando
2018-10-20 03:40:05 +00:00
Matthew Noorenberghe
b059591dff Bug 1435871 - Implement a basic tab-modal dialog container for Payment Request. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D7934

--HG--
extra : moz-landing-system : lando
2018-10-20 03:39:32 +00:00
Jared Wein
e85599dc8f Bug 1494551 - Sort the formautofill data by the last used time. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D9174

--HG--
extra : moz-landing-system : lando
2018-10-19 17:00:31 +00:00
Jared Wein
eb7010591a Bug 1420853 - Ensure only fields valid for the given country are saved. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D9034

--HG--
extra : moz-landing-system : lando
2018-10-19 16:36:45 +00:00
Brindusan Cristian
1420f3437e Backed out 2 changesets (bug 1435871) for multiple browser-chrome failures on payments. CLOSED TREE
Backed out changeset 0f7592b662e2 (bug 1435871)
Backed out changeset 039f6d65036e (bug 1435871)
2018-10-19 12:36:13 +03:00
Matthew Noorenberghe
783e80be91 Bug 1435871 - Open prefs from Payment Request in a tab. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D8497

--HG--
extra : moz-landing-system : lando
2018-10-19 05:06:30 +00:00
Matthew Noorenberghe
28552cda7d Bug 1435871 - Implement a basic tab-modal dialog container for Payment Request. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D7934

--HG--
extra : moz-landing-system : lando
2018-10-19 05:06:22 +00:00
Margareta Eliza Balazs
53fc8ddacd Backed out 4 changesets (bug 1486954) for hangs on Linux. a=backout
Backed out changeset c895888bdddc (bug 1486954)
Backed out changeset 27e9286503e8 (bug 1486954)
Backed out changeset 87e64652386d (bug 1486954)
Backed out changeset 96a6e1ceb697 (bug 1486954)

--HG--
rename : browser/extensions/formautofill/OSKeyStore.jsm => browser/extensions/formautofill/MasterPassword.jsm
rename : browser/extensions/formautofill/test/browser/browser_creditCard_fill_cancel_login.js => browser/extensions/formautofill/test/browser/browser_creditCard_fill_master_password.js
2018-10-18 12:40:21 +03:00
Timothy Guan-tin Chien
3aaef61c6c Bug 1486954 - Part IV, Recover from decryption errors in some places r=MattN
In case of loss of OS key store key, we should still allow users to go into the manage credit cards dialog and fill the numbers back in.

This is not the migration strategy, see Part III.

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

--HG--
extra : moz-landing-system : lando
2018-10-17 02:34:22 +00:00
Timothy Guan-tin Chien
f47a796bf6 Bug 1486954 - Part I, (Nighty-only feature) Encrypt credit card numbers with OS key store r=MattN
This patch morphs MasterPassword.jsm to OSKeyStore.jsm while keeping the same
API, as an adaptor between the API and the native API exposed as nsIOSKeyStore.idl.

Noted that OS Key Store has the concept of "recovery phrase" that we won't
be adopting here. The recovery phrase, together with our label, allow
the user to re-create the same key in OS key store.

Test case changes are needed because we have started asking for login in
places where we'll only do previously when "master password is enabled".
This also made some "when master password is enabled" tests invalid because
it is always considered enabled.

Some more test changes are needed simply because they previously rely on the
stable order of microtask resolutions (and the stable # of promises for a
specific operation). That has certainly changed with OSKeyStore.

The credit card form autofill is only enabled on Nightly.

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

--HG--
rename : browser/extensions/formautofill/MasterPassword.jsm => browser/extensions/formautofill/OSKeyStore.jsm
rename : browser/extensions/formautofill/test/browser/browser_creditCard_fill_master_password.js => browser/extensions/formautofill/test/browser/browser_creditCard_fill_cancel_login.js
extra : moz-landing-system : lando
2018-10-17 02:31:04 +00:00
Eden Chuang
05093acbf4 Bug 1441752 - Adding an new attribute regionCode in PaymentAddress. r=baku
--HG--
extra : histedit_source : d71b94a611ff5cd3f5b556de9157ff46a5cfeda6
2018-09-28 12:21:59 +02:00
Sam Foster
177b10d96f Bug 1477102 - Add third-party payment card logos, enable their use in official, branded builds. r=MattN
Depends on D7025

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

--HG--
extra : moz-landing-system : lando
2018-09-28 16:53:49 +00:00
Sam Foster
b6ecb8ed07 Bug 1477102 - Toggle accepted cards list on add/edit cards. Add stub for using AppConstants.MOZILLA_OFFICIAL to fallback for non-branded builds. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D7025

--HG--
extra : moz-landing-system : lando
2018-09-28 16:53:37 +00:00
Jared Wein
acbe499b25 Bug 1470184 - Update the Preferences text and layout for Web Payments. r=flod,MattN
Differential Revision: https://phabricator.services.mozilla.com/D6937

--HG--
extra : moz-landing-system : lando
2018-09-28 08:29:01 +00:00
Matthew Noorenberghe
05d5fb0939 Bug 1490805 - Add a required CSC/CVV field to the add card page. r=jaws
Depends on D6882

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

--HG--
extra : moz-landing-system : lando
2018-09-27 17:26:24 +00:00
Matthew Noorenberghe
4aaa87fe69 Bug 1432939 - Link to Firefox Options/Preferences from the PaymentRequest dialog. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D6724

--HG--
extra : moz-landing-system : lando
2018-09-25 17:26:38 +00:00
Matthew Noorenberghe
5ba6f9aa93 Bug 1480717 - Fix credit card form billing address and persist checkbox layout. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D4175

--HG--
extra : moz-landing-system : lando
2018-09-24 19:51:39 +00:00
Jared Wein
416ff8c392 Bug 1481972 - Add remaining countries to address autofill countries list. r=MattN
Saving and filling the countries via Form Autofill will still be limited to certain countries
but this allows the storage to be useful for Web Payments in other countries.

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

--HG--
extra : amend_source : c6810478b747cf51aaaafa73f83682cb23711231
2018-09-23 23:50:03 -07:00
Sam Foster
a3ee1b5ad2 Bug 1429181 - Fix serialization of payment method data. r=MattN
* Includes a workaround to explicitly cloneInto the paymentMethods data when we create the PaymentRequest object in the content window in tests.

MozReview-Commit-ID: LFy0h3fIXXA

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

--HG--
extra : moz-landing-system : lando
2018-09-14 20:24:08 +00:00
Timothy Guan-tin Chien
4b8e9c3d4a Bug 1399367 - Remove MasterPassword.{encrypt|decrypt}Sync() methods r=MattN
This also makes various AutofillRecords methods async, with the exception of
remove() and removeAll().

Noted that I didn't implement any kind of "lock" for FormAutofillStorage --
please do not call these methods concurrently -- if you must please |await|
for the last call to resolve. This most likely would happen in tests, and
shouldn't happen in the real world, given that all user actions happen on
macrotasks, and probably not at the next tick, unless Quicksilver is a
Firefox user.

FormAutofillStorage can be improved if there are complex use cases for it.

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

--HG--
extra : moz-landing-system : lando
2018-09-05 17:54:48 +00:00
Csoregi Natalia
0ee540d6b5 Backed out changeset 56aa054d4cc0 (bug 1399367) for browser/extensions/formautofill/test/unit/test_activeStatus.js failures. CLOSED TREE 2018-09-05 05:47:21 +03:00
Timothy Guan-tin Chien
a3d7d3c3d1 Bug 1399367 - Remove MasterPassword.{encrypt|decrypt}Sync() methods r=MattN
This also makes various AutofillRecords methods async, with the exception of
remove() and removeAll().

Noted that I didn't implement any kind of "lock" for FormAutofillStorage --
please do not call these methods concurrently -- if you must please |await|
for the last call to resolve. This most likely would happen in tests, and
shouldn't happen in the real world, given that all user actions happen on
macrotasks, and probably not at the next tick, unless Quicksilver is a
Firefox user.

FormAutofillStorage can be improved if there are complex use cases for it.

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

--HG--
extra : moz-landing-system : lando
2018-09-05 00:32:57 +00:00
Marcos Cáceres
8128af9850 Bug 1485881 - Drop support for PaymentAddress.languageCode r=smaug
--HG--
extra : rebase_source : 6400765c8b669126c7a71f5094dd160b2b1a89ce
2018-08-27 16:30:00 +03:00
Margareta Eliza Balazs
4d0c09ec59 Backed out changeset 3fcc7597cd8d (bug 1429198) for ES lint failure in builds/worker/checkouts/gecko/browser/components/payments/res/paymentRequest.js. CLOSED TREE
--HG--
extra : amend_source : cd939d4dce261184414b49626d0ca916ac6c8a99
2018-12-18 15:50:33 +02:00
Diego Pino Garcia
9a04b4475e Bug 1429198 - Account for supportedNetworks in payment modifiers. r=MattN 2018-12-17 22:15:00 +02:00
Sam Foster
2f87b0ad28 Bug 1477105 - Support cc-type as valid field for credit cards in form autofill. r=MattN
* Add cc-type as a valid field for credit card forms
* Add a select menu and new string for designating a card type in the add/edit form
* Enforce matching of cc-type to one of the list of supported network ids for Basic Card
* Expose the network ids list as CreditCard.SUPPORTED_TYPES
* Populate the cc-type options using a getCreditCardTypes util method passed into the EditCreditCard constructor

* Web Payment tests: verify cc-type picker is presented, populated as expected and selections received in the response

MozReview-Commit-ID: 9QyU1UwTRay

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

--HG--
extra : rebase_source : 4ffffa97e845d727f1bfbcc88218992ed7d6c5a0
2018-08-28 15:59:57 -07:00
prathiksha
c8c6fdba8f Bug 1475760 - Take address-fields into account for payer/contact picker dropdown labels. r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D2831

--HG--
extra : rebase_source : 13304d7b7739ebb5a2b7d835ffaf088dc40afd17
2018-08-20 13:23:43 -07:00
Sam Foster
a4aca2683c Bug 1480880 - Fix exposing of payment defaults prefs object. r=MattN
MozReview-Commit-ID: DRSiGjk6wyS

--HG--
extra : rebase_source : 179cfde242c2ec965ef01c670baf26e7a06b92fb
2018-08-03 11:51:10 -07:00
Kris Maglione
25c94b46d8 Bug 1481021: Part 1 - Fix tests that rely on permissive COWs or SpecialPowers side-effects in frame script scopes. r=bz
Right now, a lot of test code relies on side-effects of SpecialPowers being
loaded into frame script globals. In particular:

- It forces permissive COWs from those scopes, which allows frame scripts to
  pass objects from those scopes to unprivileged content that they otherwise
  wouldn't.
- It imports a bunch of helper modules and WebIDL globals which would
  otherwise not be available.

Fortunately, this seems to only impact test code at this point. But there's a
real down-the-road risk of it impacting shipping code, which ends up working
in automation due to the side-effects of SpecialPowers, but failing in real
world use.

MozReview-Commit-ID: G27eSSOHymX

--HG--
extra : rebase_source : 1702e63fed719fc92def2bdbbb8a7c53572432db
extra : source : 41bedc526dd6ec6b7e8c7be1c832ac60c81d6263
2018-08-07 14:13:06 -07:00