diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index c1e23a41be32..dd9094937973 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1716,6 +1716,8 @@ pref("extensions.formautofill.firstTimeUse", true); pref("extensions.formautofill.heuristics.enabled", true); pref("extensions.formautofill.section.enabled", true); pref("extensions.formautofill.loglevel", "Warn"); +// Comma separated list of countries Form Autofill supports +pref("extensions.formautofill.supportedCountries", "US"); // Whether or not to restore a session with lazy-browser tabs. pref("browser.sessionstore.restore_tabs_lazily", true); diff --git a/browser/extensions/formautofill/FormAutofillUtils.jsm b/browser/extensions/formautofill/FormAutofillUtils.jsm index 73ea961b566c..aa395e606ccc 100644 --- a/browser/extensions/formautofill/FormAutofillUtils.jsm +++ b/browser/extensions/formautofill/FormAutofillUtils.jsm @@ -12,9 +12,6 @@ const ADDRESS_METADATA_PATH = "resource://formautofill/addressmetadata/"; const ADDRESS_REFERENCES = "addressReferences.js"; const ADDRESS_REFERENCES_EXT = "addressReferencesExt.js"; -// TODO: This list should become a pref in Bug 1413494 -const SUPPORTED_COUNTRY_LIST = ["US"]; - const ADDRESSES_COLLECTION_NAME = "addresses"; const CREDITCARDS_COLLECTION_NAME = "creditCards"; const ADDRESSES_FIRST_TIME_USE_PREF = "extensions.formautofill.firstTimeUse"; @@ -22,6 +19,7 @@ const ENABLED_AUTOFILL_ADDRESSES_PREF = "extensions.formautofill.addresses.enabl const CREDITCARDS_USED_STATUS_PREF = "extensions.formautofill.creditCards.used"; const AUTOFILL_CREDITCARDS_AVAILABLE_PREF = "extensions.formautofill.creditCards.available"; const ENABLED_AUTOFILL_CREDITCARDS_PREF = "extensions.formautofill.creditCards.enabled"; +const SUPPORTED_COUNTRIES_PREF = "extensions.formautofill.supportedCountries"; const MANAGE_ADDRESSES_KEYWORDS = ["manageAddressesTitle", "addNewAddressTitle"]; const EDIT_ADDRESS_KEYWORDS = [ "givenName", "additionalName", "familyName", "organization2", "streetAddress", @@ -378,7 +376,7 @@ this.FormAutofillUtils = { * @returns {string} The matching country code. */ identifyCountryCode(countryName, countrySpecified) { - let countries = countrySpecified ? [countrySpecified] : SUPPORTED_COUNTRY_LIST; + let countries = countrySpecified ? [countrySpecified] : this.supportedCountries; for (let country of countries) { let collators = this.getCollators(country); @@ -696,3 +694,6 @@ XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils, "isAutofillAddressesFirstTimeUse", ADDRESSES_FIRST_TIME_USE_PREF); XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils, "AutofillCreditCardsUsedStatus", CREDITCARDS_USED_STATUS_PREF); +XPCOMUtils.defineLazyPreferenceGetter(this.FormAutofillUtils, + "supportedCountries", SUPPORTED_COUNTRIES_PREF, null, null, + val => val.split(",")); diff --git a/browser/extensions/formautofill/ProfileStorage.jsm b/browser/extensions/formautofill/ProfileStorage.jsm index fa93ca32b0ae..d2c65e1955d1 100644 --- a/browser/extensions/formautofill/ProfileStorage.jsm +++ b/browser/extensions/formautofill/ProfileStorage.jsm @@ -1216,9 +1216,7 @@ class Addresses extends AutofillRecords { } _recordReadProcessor(address) { - // TODO: We only support US in MVP so hide the field if it's not. We - // are going to support more countries in bug 1370193. - if (address.country && address.country != "US") { + if (address.country && !FormAutofillUtils.supportedCountries.includes(address.country)) { delete address.country; delete address["country-name"]; } diff --git a/browser/extensions/formautofill/bootstrap.js b/browser/extensions/formautofill/bootstrap.js index a4490ce99c07..3a21191a5b0b 100644 --- a/browser/extensions/formautofill/bootstrap.js +++ b/browser/extensions/formautofill/bootstrap.js @@ -59,7 +59,9 @@ function isAvailable() { } else if (availablePref == "detect") { let locale = Services.locale.getRequestedLocale(); let region = Services.prefs.getCharPref("browser.search.region", ""); - return locale == "en-US" && region == "US"; + let supportedCountries = Services.prefs.getCharPref("extensions.formautofill.supportedCountries") + .split(","); + return locale == "en-US" && supportedCountries.includes(region); } return false; } diff --git a/browser/extensions/formautofill/content/editAddress.xhtml b/browser/extensions/formautofill/content/editAddress.xhtml index 64be8f9ab13b..df8364d75561 100644 --- a/browser/extensions/formautofill/content/editAddress.xhtml +++ b/browser/extensions/formautofill/content/editAddress.xhtml @@ -49,10 +49,9 @@ -

+

with $attributes data attributes +let div = "= 1; i--) { + tree += new Array(i).join(" "); + tree += "
\n"; +} + +// Build the list of $n elements +let repeat = ""; +for (i = 1; i <= n; i++) { + repeat += div + " " + i + " \n"; +} + +console.log(` + + + + + + + Custom page for the Inspector + + + + + +`); +console.log(tree); +console.log(` + +`); +console.log(repeat); +console.log(` + +`); + diff --git a/testing/talos/talos/tests/devtools/addon/content/pages/custom/inspector.html b/testing/talos/talos/tests/devtools/addon/content/pages/custom/inspector.html new file mode 100644 index 000000000000..dbb2691523b9 --- /dev/null +++ b/testing/talos/talos/tests/devtools/addon/content/pages/custom/inspector.html @@ -0,0 +1,179 @@ + + + + + + + + Custom page for the Inspector + + + + + + +
1 +
2 +
3 +
4 +
5 +
6 +
7 +
8 +
9 +
10 +
11 +
12 +
13 +
14 +
15 +
16 +
17 +
18 +
19 +
20 +
21 +
22 +
23 +
24 +
25 +
26 +
27 +
28 +
29 +
30 +
31 +
32 +
33 +
34 +
35 +
36 +
37 +
38 +
39 +
40 +
41 +
42 +
43 +
44 +
45 +
46 +
47 +
48 +
49 +
50 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+ + + + diff --git a/testing/web-platform/meta/custom-elements/reactions/DOMStringMap.html.ini b/testing/web-platform/meta/custom-elements/reactions/DOMStringMap.html.ini deleted file mode 100644 index da011eb26427..000000000000 --- a/testing/web-platform/meta/custom-elements/reactions/DOMStringMap.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[DOMStringMap.html] - type: testharness - [setter on DOMStringMap must enqueue an attributeChanged reaction when mutating the value of an observed data attribute to the same value] - expected: FAIL - diff --git a/testing/web-platform/meta/custom-elements/reactions/DOMTokenList.html.ini b/testing/web-platform/meta/custom-elements/reactions/DOMTokenList.html.ini deleted file mode 100644 index 15f3730f67e8..000000000000 --- a/testing/web-platform/meta/custom-elements/reactions/DOMTokenList.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[DOMTokenList.html] - type: testharness - [remove on DOMTokenList must not enqueue an attributeChanged reaction when removing a non-existent value from an attribute] - expected: FAIL - - [the stringifier of DOMTokenList must enqueue an attributeChanged reaction when the setter is called with the original value of the attribute] - expected: FAIL - - [remove on DOMTokenList must enqueue an attributeChanged reaction even when removing a non-existent value from an attribute] - expected: FAIL - diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py index b33bc428ecb4..cc04d767f8b3 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/base.py @@ -357,12 +357,10 @@ class WdspecExecutor(TestExecutor): return (test.result_cls(*data), []) def do_wdspec(self, session_config, path, timeout): - harness_result = ("OK", None) - subtest_results = pytestrunner.run(path, - self.server_config, - session_config, - timeout=timeout) - return (harness_result, subtest_results) + return pytestrunner.run(path, + self.server_config, + session_config, + timeout=timeout) def do_delayed_imports(self): global pytestrunner diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py index 611a4989c393..a2b603dd0443 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py @@ -1,4 +1,5 @@ -"""Provides interface to deal with pytest. +""" +Provides interface to deal with pytest. Usage:: @@ -24,7 +25,8 @@ def do_delayed_imports(): def run(path, server_config, session_config, timeout=0): - """Run Python test at ``path`` in pytest. The provided ``session`` + """ + Run Python test at ``path`` in pytest. The provided ``session`` is exposed as a fixture available in the scope of the test functions. :param path: Path to the test file. @@ -33,36 +35,51 @@ def run(path, server_config, session_config, timeout=0): :param timeout: Duration before interrupting potentially hanging tests. If 0, there is no timeout. - :returns: List of subtest results, which are tuples of (test id, - status, message, stacktrace). + :returns: (, [, ...]), + where is (test id, status, message, stacktrace). """ - if pytest is None: do_delayed_imports() - recorder = SubtestResultRecorder() - os.environ["WD_HOST"] = session_config["host"] os.environ["WD_PORT"] = str(session_config["port"]) os.environ["WD_CAPABILITIES"] = json.dumps(session_config["capabilities"]) os.environ["WD_SERVER_CONFIG"] = json.dumps(server_config) - plugins = [recorder] - - # TODO(ato): Deal with timeouts + harness = HarnessResultRecorder() + subtests = SubtestResultRecorder() with TemporaryDirectory() as cache: - pytest.main(["--strict", # turn warnings into errors - "--verbose", # show each individual subtest - "--capture", "no", # enable stdout/stderr from tests - "--basetemp", cache, # temporary directory - "--showlocals", # display contents of variables in local scope - "-p", "no:mozlog", # use the WPT result recorder - "-p", "no:cacheprovider", # disable state preservation across invocations - path], - plugins=plugins) + try: + pytest.main(["--strict", # turn warnings into errors + "--verbose", # show each individual subtest + "--capture", "no", # enable stdout/stderr from tests + "--basetemp", cache, # temporary directory + "--showlocals", # display contents of variables in local scope + "-p", "no:mozlog", # use the WPT result recorder + "-p", "no:cacheprovider", # disable state preservation across invocations + path], + plugins=[harness, subtests]) + except Exception as e: + harness.outcome = ("ERROR", str(e)) - return recorder.results + return (harness.outcome, subtests.results) + + +class HarnessResultRecorder(object): + outcomes = { + "failed": "ERROR", + "passed": "OK", + "skipped": "SKIP", + } + + def __init__(self): + # we are ok unless told otherwise + self.outcome = ("OK", None) + + def pytest_collectreport(self, report): + harness_result = self.outcomes[report.outcome] + self.outcome = (harness_result, None) class SubtestResultRecorder(object): diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index a1d42dd4b3cf..9f68db2d5f4b 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -411,7 +411,7 @@ function _setupDebuggerServer(breakpointFiles, callback) { let { DebuggerServer } = require("devtools/server/main"); let { OriginalLocation } = require("devtools/server/actors/common"); DebuggerServer.init(); - DebuggerServer.addBrowserActors(); + DebuggerServer.registerAllActors(); DebuggerServer.addActors("resource://testing-common/dbg-actors.js"); DebuggerServer.allowChromeProcess = true; diff --git a/toolkit/components/telemetry/docs/collection/histograms.rst b/toolkit/components/telemetry/docs/collection/histograms.rst index a05a62ba54ca..90612e7d321a 100644 --- a/toolkit/components/telemetry/docs/collection/histograms.rst +++ b/toolkit/components/telemetry/docs/collection/histograms.rst @@ -100,7 +100,7 @@ Note that when you need to record for a small set of known keys, using separate Declaring a Histogram ===================== -Histograms should be declared in the `Histograms.json `_ file. These declarations are checked for correctness at `compile time `_ and used to generate C++ code. +Histograms should be declared in the `Histograms.json `_ file. These declarations are checked for correctness at `compile time `_ and used to generate C++ code. The following is a sample histogram declaration from ``Histograms.json`` for a histogram named ``MEMORY_RESIDENT`` which tracks the amount of resident memory used by a process: diff --git a/toolkit/components/telemetry/docs/collection/scalars.rst b/toolkit/components/telemetry/docs/collection/scalars.rst index 93363f5c4256..18fc2fb2609e 100644 --- a/toolkit/components/telemetry/docs/collection/scalars.rst +++ b/toolkit/components/telemetry/docs/collection/scalars.rst @@ -189,14 +189,14 @@ The scalar definition file is processed and checked for correctness at compile t conforms to the specification, the processor scripts generate two C++ headers files, included by the Telemetry C++ core. -gen-scalar-data.py +gen_scalar_data.py ------------------ This script is called by the build system to generate the ``TelemetryScalarData.h`` C++ header file out of the scalar definitions. This header file contains an array holding the scalar names and version strings, in addition to an array of ``ScalarInfo`` structures representing all the scalars. -gen-scalar-enum.py +gen_scalar_enum.py ------------------ This script is called by the build system to generate the ``TelemetryScalarEnums.h`` C++ header file out of the scalar definitions. diff --git a/toolkit/components/telemetry/gen-event-data.py b/toolkit/components/telemetry/gen_event_data.py similarity index 99% rename from toolkit/components/telemetry/gen-event-data.py rename to toolkit/components/telemetry/gen_event_data.py index c8cb46b1e539..c372ccf5b963 100644 --- a/toolkit/components/telemetry/gen-event-data.py +++ b/toolkit/components/telemetry/gen_event_data.py @@ -14,7 +14,7 @@ import itertools # The banner/text at the top of the generated file. banner = """/* This file is auto-generated, only for internal use in TelemetryEvent.h, - see gen-event-data.py. */ + see gen_event_data.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/gen-event-enum.py b/toolkit/components/telemetry/gen_event_enum.py similarity index 97% rename from toolkit/components/telemetry/gen-event-enum.py rename to toolkit/components/telemetry/gen_event_enum.py index 21f0567b90fc..0915cfdf9119 100644 --- a/toolkit/components/telemetry/gen-event-enum.py +++ b/toolkit/components/telemetry/gen_event_enum.py @@ -12,7 +12,7 @@ from shared_telemetry_utils import ParserError import sys import parse_events -banner = """/* This file is auto-generated, see gen-event-enum.py. */ +banner = """/* This file is auto-generated, see gen_event_enum.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/gen-histogram-data.py b/toolkit/components/telemetry/gen_histogram_data.py similarity index 99% rename from toolkit/components/telemetry/gen-histogram-data.py rename to toolkit/components/telemetry/gen_histogram_data.py index 48235b877908..fac3fa4326f0 100644 --- a/toolkit/components/telemetry/gen-histogram-data.py +++ b/toolkit/components/telemetry/gen_histogram_data.py @@ -11,7 +11,7 @@ from shared_telemetry_utils import StringTable, static_assert, ParserError import sys import histogram_tools -banner = """/* This file is auto-generated, see gen-histogram-data.py. */ +banner = """/* This file is auto-generated, see gen_histogram_data.py. */ """ diff --git a/toolkit/components/telemetry/gen-histogram-enum.py b/toolkit/components/telemetry/gen_histogram_enum.py similarity index 98% rename from toolkit/components/telemetry/gen-histogram-enum.py rename to toolkit/components/telemetry/gen_histogram_enum.py index 84ba449545c1..ced93d94df4c 100644 --- a/toolkit/components/telemetry/gen-histogram-enum.py +++ b/toolkit/components/telemetry/gen_histogram_enum.py @@ -20,7 +20,7 @@ import itertools import sys -banner = """/* This file is auto-generated, see gen-histogram-enum.py. */ +banner = """/* This file is auto-generated, see gen_histogram_enum.py. */ """ header = """ diff --git a/toolkit/components/telemetry/gen-process-data.py b/toolkit/components/telemetry/gen_process_data.py similarity index 98% rename from toolkit/components/telemetry/gen-process-data.py rename to toolkit/components/telemetry/gen_process_data.py index dc43c2fdad75..af840612d3f7 100644 --- a/toolkit/components/telemetry/gen-process-data.py +++ b/toolkit/components/telemetry/gen_process_data.py @@ -13,7 +13,7 @@ import collections # The banner/text at the top of the generated file. banner = """/* This file is auto-generated from Telemetry build scripts, - see gen-processes-data.py. */ + see gen_process_data.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/gen-process-enum.py b/toolkit/components/telemetry/gen_process_enum.py similarity index 98% rename from toolkit/components/telemetry/gen-process-enum.py rename to toolkit/components/telemetry/gen_process_enum.py index bda8dc43574f..d771e381c0bf 100644 --- a/toolkit/components/telemetry/gen-process-enum.py +++ b/toolkit/components/telemetry/gen_process_enum.py @@ -13,7 +13,7 @@ import collections # The banner/text at the top of the generated file. banner = """/* This file is auto-generated from Telemetry build scripts, - see gen-processes-enum.py. */ + see gen_process_enum.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/gen-scalar-data.py b/toolkit/components/telemetry/gen_scalar_data.py similarity index 99% rename from toolkit/components/telemetry/gen-scalar-data.py rename to toolkit/components/telemetry/gen_scalar_data.py index 87882c1ee94a..c6cfd182abab 100644 --- a/toolkit/components/telemetry/gen-scalar-data.py +++ b/toolkit/components/telemetry/gen_scalar_data.py @@ -13,7 +13,7 @@ import sys # The banner/text at the top of the generated file. banner = """/* This file is auto-generated, only for internal use in TelemetryScalar.h, - see gen-scalar-data.py. */ + see gen_scalar_data.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/gen-scalar-enum.py b/toolkit/components/telemetry/gen_scalar_enum.py similarity index 96% rename from toolkit/components/telemetry/gen-scalar-enum.py rename to toolkit/components/telemetry/gen_scalar_enum.py index dc49c63c1537..d84895a91595 100644 --- a/toolkit/components/telemetry/gen-scalar-enum.py +++ b/toolkit/components/telemetry/gen_scalar_enum.py @@ -13,7 +13,7 @@ from shared_telemetry_utils import ParserError import sys import parse_scalars -banner = """/* This file is auto-generated, see gen-scalar-enum.py. */ +banner = """/* This file is auto-generated, see gen_scalar_enum.py. */ """ file_header = """\ diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build index 821279a27a6f..1606946d878e 100644 --- a/toolkit/components/telemetry/moz.build +++ b/toolkit/components/telemetry/moz.build @@ -125,11 +125,11 @@ histogram_files = [ ] data = GENERATED_FILES['TelemetryHistogramData.inc'] -data.script = 'gen-histogram-data.py' +data.script = 'gen_histogram_data.py' data.inputs = histogram_files enums = GENERATED_FILES['TelemetryHistogramEnums.h'] -enums.script = 'gen-histogram-enum.py' +enums.script = 'gen_histogram_enum.py' enums.inputs = histogram_files # Generate scalar files. @@ -138,11 +138,11 @@ scalar_files = [ ] scalar_data = GENERATED_FILES['TelemetryScalarData.h'] -scalar_data.script = 'gen-scalar-data.py' +scalar_data.script = 'gen_scalar_data.py' scalar_data.inputs = scalar_files scalar_enums = GENERATED_FILES['TelemetryScalarEnums.h'] -scalar_enums.script = 'gen-scalar-enum.py' +scalar_enums.script = 'gen_scalar_enum.py' scalar_enums.inputs = scalar_files # Generate event files. @@ -151,11 +151,11 @@ event_files = [ ] event_data = GENERATED_FILES['TelemetryEventData.h'] -event_data.script = 'gen-event-data.py' +event_data.script = 'gen_event_data.py' event_data.inputs = event_files event_enums = GENERATED_FILES['TelemetryEventEnums.h'] -event_enums.script = 'gen-event-enum.py' +event_enums.script = 'gen_event_enum.py' event_enums.inputs = event_files # Generate data from Processes.yaml @@ -164,11 +164,11 @@ processes_files = [ ] processes_enum = GENERATED_FILES['TelemetryProcessEnums.h'] -processes_enum.script = 'gen-process-enum.py' +processes_enum.script = 'gen_process_enum.py' processes_enum.inputs = processes_files processes_data = GENERATED_FILES['TelemetryProcessData.h'] -processes_data.script = 'gen-process-data.py' +processes_data.script = 'gen_process_data.py' processes_data.inputs = processes_files with Files('**'): diff --git a/toolkit/components/viewconfig/content/config.xul b/toolkit/components/viewconfig/content/config.xul index 25ce39da5f54..3878462e1c33 100644 --- a/toolkit/components/viewconfig/content/config.xul +++ b/toolkit/components/viewconfig/content/config.xul @@ -4,6 +4,7 @@ - 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/. --> + diff --git a/toolkit/library/gtest/rust/Cargo.lock b/toolkit/library/gtest/rust/Cargo.lock index a2b99a9af335..eb5875e204e8 100644 --- a/toolkit/library/gtest/rust/Cargo.lock +++ b/toolkit/library/gtest/rust/Cargo.lock @@ -1549,7 +1549,6 @@ dependencies = [ "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "webrender 0.54.0", - "webrender_api 0.54.0", ] [[package]] diff --git a/toolkit/library/rust/Cargo.lock b/toolkit/library/rust/Cargo.lock index 3d8f987ab4ae..40149490ca5e 100644 --- a/toolkit/library/rust/Cargo.lock +++ b/toolkit/library/rust/Cargo.lock @@ -1561,7 +1561,6 @@ dependencies = [ "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "webrender 0.54.0", - "webrender_api 0.54.0", ] [[package]]