Bug 1362047 - Add comment explaining unobvous uses of mockAppInfo()
MozReview-Commit-ID: 1ZSFXrmGS00
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
@@ -1,15 +1,17 @@
"use strict";
const server = createHttpServer();
server.registerDirectory("/data/", do_get_file("data"));
const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
+// ExtensionContent.jsm needs to know when it's running from xpcshell,
+// to use the right timeout for content scripts executed at document_idle.
ExtensionTestUtils.mockAppInfo();
add_task(async function test_contentscript_runAt() {
function background() {
browser.runtime.onMessage.addListener(([msg, expectedStates, readyState], sender) => {
if (msg == "chrome-namespace-ok") {
browser.test.sendMessage(msg);
return;
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_xrays.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_xrays.js
@@ -1,12 +1,14 @@
"use strict";
Cu.import("resource://gre/modules/Preferences.jsm");
+// ExtensionContent.jsm needs to know when it's running from xpcshell,
+// to use the right timeout for content scripts executed at document_idle.
ExtensionTestUtils.mockAppInfo();
const server = createHttpServer();
server.registerDirectory("/data/", do_get_file("data"));
const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
const XRAY_PREF = "dom.allow_named_properties_object_for_xrays";
--- a/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
@@ -1,12 +1,14 @@
"use strict";
Cu.import("resource://gre/modules/Preferences.jsm");
+// ExtensionContent.jsm needs to know when it's running from xpcshell,
+// to use the right timeout for content scripts executed at document_idle.
ExtensionTestUtils.mockAppInfo();
const server = createHttpServer();
server.registerDirectory("/data/", do_get_file("data"));
const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
do_register_cleanup(() => {