Bug 1457287 - Move Payment Request UI code to browser/. r=jaws
☠☠ backed out by 9424d87854e4 ☠ ☠
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 26 Apr 2018 16:57:02 -0700
changeset 415977 a8fef63084795665c01e9753fb8647b71e9c0331
parent 415976 ef26c00223691ade20d344707e30220580d664aa
child 415978 7d6abd1366c1060ca6b89e937a6e606c309f7105
push id102694
push usercsabou@mozilla.com
push dateFri, 27 Apr 2018 10:15:42 +0000
treeherdermozilla-inbound@d8c8620f0be8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1457287
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1457287 - Move Payment Request UI code to browser/. r=jaws MozReview-Commit-ID: BUDOsda1kSE
.eslintignore
browser/base/content/test/static/browser_parsable_script.js
browser/components/moz.build
browser/components/payments/.eslintrc.js
browser/components/payments/content/paymentDialogFrameScript.js
browser/components/payments/content/paymentDialogWrapper.css
browser/components/payments/content/paymentDialogWrapper.js
browser/components/payments/content/paymentDialogWrapper.xhtml
browser/components/payments/docs/index.rst
browser/components/payments/jar.mn
browser/components/payments/moz.build
browser/components/payments/paymentUIService.js
browser/components/payments/payments.manifest
browser/components/payments/res/PaymentsStore.js
browser/components/payments/res/components/address-option.css
browser/components/payments/res/components/address-option.js
browser/components/payments/res/components/basic-card-option.css
browser/components/payments/res/components/basic-card-option.js
browser/components/payments/res/components/currency-amount.js
browser/components/payments/res/components/labelled-checkbox.js
browser/components/payments/res/components/payment-details-item.css
browser/components/payments/res/components/payment-details-item.js
browser/components/payments/res/components/rich-option.js
browser/components/payments/res/components/rich-select.css
browser/components/payments/res/components/rich-select.js
browser/components/payments/res/components/shipping-option.css
browser/components/payments/res/components/shipping-option.js
browser/components/payments/res/containers/address-form.js
browser/components/payments/res/containers/address-picker.js
browser/components/payments/res/containers/basic-card-form.js
browser/components/payments/res/containers/order-details.css
browser/components/payments/res/containers/order-details.js
browser/components/payments/res/containers/payment-dialog.js
browser/components/payments/res/containers/payment-method-picker.js
browser/components/payments/res/containers/shipping-option-picker.js
browser/components/payments/res/debugging.css
browser/components/payments/res/debugging.html
browser/components/payments/res/debugging.js
browser/components/payments/res/mixins/ObservedPropertiesMixin.js
browser/components/payments/res/mixins/PaymentStateSubscriberMixin.js
browser/components/payments/res/paymentRequest.css
browser/components/payments/res/paymentRequest.js
browser/components/payments/res/paymentRequest.xhtml
browser/components/payments/res/unprivileged-fallbacks.js
browser/components/payments/res/vendor/custom-elements.min.js
browser/components/payments/res/vendor/custom-elements.min.js.map
browser/components/payments/server.py
browser/components/payments/test/PaymentTestUtils.jsm
browser/components/payments/test/browser/.eslintrc.js
browser/components/payments/test/browser/blank_page.html
browser/components/payments/test/browser/browser.ini
browser/components/payments/test/browser/browser_address_edit.js
browser/components/payments/test/browser/browser_card_edit.js
browser/components/payments/test/browser/browser_change_shipping.js
browser/components/payments/test/browser/browser_host_name.js
browser/components/payments/test/browser/browser_profile_storage.js
browser/components/payments/test/browser/browser_request_serialization.js
browser/components/payments/test/browser/browser_request_shipping.js
browser/components/payments/test/browser/browser_request_summary.js
browser/components/payments/test/browser/browser_shippingaddresschange_error.js
browser/components/payments/test/browser/browser_show_dialog.js
browser/components/payments/test/browser/browser_total.js
browser/components/payments/test/browser/head.js
browser/components/payments/test/mochitest/.eslintrc.js
browser/components/payments/test/mochitest/formautofill/mochitest.ini
browser/components/payments/test/mochitest/formautofill/test_editCreditCard.html
browser/components/payments/test/mochitest/mochitest.ini
browser/components/payments/test/mochitest/payments_common.js
browser/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
browser/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
browser/components/payments/test/mochitest/test_PaymentsStore.html
browser/components/payments/test/mochitest/test_address_form.html
browser/components/payments/test/mochitest/test_address_picker.html
browser/components/payments/test/mochitest/test_basic_card_form.html
browser/components/payments/test/mochitest/test_currency_amount.html
browser/components/payments/test/mochitest/test_labelled_checkbox.html
browser/components/payments/test/mochitest/test_order_details.html
browser/components/payments/test/mochitest/test_payer_address_picker.html
browser/components/payments/test/mochitest/test_payment_details_item.html
browser/components/payments/test/mochitest/test_payment_dialog.html
browser/components/payments/test/mochitest/test_payment_method_picker.html
browser/components/payments/test/mochitest/test_rich_select.html
browser/components/payments/test/mochitest/test_shipping_option_picker.html
browser/components/payments/test/unit/.eslintrc.js
browser/components/payments/test/unit/head.js
browser/components/payments/test/unit/test_response_creation.js
browser/components/payments/test/unit/xpcshell.ini
browser/installer/allowed-dupes.mn
browser/installer/package-manifest.in
toolkit/components/moz.build
toolkit/components/payments/.eslintrc.js
toolkit/components/payments/content/paymentDialogFrameScript.js
toolkit/components/payments/content/paymentDialogWrapper.css
toolkit/components/payments/content/paymentDialogWrapper.js
toolkit/components/payments/content/paymentDialogWrapper.xhtml
toolkit/components/payments/docs/index.rst
toolkit/components/payments/jar.mn
toolkit/components/payments/moz.build
toolkit/components/payments/paymentUIService.js
toolkit/components/payments/payments.manifest
toolkit/components/payments/res/PaymentsStore.js
toolkit/components/payments/res/components/address-option.css
toolkit/components/payments/res/components/address-option.js
toolkit/components/payments/res/components/basic-card-option.css
toolkit/components/payments/res/components/basic-card-option.js
toolkit/components/payments/res/components/currency-amount.js
toolkit/components/payments/res/components/labelled-checkbox.js
toolkit/components/payments/res/components/payment-details-item.css
toolkit/components/payments/res/components/payment-details-item.js
toolkit/components/payments/res/components/rich-option.js
toolkit/components/payments/res/components/rich-select.css
toolkit/components/payments/res/components/rich-select.js
toolkit/components/payments/res/components/shipping-option.css
toolkit/components/payments/res/components/shipping-option.js
toolkit/components/payments/res/containers/address-form.js
toolkit/components/payments/res/containers/address-picker.js
toolkit/components/payments/res/containers/basic-card-form.js
toolkit/components/payments/res/containers/order-details.css
toolkit/components/payments/res/containers/order-details.js
toolkit/components/payments/res/containers/payment-dialog.js
toolkit/components/payments/res/containers/payment-method-picker.js
toolkit/components/payments/res/containers/shipping-option-picker.js
toolkit/components/payments/res/debugging.css
toolkit/components/payments/res/debugging.html
toolkit/components/payments/res/debugging.js
toolkit/components/payments/res/mixins/ObservedPropertiesMixin.js
toolkit/components/payments/res/mixins/PaymentStateSubscriberMixin.js
toolkit/components/payments/res/paymentRequest.css
toolkit/components/payments/res/paymentRequest.js
toolkit/components/payments/res/paymentRequest.xhtml
toolkit/components/payments/res/unprivileged-fallbacks.js
toolkit/components/payments/res/vendor/custom-elements.min.js
toolkit/components/payments/res/vendor/custom-elements.min.js.map
toolkit/components/payments/server.py
toolkit/components/payments/test/PaymentTestUtils.jsm
toolkit/components/payments/test/browser/.eslintrc.js
toolkit/components/payments/test/browser/blank_page.html
toolkit/components/payments/test/browser/browser.ini
toolkit/components/payments/test/browser/browser_address_edit.js
toolkit/components/payments/test/browser/browser_card_edit.js
toolkit/components/payments/test/browser/browser_change_shipping.js
toolkit/components/payments/test/browser/browser_host_name.js
toolkit/components/payments/test/browser/browser_profile_storage.js
toolkit/components/payments/test/browser/browser_request_serialization.js
toolkit/components/payments/test/browser/browser_request_shipping.js
toolkit/components/payments/test/browser/browser_request_summary.js
toolkit/components/payments/test/browser/browser_shippingaddresschange_error.js
toolkit/components/payments/test/browser/browser_show_dialog.js
toolkit/components/payments/test/browser/browser_total.js
toolkit/components/payments/test/browser/head.js
toolkit/components/payments/test/mochitest/.eslintrc.js
toolkit/components/payments/test/mochitest/formautofill/mochitest.ini
toolkit/components/payments/test/mochitest/formautofill/test_editCreditCard.html
toolkit/components/payments/test/mochitest/mochitest.ini
toolkit/components/payments/test/mochitest/payments_common.js
toolkit/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
toolkit/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
toolkit/components/payments/test/mochitest/test_PaymentsStore.html
toolkit/components/payments/test/mochitest/test_address_form.html
toolkit/components/payments/test/mochitest/test_address_picker.html
toolkit/components/payments/test/mochitest/test_basic_card_form.html
toolkit/components/payments/test/mochitest/test_currency_amount.html
toolkit/components/payments/test/mochitest/test_labelled_checkbox.html
toolkit/components/payments/test/mochitest/test_order_details.html
toolkit/components/payments/test/mochitest/test_payer_address_picker.html
toolkit/components/payments/test/mochitest/test_payment_details_item.html
toolkit/components/payments/test/mochitest/test_payment_dialog.html
toolkit/components/payments/test/mochitest/test_payment_method_picker.html
toolkit/components/payments/test/mochitest/test_rich_select.html
toolkit/components/payments/test/mochitest/test_shipping_option_picker.html
toolkit/components/payments/test/unit/.eslintrc.js
toolkit/components/payments/test/unit/head.js
toolkit/components/payments/test/unit/test_response_creation.js
toolkit/components/payments/test/unit/xpcshell.ini
toolkit/content/license.html
--- a/.eslintignore
+++ b/.eslintignore
@@ -382,21 +382,21 @@ toolkit/components/help/**
 
 # Intentionally invalid JS
 toolkit/components/workerloader/tests/moduleF-syntax-error.js
 
 # Tests old non-star function generators
 toolkit/modules/tests/xpcshell/test_task.js
 
 # External code:
+browser/components/payments/res/vendor/*
 toolkit/components/microformats/test/**
 toolkit/components/microformats/microformat-shiv.js
 toolkit/components/reader/Readability.js
 toolkit/components/reader/JSDOMParser.js
-toolkit/components/payments/res/vendor/*
 
 # Uses preprocessing
 toolkit/content/widgets/wizard.xml
 toolkit/modules/AppConstants.jsm
 toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
 
 # Third party
 toolkit/modules/third_party/**
--- a/browser/base/content/test/static/browser_parsable_script.js
+++ b/browser/base/content/test/static/browser_parsable_script.js
@@ -5,19 +5,19 @@
  * detect newly occurring issues in shipping JS. It is a list of regexes
  * matching files which have errors:
  */
 const kWhitelist = new Set([
   /browser\/content\/browser\/places\/controller.js$/,
 ]);
 
 const kESModuleList = new Set([
-  /toolkit\/res\/payments\/(components|containers|mixins)\/.*\.js$/,
-  /toolkit\/res\/payments\/paymentRequest\.js$/,
-  /toolkit\/res\/payments\/PaymentsStore\.js$/,
+  /browser\/res\/payments\/(components|containers|mixins)\/.*\.js$/,
+  /browser\/res\/payments\/paymentRequest\.js$/,
+  /browser\/res\/payments\/PaymentsStore\.js$/,
 ]);
 
 // Normally we would use reflect.jsm to get Reflect.parse. However, if
 // we do that, then all the AST data is allocated in reflect.jsm's
 // zone. That exposes a bug in our GC. The GC collects reflect.jsm's
 // zone but not the zone in which our test code lives (since no new
 // data is being allocated in it). The cross-compartment wrappers in
 // our zone that point to the AST data never get collected, and so the
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -54,16 +54,19 @@ DIRS += [
     'shell',
     'syncedtabs',
     'uitour',
     'translation',
 ]
 
 DIRS += ['build']
 
+if CONFIG['NIGHTLY_BUILD']:
+    DIRS += ['payments']
+
 XPIDL_SOURCES += [
     'nsIBrowserHandler.idl',
 ]
 
 XPIDL_MODULE = 'browsercompsbase'
 
 EXTRA_PP_COMPONENTS += [
     'BrowserComponents.manifest',
rename from toolkit/components/payments/.eslintrc.js
rename to browser/components/payments/.eslintrc.js
rename from toolkit/components/payments/content/paymentDialogFrameScript.js
rename to browser/components/payments/content/paymentDialogFrameScript.js
rename from toolkit/components/payments/content/paymentDialogWrapper.css
rename to browser/components/payments/content/paymentDialogWrapper.css
rename from toolkit/components/payments/content/paymentDialogWrapper.js
rename to browser/components/payments/content/paymentDialogWrapper.js
--- a/toolkit/components/payments/content/paymentDialogWrapper.js
+++ b/browser/components/payments/content/paymentDialogWrapper.js
@@ -16,27 +16,27 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "MasterPassword",
                                "resource://formautofill/MasterPassword.jsm");
 ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
                                "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "formAutofillStorage", () => {
-  let formAutofillStorage;
+  let storage;
   try {
-    formAutofillStorage = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {})
-                                .formAutofillStorage;
-    formAutofillStorage.initialize();
+    storage = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {})
+                                .storage;
+    storage.initialize();
   } catch (ex) {
-    formAutofillStorage = null;
+    storage = null;
     Cu.reportError(ex);
   }
 
-  return formAutofillStorage;
+  return storage;
 });
 
 var paymentDialogWrapper = {
   componentsLoaded: new Map(),
   frame: null,
   mm: null,
   request: null,
 
rename from toolkit/components/payments/content/paymentDialogWrapper.xhtml
rename to browser/components/payments/content/paymentDialogWrapper.xhtml
rename from toolkit/components/payments/docs/index.rst
rename to browser/components/payments/docs/index.rst
--- a/toolkit/components/payments/docs/index.rst
+++ b/browser/components/payments/docs/index.rst
@@ -21,17 +21,17 @@ Web Payments `does not work without e10s
 Logging
 -------
 
 Set the pref ``dom.payments.loglevel`` to "Debug" to increase the verbosity of console messages.
 
 Unprivileged UI Development
 ---------------------------
 During development of the unprivileged custom elements, you can load the dialog from a
-local server without even requiring a build. Simply run `./mach python toolkit/components/payments/server.py`
+local server without even requiring a build. Simply run `./mach python browser/components/payments/server.py`
 then load `http://localhost:8000/paymentRequest.xhtml?debug=1` in the browser.
 Use the debugging console to load sample data.
 
 Debugging Console
 -----------------
 
 To open the debugging console in the dialog, use the keyboard shortcut
 **Ctrl-Alt-d (Ctrl-Option-d on macOS)**. While loading `paymentRequest.xhtml` directly in the
rename from toolkit/components/payments/jar.mn
rename to browser/components/payments/jar.mn
--- a/toolkit/components/payments/jar.mn
+++ b/browser/components/payments/jar.mn
@@ -1,13 +1,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-toolkit.jar:
+browser.jar:
 %   content payments %content/payments/
     content/payments/paymentDialogFrameScript.js      (content/paymentDialogFrameScript.js)
     content/payments/paymentDialogWrapper.css         (content/paymentDialogWrapper.css)
     content/payments/paymentDialogWrapper.js          (content/paymentDialogWrapper.js)
     content/payments/paymentDialogWrapper.xhtml       (content/paymentDialogWrapper.xhtml)
 
 %   resource payments %res/payments/
     res/payments                                      (res/paymentRequest.*)
rename from toolkit/components/payments/moz.build
rename to browser/components/payments/moz.build
rename from toolkit/components/payments/paymentUIService.js
rename to browser/components/payments/paymentUIService.js
rename from toolkit/components/payments/payments.manifest
rename to browser/components/payments/payments.manifest
rename from toolkit/components/payments/res/PaymentsStore.js
rename to browser/components/payments/res/PaymentsStore.js
rename from toolkit/components/payments/res/components/address-option.css
rename to browser/components/payments/res/components/address-option.css
rename from toolkit/components/payments/res/components/address-option.js
rename to browser/components/payments/res/components/address-option.js
rename from toolkit/components/payments/res/components/basic-card-option.css
rename to browser/components/payments/res/components/basic-card-option.css
rename from toolkit/components/payments/res/components/basic-card-option.js
rename to browser/components/payments/res/components/basic-card-option.js
rename from toolkit/components/payments/res/components/currency-amount.js
rename to browser/components/payments/res/components/currency-amount.js
rename from toolkit/components/payments/res/components/labelled-checkbox.js
rename to browser/components/payments/res/components/labelled-checkbox.js
rename from toolkit/components/payments/res/components/payment-details-item.css
rename to browser/components/payments/res/components/payment-details-item.css
rename from toolkit/components/payments/res/components/payment-details-item.js
rename to browser/components/payments/res/components/payment-details-item.js
rename from toolkit/components/payments/res/components/rich-option.js
rename to browser/components/payments/res/components/rich-option.js
rename from toolkit/components/payments/res/components/rich-select.css
rename to browser/components/payments/res/components/rich-select.css
rename from toolkit/components/payments/res/components/rich-select.js
rename to browser/components/payments/res/components/rich-select.js
rename from toolkit/components/payments/res/components/shipping-option.css
rename to browser/components/payments/res/components/shipping-option.css
rename from toolkit/components/payments/res/components/shipping-option.js
rename to browser/components/payments/res/components/shipping-option.js
rename from toolkit/components/payments/res/containers/address-form.js
rename to browser/components/payments/res/containers/address-form.js
rename from toolkit/components/payments/res/containers/address-picker.js
rename to browser/components/payments/res/containers/address-picker.js
rename from toolkit/components/payments/res/containers/basic-card-form.js
rename to browser/components/payments/res/containers/basic-card-form.js
rename from toolkit/components/payments/res/containers/order-details.css
rename to browser/components/payments/res/containers/order-details.css
rename from toolkit/components/payments/res/containers/order-details.js
rename to browser/components/payments/res/containers/order-details.js
rename from toolkit/components/payments/res/containers/payment-dialog.js
rename to browser/components/payments/res/containers/payment-dialog.js
rename from toolkit/components/payments/res/containers/payment-method-picker.js
rename to browser/components/payments/res/containers/payment-method-picker.js
rename from toolkit/components/payments/res/containers/shipping-option-picker.js
rename to browser/components/payments/res/containers/shipping-option-picker.js
rename from toolkit/components/payments/res/debugging.css
rename to browser/components/payments/res/debugging.css
rename from toolkit/components/payments/res/debugging.html
rename to browser/components/payments/res/debugging.html
rename from toolkit/components/payments/res/debugging.js
rename to browser/components/payments/res/debugging.js
rename from toolkit/components/payments/res/mixins/ObservedPropertiesMixin.js
rename to browser/components/payments/res/mixins/ObservedPropertiesMixin.js
rename from toolkit/components/payments/res/mixins/PaymentStateSubscriberMixin.js
rename to browser/components/payments/res/mixins/PaymentStateSubscriberMixin.js
rename from toolkit/components/payments/res/paymentRequest.css
rename to browser/components/payments/res/paymentRequest.css
rename from toolkit/components/payments/res/paymentRequest.js
rename to browser/components/payments/res/paymentRequest.js
rename from toolkit/components/payments/res/paymentRequest.xhtml
rename to browser/components/payments/res/paymentRequest.xhtml
rename from toolkit/components/payments/res/unprivileged-fallbacks.js
rename to browser/components/payments/res/unprivileged-fallbacks.js
rename from toolkit/components/payments/res/vendor/custom-elements.min.js
rename to browser/components/payments/res/vendor/custom-elements.min.js
rename from toolkit/components/payments/res/vendor/custom-elements.min.js.map
rename to browser/components/payments/res/vendor/custom-elements.min.js.map
rename from toolkit/components/payments/server.py
rename to browser/components/payments/server.py
--- a/toolkit/components/payments/server.py
+++ b/browser/components/payments/server.py
@@ -4,15 +4,15 @@ from SimpleHTTPServer import SimpleHTTPR
 
 class RequestHandler(SimpleHTTPRequestHandler, object):
     def translate_path(self, path):
         # Map autofill paths to their own directory
         autofillPath = "/formautofill"
         if (path.startswith(autofillPath)):
             path = "browser/extensions/formautofill/content" + path[len(autofillPath):]
         else:
-            path = "toolkit/components/payments/res" + path
+            path = "browser/components/payments/res" + path
 
         return super(RequestHandler, self).translate_path(path)
 
 
 if __name__ == '__main__':
     BaseHTTPServer.test(RequestHandler, BaseHTTPServer.HTTPServer)
rename from toolkit/components/payments/test/PaymentTestUtils.jsm
rename to browser/components/payments/test/PaymentTestUtils.jsm
rename from toolkit/components/payments/test/browser/.eslintrc.js
rename to browser/components/payments/test/browser/.eslintrc.js
rename from toolkit/components/payments/test/browser/blank_page.html
rename to browser/components/payments/test/browser/blank_page.html
rename from toolkit/components/payments/test/browser/browser.ini
rename to browser/components/payments/test/browser/browser.ini
rename from toolkit/components/payments/test/browser/browser_address_edit.js
rename to browser/components/payments/test/browser/browser_address_edit.js
--- a/toolkit/components/payments/test/browser/browser_address_edit.js
+++ b/browser/components/payments/test/browser/browser_address_edit.js
@@ -1,8 +1,10 @@
+/* eslint-disable no-shadow */
+
 "use strict";
 
 add_task(async function test_add_link() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: BLANK_PAGE_URL,
   }, async browser => {
     let {win, frame} =
@@ -71,17 +73,17 @@ add_task(async function test_add_link() 
         return state.page.id == "payment-summary";
       }, "Switched back to payment-summary");
     }, EXPECTED_ADDRESS);
 
     await shippingAddressChangePromise;
     info("got shippingaddresschange event");
 
     info("clicking cancel");
-    await spawnPaymentDialogTask(frame, PTU.DialogContentTasks.manuallyClickCancel);
+    spawnPaymentDialogTask(frame, PTU.DialogContentTasks.manuallyClickCancel);
 
     await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed");
   });
 });
 
 add_task(async function test_edit_link() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
@@ -144,14 +146,14 @@ add_task(async function test_edit_link()
         return state.page.id == "payment-summary";
       }, "Switched back to payment-summary");
     }, EXPECTED_ADDRESS);
 
     await shippingAddressChangePromise;
     info("got shippingaddresschange event");
 
     info("clicking cancel");
-    await spawnPaymentDialogTask(frame, PTU.DialogContentTasks.manuallyClickCancel);
+    spawnPaymentDialogTask(frame, PTU.DialogContentTasks.manuallyClickCancel);
 
     await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed");
   });
   await cleanupFormAutofillStorage();
 });
rename from toolkit/components/payments/test/browser/browser_card_edit.js
rename to browser/components/payments/test/browser/browser_card_edit.js
--- a/toolkit/components/payments/test/browser/browser_card_edit.js
+++ b/browser/components/payments/test/browser/browser_card_edit.js
@@ -1,8 +1,10 @@
+/* eslint-disable no-shadow */
+
 "use strict";
 
 add_task(async function test_add_link() {
   const args = {
     methodData: [PTU.MethodData.basicCard],
     details: PTU.Details.total60USD,
   };
   await spawnInDialogForMerchantTask(PTU.ContentTasks.createRequest, async function check() {
rename from toolkit/components/payments/test/browser/browser_change_shipping.js
rename to browser/components/payments/test/browser/browser_change_shipping.js
rename from toolkit/components/payments/test/browser/browser_host_name.js
rename to browser/components/payments/test/browser/browser_host_name.js
rename from toolkit/components/payments/test/browser/browser_profile_storage.js
rename to browser/components/payments/test/browser/browser_profile_storage.js
--- a/toolkit/components/payments/test/browser/browser_profile_storage.js
+++ b/browser/components/payments/test/browser/browser_profile_storage.js
@@ -1,8 +1,10 @@
+/* eslint-disable no-shadow */
+
 "use strict";
 
 const methodData = [PTU.MethodData.basicCard];
 const details = PTU.Details.total60USD;
 
 add_task(async function test_initial_state() {
   let onChanged = TestUtils.topicObserved("formautofill-storage-changed",
                                           (subject, data) => data == "add");
rename from toolkit/components/payments/test/browser/browser_request_serialization.js
rename to browser/components/payments/test/browser/browser_request_serialization.js
rename from toolkit/components/payments/test/browser/browser_request_shipping.js
rename to browser/components/payments/test/browser/browser_request_shipping.js
rename from toolkit/components/payments/test/browser/browser_request_summary.js
rename to browser/components/payments/test/browser/browser_request_summary.js
rename from toolkit/components/payments/test/browser/browser_shippingaddresschange_error.js
rename to browser/components/payments/test/browser/browser_shippingaddresschange_error.js
rename from toolkit/components/payments/test/browser/browser_show_dialog.js
rename to browser/components/payments/test/browser/browser_show_dialog.js
rename from toolkit/components/payments/test/browser/browser_total.js
rename to browser/components/payments/test/browser/browser_total.js
rename from toolkit/components/payments/test/browser/head.js
rename to browser/components/payments/test/browser/head.js
--- a/toolkit/components/payments/test/browser/head.js
+++ b/browser/components/payments/test/browser/head.js
@@ -3,17 +3,17 @@
 /* eslint
   "no-unused-vars": ["error", {
     vars: "local",
     args: "none",
   }],
 */
 
 
-const BLANK_PAGE_PATH = "/browser/toolkit/components/payments/test/browser/blank_page.html";
+const BLANK_PAGE_PATH = "/browser/browser/components/payments/test/browser/blank_page.html";
 const BLANK_PAGE_URL = "https://example.com" + BLANK_PAGE_PATH;
 
 const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"]
                      .getService(Ci.nsIPaymentRequestService);
 const paymentUISrv = Cc["@mozilla.org/dom/payments/payment-ui-service;1"]
                      .getService().wrappedJSObject;
 const {formAutofillStorage} = ChromeUtils.import(
   "resource://formautofill/FormAutofillStorage.jsm", {});
rename from toolkit/components/payments/test/mochitest/.eslintrc.js
rename to browser/components/payments/test/mochitest/.eslintrc.js
rename from toolkit/components/payments/test/mochitest/formautofill/mochitest.ini
rename to browser/components/payments/test/mochitest/formautofill/mochitest.ini
rename from toolkit/components/payments/test/mochitest/formautofill/test_editCreditCard.html
rename to browser/components/payments/test/mochitest/formautofill/test_editCreditCard.html
rename from toolkit/components/payments/test/mochitest/mochitest.ini
rename to browser/components/payments/test/mochitest/mochitest.ini
rename from toolkit/components/payments/test/mochitest/payments_common.js
rename to browser/components/payments/test/mochitest/payments_common.js
rename from toolkit/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
rename to browser/components/payments/test/mochitest/test_ObservedPropertiesMixin.html
rename from toolkit/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
rename to browser/components/payments/test/mochitest/test_PaymentStateSubscriberMixin.html
rename from toolkit/components/payments/test/mochitest/test_PaymentsStore.html
rename to browser/components/payments/test/mochitest/test_PaymentsStore.html
rename from toolkit/components/payments/test/mochitest/test_address_form.html
rename to browser/components/payments/test/mochitest/test_address_form.html
rename from toolkit/components/payments/test/mochitest/test_address_picker.html
rename to browser/components/payments/test/mochitest/test_address_picker.html
rename from toolkit/components/payments/test/mochitest/test_basic_card_form.html
rename to browser/components/payments/test/mochitest/test_basic_card_form.html
rename from toolkit/components/payments/test/mochitest/test_currency_amount.html
rename to browser/components/payments/test/mochitest/test_currency_amount.html
rename from toolkit/components/payments/test/mochitest/test_labelled_checkbox.html
rename to browser/components/payments/test/mochitest/test_labelled_checkbox.html
rename from toolkit/components/payments/test/mochitest/test_order_details.html
rename to browser/components/payments/test/mochitest/test_order_details.html
rename from toolkit/components/payments/test/mochitest/test_payer_address_picker.html
rename to browser/components/payments/test/mochitest/test_payer_address_picker.html
rename from toolkit/components/payments/test/mochitest/test_payment_details_item.html
rename to browser/components/payments/test/mochitest/test_payment_details_item.html
rename from toolkit/components/payments/test/mochitest/test_payment_dialog.html
rename to browser/components/payments/test/mochitest/test_payment_dialog.html
rename from toolkit/components/payments/test/mochitest/test_payment_method_picker.html
rename to browser/components/payments/test/mochitest/test_payment_method_picker.html
rename from toolkit/components/payments/test/mochitest/test_rich_select.html
rename to browser/components/payments/test/mochitest/test_rich_select.html
rename from toolkit/components/payments/test/mochitest/test_shipping_option_picker.html
rename to browser/components/payments/test/mochitest/test_shipping_option_picker.html
rename from toolkit/components/payments/test/unit/.eslintrc.js
rename to browser/components/payments/test/unit/.eslintrc.js
rename from toolkit/components/payments/test/unit/head.js
rename to browser/components/payments/test/unit/head.js
rename from toolkit/components/payments/test/unit/test_response_creation.js
rename to browser/components/payments/test/unit/test_response_creation.js
rename from toolkit/components/payments/test/unit/xpcshell.ini
rename to browser/components/payments/test/unit/xpcshell.ini
--- a/toolkit/components/payments/test/unit/xpcshell.ini
+++ b/browser/components/payments/test/unit/xpcshell.ini
@@ -1,4 +1,5 @@
 [DEFAULT]
+firefox-appdir = browser
 head = head.js
 
 [test_response_creation.js]
--- a/browser/installer/allowed-dupes.mn
+++ b/browser/installer/allowed-dupes.mn
@@ -140,13 +140,13 @@ res/table-remove-row-hover.gif
 res/table-remove-row.gif
 res/multilocale.txt
 update.locale
 # Aurora branding
 browser/chrome/browser/content/branding/icon128.png
 browser/chrome/devtools/content/framework/dev-edition-promo/dev-edition-logo.png
 # Bug 1451016 - Nightly-only PaymentRequest & Form Autofill code sharing.
 browser/features/formautofill@mozilla.org/chrome/content/editAddress.xhtml
-chrome/toolkit/res/payments/formautofill/editAddress.xhtml
+browser/chrome/browser/res/payments/formautofill/editAddress.xhtml
 browser/features/formautofill@mozilla.org/chrome/content/editCreditCard.xhtml
-chrome/toolkit/res/payments/formautofill/editCreditCard.xhtml
+browser/chrome/browser/res/payments/formautofill/editCreditCard.xhtml
 browser/features/formautofill@mozilla.org/chrome/content/autofillEditForms.js
-chrome/toolkit/res/payments/formautofill/autofillEditForms.js
+browser/chrome/browser/res/payments/formautofill/autofillEditForms.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -201,18 +201,18 @@
 @RESPATH@/components/PageThumbsComponents.manifest
 @RESPATH@/components/crashmonitor.manifest
 @RESPATH@/components/nsCrashMonitor.js
 @RESPATH@/components/toolkitsearch.manifest
 @RESPATH@/components/nsSearchService.js
 @RESPATH@/components/nsSearchSuggestions.js
 @RESPATH@/components/nsSidebar.js
 #ifdef NIGHTLY_BUILD
-@RESPATH@/components/payments.manifest
-@RESPATH@/components/paymentUIService.js
+@RESPATH@/browser/components/payments.manifest
+@RESPATH@/browser/components/paymentUIService.js
 #endif
 @RESPATH@/components/passwordmgr.manifest
 @RESPATH@/components/nsLoginInfo.js
 @RESPATH@/components/nsLoginManager.js
 @RESPATH@/components/nsLoginManagerPrompter.js
 @RESPATH@/components/storage-json.js
 @RESPATH@/components/crypto-SDR.js
 @RESPATH@/components/TooltipTextProvider.js
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -104,13 +104,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
     DIRS += ['gfx']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     EXTRA_COMPONENTS += [
         'nsDefaultCLH.js',
         'nsDefaultCLH.manifest',
     ]
 
-if CONFIG['NIGHTLY_BUILD'] and CONFIG['MOZ_BUILD_APP'] == 'browser':
-    DIRS += ['payments']
-
 if CONFIG['MOZ_BUILD_APP'] == 'browser':
     DIRS += ['normandy']
--- a/toolkit/content/license.html
+++ b/toolkit/content/license.html
@@ -1,9 +1,9 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this file,
    - You can obtain one at http://mozilla.org/MPL/2.0/.  -->
 
 <html lang="en">
   <head>
     <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src chrome:; img-src chrome:" />
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
@@ -5304,17 +5304,17 @@ SOFTWARE.
 </pre>
 
 
     <hr>
 
     <h1><a id="polymer"></a>Polymer License</h1>
 
     <p>This license applies to the file
-    <code>toolkit/components/payments/res/vendor/custom-elements.min.js</code>.</p>
+    <code>browser/components/payments/res/vendor/custom-elements.min.js</code>.</p>
 
 <pre>
 Copyright (c) 2014 The Polymer Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met: