commit 4f27637b168c1fb8b5acb097535891359e13f93d parent 285d66fff370e61c3cfac751e85b65871665553b Author: Ted Campbell <tcampbell@mozilla.com> Date: Wed, 26 Nov 2025 02:38:21 +0000 Bug 1870810 - Update mochitest.ini references to .toml in docs r=jmaher,devtools-reviewers,dom-storage-reviewers,omc-reviewers,urlbar-reviewers,dom-worker-reviewers,whimboo,home-newtab-reviewers,nchevobbe,edenchuang,mconley,jari,emcminn DONTBUILD We previously migrated mochitest.ini (and friends) to be toml files but some stray comments and documentation were not addressed at the time. Fix that now. Differential Revision: https://phabricator.services.mozilla.com/D271518 Diffstat:
48 files changed, 78 insertions(+), 77 deletions(-)
diff --git a/browser/components/StartupRecorder.sys.mjs b/browser/components/StartupRecorder.sys.mjs @@ -235,7 +235,7 @@ StartupRecorder.prototype = { this.data.profile = profileData; // There's no equivalent StartProfiler call in this file because the // profiler is started using the MOZ_PROFILER_STARTUP environment - // variable in browser/base/content/test/performance/browser.ini + // variable in browser/base/content/test/performance/browser.toml Services.profiler.StopProfiler(); this._resolve(); diff --git a/browser/components/newtab/test/browser/abouthomecache/head.js b/browser/components/newtab/test/browser/abouthomecache/head.js @@ -28,7 +28,7 @@ const { PREFS_CONFIG } = ChromeUtils.importESModule( */ async function withFullyLoadedAboutHome(taskFn) { // Some Activity Stream preferences are JSON encoded, and quite complex. - // Hard-coding them here or in browser.ini makes them brittle to change. + // Hard-coding them here or in browser.toml makes them brittle to change. // Instead, we pull the default prefs structures and set the values that // we need and write them to preferences here dynamically. let defaultDSConfig = JSON.parse( diff --git a/browser/components/storybook/docs/README.reusable-widgets.stories.md b/browser/components/storybook/docs/README.reusable-widgets.stories.md @@ -94,7 +94,7 @@ The scaffold command will generate the following files: ``` It will also make modifications to `toolkit/content/jar.mn` to add `chrome://` -URLs for the new files, and to `toolkit/content/tests/widgets/chrome.ini` to +URLs for the new files, and to `toolkit/content/tests/widgets/chrome.toml` to enable running the newly added test. After running the scaffold command you can start Storybook and you will see diff --git a/browser/components/urlbar/docs/testing.rst b/browser/components/urlbar/docs/testing.rst @@ -105,11 +105,10 @@ manifest in alphabetical order. Start in the manifest file and add your test name in alphabetical order. The manifest file we should add our test in is -`browser.ini <https://searchfox.org/mozilla-central/source/browser/components/ -urlbar/tests/browser/browser.ini>`_. The ``urlbar/test/browser/`` directory +`browser.toml <https://searchfox.org/mozilla-central/source/browser/components/ +urlbar/tests/browser/browser.toml>`_. The ``urlbar/test/browser/`` directory is the main browser test directory for address bar, and the manifest file linked above is the main browser test manifest. -The ``.ini`` file extension is an initialization file for Windows or MS-DOS. Manifest Metadata ~~~~~~~~~~~~~~~~~ diff --git a/browser/extensions/newtab/docs/v2-system-addon/mochitests.md b/browser/extensions/newtab/docs/v2-system-addon/mochitests.md @@ -6,7 +6,7 @@ Mochitests live in `test/browser`, and as of this writing, they are all the `bro ## Adding New Tests -If you add new tests, make sure to list them in the `browser.ini` file. You will see the other tests there. Add a new entry with the same format as the others. You can also add new JS or HTML files by listing in under `support-files`. Make sure to start your test name with "browser_", so that the test suite knows the pick it up. E.g: "browser_as_my_new_test.js". +If you add new tests, make sure to list them in the `browser.toml` file. You will see the other tests there. Add a new entry with the same format as the others. You can also add new JS or HTML files by listing in under `support-files`. Make sure to start your test name with "browser_", so that the test suite knows the pick it up. E.g: "browser_as_my_new_test.js". ## Writing Tests diff --git a/devtools/client/memory/test/xpcshell/head.js b/devtools/client/memory/test/xpcshell/head.js @@ -3,7 +3,7 @@ "use strict"; -// via xpcshell.ini +// via xpcshell.toml /* import-globals-from ../../../shared/test/shared-head.js */ Services.prefs.setBoolPref("devtools.testing", true); diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js @@ -166,7 +166,7 @@ const { sinon } = ChromeUtils.importESModule( "resource://testing-common/Sinon.sys.mjs" ); -// When loaded from xpcshell test, this file is loaded via xpcshell.ini's head property +// When loaded from xpcshell test, this file is loaded via xpcshell.toml's head property // and so it loaded first before anything else and isn't having access to Services global. // Whereas many head.js files from mochitest import this file via loadSubScript // and already expose Services as a global. @@ -256,7 +256,7 @@ try { ok( false, "MISSING DEPENDENCY ON telemetry-test-helpers.js\n" + - "Please add the following line in browser.ini:\n" + + "Please add the following line in browser.toml:\n" + " !/devtools/client/shared/test/telemetry-test-helpers.js\n" ); throw e; diff --git a/devtools/docs/contributor/tests/writing-tests.md b/devtools/docs/contributor/tests/writing-tests.md @@ -61,13 +61,13 @@ async function checkSomethingElse(view) { ### Referencing the new file -For your test to be run, it needs to be referenced in the `browser.ini` file that you'll find in the same directory. For example: `browser/devtools/debugger/test/browser.ini` +For your test to be run, it needs to be referenced in the `browser.toml` file that you'll find in the same directory. For example: `browser/devtools/debugger/test/browser.toml` Add a line with your file name between square brackets, and make sure that the list of files **is always sorted by alphabetical order** (some lists can be really long, so the alphabetical order helps in finding and reasoning about things). -For example, if you were to add the test from the previous section, you'd add this to `browser.ini`: +For example, if you were to add the test from the previous section, you'd add this to `browser.toml`: -```ini +```toml [browser_ruleview_completion-existing-property_01.js] ``` @@ -76,13 +76,13 @@ For example, if you were to add the test from the previous section, you'd add th Sometimes your test may need to open an HTML file in a tab, and it may also need to load CSS or JavaScript. For this to work, you'll need to... 1. place these files in the same directory, and also -2. reference them in the `browser.ini` file. +2. reference them in the `browser.toml` file. There's a naming convention for support files: `doc_<support-some-test>.html` But again, often names do not follow this convention, so try to follow the style of the other support files currently in the same test directory. -To reference your new support file, add its filename in the `support-files` section of `browser.ini`, also making sure this section is in alphabetical order. +To reference your new support file, add its filename in the `support-files` section of `browser.toml`, also making sure this section is in alphabetical order. Support files can be accessed via a local server that is started while tests are running. This server is accessible at [http://example.com/browser/](http://example.com/browser/). See the `head.js section` below for more information. @@ -228,7 +228,7 @@ In some cases, you may want to extract some common code from your test to use it * If this is common code specific to a given tool, then add it to the corresponding `head.js` file. * If it isn't common enough to live in `head.js`, then it may be a good idea to create a helper file to avoid duplication anyway. Here's how to create a helper file: * Create a new file in your test director. The naming convention should be `helper_<description_of_the_helper>.js` - * Add it to the browser.ini support-files section, making sure it is sorted alphabetically + * Add it to the `browser.toml` `support-files` section, making sure it is sorted alphabetically * Load the helper file in the tests * `browser/devtools/markupview/test/head.js` has a handy `loadHelperScript(fileName)` function that you can use. * The file will be loaded in the test global scope, so any global function or variables it defines will be available (just like `head.js`). diff --git a/dom/animation/test/chrome.toml b/dom/animation/test/chrome.toml @@ -10,7 +10,7 @@ support-files = [ ] ["chrome/test_animate_xrays.html"] -# file_animate_xrays.html needs to go in mochitest.ini since it is served +# file_animate_xrays.html needs to go in mochitest.toml since it is served # over HTTP ["chrome/test_animation_observers_async.html"] diff --git a/dom/animation/test/mochitest.toml b/dom/animation/test/mochitest.toml @@ -5,7 +5,7 @@ prefs = [ "gfx.font_loader.delay=0", ] # Support files for chrome tests that we want to load over HTTP need -# to go in here, not chrome.ini. +# to go in here, not chrome.toml. support-files = [ "chrome/file_animate_xrays.html", "mozilla/xhr_doc.html", diff --git a/dom/cache/test/xpcshell/test_bug1425146.js b/dom/cache/test/xpcshell/test_bug1425146.js @@ -27,7 +27,7 @@ add_task(async function testSteps() { // - create_cache.js // - storage.sqlite // The file create_cache.js in the package was run locally, specifically it - // was temporarily added to xpcshell.ini and then executed: + // was temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/cache/test/xpcshell/create_cache.js // Note: it must be executed in FF56 and it only creates the directory // "storage/default/chrome/cache" and the file "storage.sqlite". To make it diff --git a/dom/indexedDB/test/unit/test_orphaned_files.js b/dom/indexedDB/test/unit/test_orphaned_files.js @@ -32,7 +32,7 @@ async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/indexedDB/test/unit/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/localstorage/test/unit/test_corruptedDatabase.js b/dom/localstorage/test/unit/test_corruptedDatabase.js @@ -55,7 +55,7 @@ add_task(async function testSteps() { // - storage.sqlite // - webappsstore.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/localstorage/test/unit/test_groupMismatch.js b/dom/localstorage/test/unit/test_groupMismatch.js @@ -25,7 +25,7 @@ add_task(async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/localstorage/test/unit/test_migration.js b/dom/localstorage/test/unit/test_migration.js @@ -66,7 +66,7 @@ add_task(async function testSteps() { // The profile contains storage.sqlite and webappsstore.sqlite. The file // create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js installPackage("migration_profile"); diff --git a/dom/localstorage/test/unit/test_migration_emptyValue.js b/dom/localstorage/test/unit/test_migration_emptyValue.js @@ -19,7 +19,7 @@ add_task(async function testSteps() { // The profile contains storage.sqlite and webappsstore.sqlite. // The archive migration_emptyValue_profile.zip was created by running // make_migration_emptyValue.js locally, specifically the special test was - // temporarily activated in xpcshell.ini and then it was run as: + // temporarily activated in xpcshell.toml and then it was run as: // mach test --interactive dom/localstorage/test/unit/make_migration_emptyValue.js // Before packaging, additional manual steps are needed: // 1. Folder "cache2" is removed. diff --git a/dom/localstorage/test/unit/test_schema3upgrade.js b/dom/localstorage/test/unit/test_schema3upgrade.js @@ -27,7 +27,7 @@ add_task(async function testSteps() { // - webappsstore.sqlite // The file create_db.js in the package was run locally (with a build with // local storage archive version 1 and database schema version 2), - // specifically it was temporarily added to xpcshell.ini and then executed: + // specifically it was temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/localstorage/test/unit/test_schema4upgrade.js b/dom/localstorage/test/unit/test_schema4upgrade.js @@ -27,7 +27,7 @@ add_task(async function testSteps() { // - webappsstore.sqlite // // The file test_create_db.js in the package was run locally by - // adding it temporarily to xpcshell.ini and then executed with + // adding it temporarily to xpcshell.toml and then executed with // mach xpcshell-test --headless dom/localstorage/test/unit/test_create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/localstorage/test/unit/test_usageAfterMigration.js b/dom/localstorage/test/unit/test_usageAfterMigration.js @@ -33,7 +33,7 @@ add_task(async function testSteps() { // The profile contains storage.sqlite and webappsstore.sqlite. The file // create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js installPackage("usageAfterMigration_profile"); diff --git a/dom/quota/test/xpcshell/caching/test_groupMismatch.js b/dom/quota/test/xpcshell/caching/test_groupMismatch.js @@ -25,7 +25,7 @@ async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/caching/test_removedOrigin.js b/dom/quota/test/xpcshell/caching/test_removedOrigin.js @@ -33,7 +33,7 @@ async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/caching/test_unsetLastAccessTime.js b/dom/quota/test/xpcshell/caching/test_unsetLastAccessTime.js @@ -24,7 +24,7 @@ async function testSteps() { // - storage/default/https+++foo.example.com // - storage.sqlite // The file make_unsetLastAccessTime.js was run locally, specifically it was - // temporarily enabled in xpcshell.ini and then executed: + // temporarily enabled in xpcshell.toml and then executed: // mach test --interactive dom/quota/test/xpcshell/caching/make_unsetLastAccessTime.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/test_basics.js b/dom/quota/test/xpcshell/test_basics.js @@ -64,7 +64,7 @@ function* testSteps() { // The profile contains just one empty IndexedDB database. The file // create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_db.js installPackage("basics_profile"); diff --git a/dom/quota/test/xpcshell/test_getCachedUsageForPrincipal.js b/dom/quota/test/xpcshell/test_getCachedUsageForPrincipal.js @@ -38,7 +38,7 @@ async function testSteps() { // The profile contains IndexedDB databases placed across the repositories. // The file make_getUsageForPrincipal.js was run locally, specifically it was - // temporarily enabled in xpcshell.ini and then executed: + // temporarily enabled in xpcshell.toml and then executed: // mach test --interactive dom/quota/test/xpcshell/make_getCachedUsageForPrincipal.js installPackage("getCachedUsageForPrincipal_profile"); diff --git a/dom/quota/test/xpcshell/test_getUsage.js b/dom/quota/test/xpcshell/test_getUsage.js @@ -109,7 +109,7 @@ async function testSteps() { // The profile contains IndexedDB databases placed across the repositories. // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_db.js installPackage("getUsage_profile"); diff --git a/dom/quota/test/xpcshell/test_getUsageForPrincipal.js b/dom/quota/test/xpcshell/test_getUsageForPrincipal.js @@ -64,7 +64,7 @@ async function testSteps() { // The profile contains IndexedDB databases placed across the repositories. // The file make_getUsageForPrincipal.js was run locally, specifically it was - // temporarily enabled in xpcshell.ini and then executed: + // temporarily enabled in xpcshell.toml and then executed: // mach test --interactive dom/quota/test/xpcshell/make_getUsageForPrincipal.js installPackage("getUsageForPrincipal_profile"); diff --git a/dom/quota/test/xpcshell/test_groupMismatch.js b/dom/quota/test/xpcshell/test_groupMismatch.js @@ -40,7 +40,7 @@ async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/test_unknownFiles.js b/dom/quota/test/xpcshell/test_unknownFiles.js @@ -42,7 +42,7 @@ async function testSteps() { // The profile contains unknown files and unknown directories placed // across the repositories, origin directories and client directories. // The file make_unknownFiles.js was run locally, specifically it was - // temporarily enabled in xpcshell.ini and then executed: + // temporarily enabled in xpcshell.toml and then executed: // mach test --interactive dom/quota/test/xpcshell/make_unknownFiles.js installPackage("unknownFiles_profile"); diff --git a/dom/quota/test/xpcshell/test_unsetLastAccessTime.js b/dom/quota/test/xpcshell/test_unsetLastAccessTime.js @@ -40,7 +40,7 @@ async function testSteps() { // - storage/default/https+++foo.example.com // - storage.sqlite // The file make_unsetLastAccessTime.js was run locally, specifically it was - // temporarily enabled in xpcshell.ini and then executed: + // temporarily enabled in xpcshell.toml and then executed: // mach test --interactive dom/quota/test/xpcshell/make_unsetLastAccessTime.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/upgrades/test_localStorageArchive1upgrade.js b/dom/quota/test/xpcshell/upgrades/test_localStorageArchive1upgrade.js @@ -35,7 +35,7 @@ async function testSteps() { // - webappsstore.sqlite // The file create_db.js in the package was run locally (with a build that // doesn't support local storage archive upgrades), specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/upgrades/test_localStorageArchive4upgrade.js b/dom/quota/test/xpcshell/upgrades/test_localStorageArchive4upgrade.js @@ -63,7 +63,7 @@ async function testSteps() { // - webappsstore.sqlite // The file create_db.js in the package was run locally (with a build with // local storage archive version 3), specifically it was temporarily added to - // xpcshell.ini and then executed: + // xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/localstorage/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps // are needed. diff --git a/dom/quota/test/xpcshell/upgrades/test_localStorageArchiveDowngrade.js b/dom/quota/test/xpcshell/upgrades/test_localStorageArchiveDowngrade.js @@ -35,7 +35,7 @@ async function testSteps() { // - webappsstore.sqlite // The file create_db.js in the package was run locally (with a build that // supports local storage archive upgrades and local storage archive version - // set to max integer), specifically it was temporarily added to xpcshell.ini + // set to max integer), specifically it was temporarily added to xpcshell.toml // and then executed: // mach xpcshell-test --interactive dom/localstorage/test/xpcshell/create_db.js // Note: to make it become the profile in the test, additional manual steps diff --git a/dom/quota/test/xpcshell/upgrades/test_upgradeCacheFrom1.js b/dom/quota/test/xpcshell/upgrades/test_upgradeCacheFrom1.js @@ -17,7 +17,7 @@ async function testSteps() { // - create_db.js // - storage.sqlite // The file create_db.js in the package was run locally, specifically it was - // temporarily added to xpcshell.ini and then executed: + // temporarily added to xpcshell.toml and then executed: // mach xpcshell-test dom/quota/test/xpcshell/upgrades/create_db.js // --interactive // Note: to make it become the profile in the test, additional manual steps diff --git a/dom/quota/test/xpcshell/upgrades/test_upgradeStorageFrom2_0.js b/dom/quota/test/xpcshell/upgrades/test_upgradeStorageFrom2_0.js @@ -20,7 +20,7 @@ function* testSteps() { // - storage/default/chrome/cache, // - storage/default/http+++www.mozilla.org/cache // The file create_cache.js in the package was run locally, specifically it - // was temporarily added to xpcshell.ini and then executed: + // was temporarily added to xpcshell.toml and then executed: // mach xpcshell-test --interactive dom/quota/test/xpcshell/create_cache.js // Note: it only creates the directory "storage/default/chrome/cache". // To make it become the profile in the test, two more manual steps are diff --git a/dom/streams/moz.build b/dom/streams/moz.build @@ -66,7 +66,7 @@ LOCAL_INCLUDES += [ "/dom/ipc", ] -# MOCHITEST_MANIFESTS += ["tests/mochitest.ini"] -# ROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"] +# MOCHITEST_MANIFESTS += ["tests/mochitest.toml"] +# ROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"] XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.toml"] diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -573,7 +573,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) { "Subtest URL " + subtestUrl + " does not resolve. " + - "Be sure it's present in the support-files section of mochitest.ini." + "Be sure it's present in the support-files section of mochitest.toml." ); reject(); return undefined; diff --git a/ipc/glue/test/browser/browser.toml b/ipc/glue/test/browser/browser.toml @@ -59,6 +59,6 @@ support-files = [ skip-if = [ "!gecko_profiler", "tsan", -] # from tools/profiler/tests/browser/browser.ini, timing out on profiler tests? +] # from tools/profiler/tests/browser/browser.toml, timing out on profiler tests? ["browser_utility_start_clean_shutdown.js"] diff --git a/remote/doc/marionette/PythonTests.md b/remote/doc/marionette/PythonTests.md @@ -76,7 +76,7 @@ which includes a reference to the test files and expectations for results. Such a manifest file can look like the following and is stored with the extension `.toml`: -```ini +```toml [DEFAULT] ["test_expected_fail.py"] diff --git a/remote/marionette/test/xpcshell/README b/remote/marionette/test/xpcshell/README @@ -11,6 +11,6 @@ The latter gives you the --sequential option which can be useful when debugging to prevent tests from running in parallel. When adding new tests you must make sure they are listed in -xpcshell.ini, otherwise they will not run on try. +xpcshell.toml, otherwise they will not run on try. See also ../../doc/Testing.md for more advice on our other types of tests. diff --git a/testing/docs/chrome-tests/index.rst b/testing/docs/chrome-tests/index.rst @@ -37,7 +37,7 @@ For example, to run all chrome tests under `toolkit/content`, run the following :: - ./mach test toolkit/content/test/chrome/chrome.ini + ./mach test toolkit/content/test/chrome/chrome.toml To run a single test, just pass the path to the test into mach: diff --git a/testing/docs/mochitest-plain/faq.md b/testing/docs/mochitest-plain/faq.md @@ -50,10 +50,11 @@ await SpecialPowers.popPrefEnv(); // Implicit at the end of the test too. You can also set prefs directly in the manifest: -```ini +```toml [DEFAULT] -prefs = - browser.chrome.guess_favicon=true +prefs = [ + "browser.chrome.guess_favicon=true", +] ``` If you need to change a pref when running a test locally, you can use the @@ -117,12 +118,13 @@ docs for less mochitest-specific documentation of what you can do in SJS scripts. An SJS is simply a JavaScript file with the extension .sjs which is loaded in a -sandbox. Don't forget to reference it from your `mochitest.ini` file too! +sandbox. Don't forget to reference it from your `mochitest.toml` file too! -```ini +```toml [DEFAULT] -support-files = - test_file.sjs +support-files = [ + "test_file.sjs", +] ``` The global property `handleRequest` defined by the script is then executed with diff --git a/testing/docs/mochitest-plain/index.md b/testing/docs/mochitest-plain/index.md @@ -37,7 +37,7 @@ To run all the tests in `dom/svg/`, this command would work: You can also pass a manifest path to run all tests on that manifest: ``` -./mach test dom/base/test/mochitest.ini +./mach test dom/base/test/mochitest.toml ``` ## Running flavors and subsuites @@ -260,35 +260,35 @@ Then you can eventually fetch their content by using `XMLHttpRequest` or so. ./mach addtest --suite mochitest-{plain,chrome,browser-chrome} path/to/new/test ``` -That will add the manifest entry to the relevant manifest (`mochitest.ini`, -`chrome.ini`, etc. depending on the flavor) to tell the build system about your +That will add the manifest entry to the relevant manifest (`mochitest.toml`, +`chrome.toml`, etc. depending on the flavor) to tell the build system about your new test, as well as creating the file based on a template. -```ini +```toml [test_new_feature.html] ``` Optionally, you can specify metadata for your test, like whether to skip the test on certain platforms: -```ini +```toml [test_new_feature.html] -skip-if = os == 'win' +skip-if = ["os == 'win'"] ``` -The [mochitest.ini format](/build/buildsystem/test_manifests.rst), which is +The [mochitest.toml format](/build/buildsystem/test_manifests.rst), which is recognized by the parser, defines a long list of metadata. -### Adding a new mochitest.ini or chrome.ini file +### Adding a new mochitest.toml or chrome.toml file -If a `mochitest.ini` or `chrome.ini` file does not exist in the test directory +If a `mochitest.toml` or `chrome.toml` file does not exist in the test directory where you want to add a test, add them and update the moz.build file in the directory for your test. For example, in `gfx/layers/moz.build`, we add these two manifest files: ```python -MOCHITEST_MANIFESTS += ['apz/test/mochitest.ini'] -MOCHITEST_CHROME_MANIFESTS += ['apz/test/chrome.ini'] +MOCHITEST_MANIFESTS += ['apz/test/mochitest.toml'] +MOCHITEST_CHROME_MANIFESTS += ['apz/test/chrome.toml'] ``` <!-- TODO: This might be outdated.* diff --git a/testing/specialpowers/content/SpecialPowersChild.sys.mjs b/testing/specialpowers/content/SpecialPowersChild.sys.mjs @@ -531,7 +531,7 @@ export class SpecialPowersChild extends JSWindowActorChild { throw new Error( `Error while executing chrome script '${aUrl}':\n` + "The script doesn't exist. Ensure you have registered it in " + - "'support-files' in your mochitest.ini." + "'support-files' in your mochitest.toml." ); } diff --git a/testing/xpcshell/selftest.py b/testing/xpcshell/selftest.py @@ -500,7 +500,7 @@ class XPCShellTestsTests(unittest.TestCase): def writeManifest(self, tests, prefs=[]): """ - Write an xpcshell.ini in the temp directory and set + Write an xpcshell.toml in the temp directory and set self.manifest to its pathname. |tests| is a list containing either strings (for test names), or tuples with a test name as the first element and manifest conditions as the following diff --git a/testing/xpcshell/test/unit/prefs_test_common.js b/testing/xpcshell/test/unit/prefs_test_common.js @@ -12,12 +12,12 @@ function has_pref_from_xpcshell_user_js() { return isValidPref("extensions.webextensions.warnings-as-errors"); } -// Test pref from xpcshell-with-prefs.ini +// Test pref from xpcshell-with-prefs.toml function has_pref_from_manifest_defaults() { return isValidPref("dummy.pref.from.test.manifest"); } -// Test pref set in xpcshell.ini and xpcshell-with-prefs.ini +// Test pref set in xpcshell.toml and xpcshell-with-prefs.toml function has_pref_from_manifest_file_section() { return isValidPref("dummy.pref.from.test.file"); } @@ -30,7 +30,7 @@ function check_common_xpcshell_with_prefs() { Assert.ok( has_pref_from_manifest_defaults(), - "Should have pref from DEFAULTS in xpcshell-with-prefs.ini" + "Should have pref from DEFAULTS in xpcshell-with-prefs.toml" ); } @@ -42,6 +42,6 @@ function check_common_xpcshell_without_prefs() { Assert.ok( !has_pref_from_manifest_defaults(), - "xpcshell.ini did not set any prefs in DEFAULTS" + "xpcshell.toml did not set any prefs in DEFAULTS" ); } diff --git a/testing/xpcshell/test/unit/test_prefs_defaults_and_file.js b/testing/xpcshell/test/unit/test_prefs_defaults_and_file.js @@ -10,13 +10,13 @@ function run_test() { Assert.ok( has_pref_from_manifest_file_section(), - "Should have pref set for file in xpcshell-with-prefs.ini" + "Should have pref set for file in xpcshell-with-prefs.toml" ); Assert.equal( Services.prefs.getIntPref("dummy.pref.from.test.file"), 2, - "Value of pref that was set once at the file in xpcshell-with-prefs.ini" + "Value of pref that was set once at the file in xpcshell-with-prefs.toml" ); Assert.equal( diff --git a/testing/xpcshell/test/unit/test_prefs_no_defaults_with_file.js b/testing/xpcshell/test/unit/test_prefs_no_defaults_with_file.js @@ -10,6 +10,6 @@ function run_test() { Assert.ok( has_pref_from_manifest_file_section(), - "Should have pref set for file in xpcshell.ini" + "Should have pref set for file in xpcshell.toml" ); } diff --git a/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_show_firefox_accounts.js b/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_show_firefox_accounts.js @@ -3,7 +3,7 @@ "use strict"; -// Note: "identity.fxaccounts.remote.root" is set to https://example.com in browser.ini +// Note: "identity.fxaccounts.remote.root" is set to https://example.com in browser.toml add_task(async function test_SHOW_FIREFOX_ACCOUNTS() { await BrowserTestUtils.withNewTab("about:blank", async browser => { let loaded = BrowserTestUtils.browserLoaded(browser);