Bug 1362047 - Add comment explaining unobvous uses of mockAppInfo() draft
authorTomislav Jovanovic <tomica@gmail.com>
Sun, 21 May 2017 17:30:28 +0200
changeset 582138 f159b28886657dd359102a4105281f6eacf2e481
parent 577479 f12621c3d258c7e8456280933844da84c9582284
child 629681 2e8e7b3246519ba03f460701951d42a098c7ceb3
push id59984
push userbmo:tomica@gmail.com
push dateSun, 21 May 2017 16:42:48 +0000
bugs1362047
milestone55.0a1
Bug 1362047 - Add comment explaining unobvous uses of mockAppInfo() MozReview-Commit-ID: 1ZSFXrmGS00
toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
toolkit/components/extensions/test/xpcshell/test_ext_contentscript_xrays.js
toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
--- 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(() => {