1 let ppmm = Services.ppmm.getChildAt(0);
3 Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true);
4 registerCleanupFunction(() => {
5 Services.prefs.clearUserPref("security.allow_eval_with_system_principal");
8 add_task(async function test_bindings() {
9 let {strict, bound} = await new Promise(function(resolve) {
10 // Use a listener to get results from child
11 ppmm.addMessageListener("results", function listener(msg) {
12 ppmm.removeMessageListener("results", listener);
16 // Bind vars in first process script
17 ppmm.loadProcessScript("resource://test/environment_script.js", false);
19 // Check visibility in second process script
20 ppmm.loadProcessScript(`data:,
21 let strict = (function() { return this; })() === undefined;
24 try { void vu; bound += "vu,"; } catch (e) {}
25 try { void vq; bound += "vq,"; } catch (e) {}
26 try { void vl; bound += "vl,"; } catch (e) {}
27 try { void gt; bound += "gt,"; } catch (e) {}
28 try { void ed; bound += "ed,"; } catch (e) {}
29 try { void ei; bound += "ei,"; } catch (e) {}
30 try { void fo; bound += "fo,"; } catch (e) {}
31 try { void fi; bound += "fi,"; } catch (e) {}
32 try { void fd; bound += "fd,"; } catch (e) {}
34 sendAsyncMessage("results", { strict, bound });
38 // FrameScript loader should share |this| access
40 if (bound != "gt,ed,ei,fo,")
41 throw new Error("Unexpected global binding set - " + bound);
43 if (bound != "gt,ed,ei,fo,fi,fd,")
44 throw new Error("Unexpected global binding set - " + bound);