From def92d1b8e9d373e2f6f27c366d578d97d8960c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:50 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- testing/docs/mochitest-plain/faq.md | 2 +- testing/docs/xpcshell/index.rst | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'testing/docs') diff --git a/testing/docs/mochitest-plain/faq.md b/testing/docs/mochitest-plain/faq.md index 47a8bbed18..a852f135d8 100644 --- a/testing/docs/mochitest-plain/faq.md +++ b/testing/docs/mochitest-plain/faq.md @@ -268,7 +268,7 @@ state available to SJS scripts running in Mochitest: function handleRequest(req, res) { var file; getObjectState("SERVER_ROOT", function(serverRoot) { - file = serverRoot.getFile("tests/content/media/test/320x240.ogv"); + file = serverRoot.getFile("tests/content/media/test/320x240.webm"); }); // file is now an XPCOM object referring to the given file res.write("file: " + file); diff --git a/testing/docs/xpcshell/index.rst b/testing/docs/xpcshell/index.rst index e9a8e93aca..6fc6d8ba4b 100644 --- a/testing/docs/xpcshell/index.rst +++ b/testing/docs/xpcshell/index.rst @@ -131,7 +131,7 @@ Test case registration and execution ``add_task([condition, ]testFunc)`` Add an asynchronous function or to the list of tests that are to be run asynchronously. Whenever the function ``await``\ s a - `Promise `__, + `Promise `__, the test runner waits until the promise is resolved or rejected before proceeding. Rejected promises are converted into exceptions, and resolved promises are converted into values. @@ -377,7 +377,7 @@ well, and they will be made available by their filename. path/to/tests ├──head.js - ├──module.jsm + ├──module.mjs ├──moz.build ├──test_example.js └──xpcshell.ini @@ -388,7 +388,7 @@ well, and they will be made available by their filename. [DEFAULT] head = head.js support-files = - ./module.jsm + ./module.mjs ../../some/other/file.js [test_component_state.js] @@ -398,8 +398,8 @@ well, and they will be made available by their filename. var globalValue = "A global value."; // Import support-files. - const { foo } = ChromeUtils.import("resource://test/module.jsm"); - const { bar } = ChromeUtils.import("resource://test/file.jsm"); + const { foo } = ChromeUtils.import("resource://test/module.mjs"); + const { bar } = ChromeUtils.import("resource://test/file.mjs"); .. code:: js @@ -533,12 +533,13 @@ Runtime detection Some tests will want to only execute certain portions on specific platforms. Use -`AppConstants.jsm `__ +`AppConstants.sys.mjs `__ for determining the platform, for example: .. code:: js - ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); + let { AppConstants } = + ChromeUtils.importESModule("resource://gre/modules/AppConstants.mjs"); let isMac = AppConstants.platform == "macosx"; @@ -565,7 +566,8 @@ this: .. code:: js - ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); + let { AppConstants } = + ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs"); add_task({ skip_if: () => AppConstants.platform != "mac" -- cgit v1.2.3