Re: JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Bobby Holley
On Mon, Aug 26, 2019 at 12:02 AM Henri Sivonen wrote: > If in a plain mochitest I do > var rope = > SpecialPowers.Cu.getJSTestingFunctions().newRope(t.head, t.tail); > var encoded = (new TextEncoder()).encode(rope); > the encode() method doesn't see the rope. Instead, the call to > en

Re: JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Henri Sivonen
On Mon, Aug 26, 2019 at 1:37 PM Jan de Mooij wrote: > > On Mon, Aug 26, 2019 at 12:25 PM Henri Sivonen wrote: >> >> Thanks. Since SpecialPowers doesn't exist in xpcshell tests, is there >> another way to reach JS testing functions from there? > > > I think just Cu.getJSTestingFunctions() should w

Re: JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Jan de Mooij
On Mon, Aug 26, 2019 at 12:25 PM Henri Sivonen wrote: > Thanks. Since SpecialPowers doesn't exist in xpcshell tests, is there > another way to reach JS testing functions from there? > I think just Cu.getJSTestingFunctions() should work. Jan > > -- > Henri Sivonen > hsivo...@mozilla.com >

Re: JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Henri Sivonen
On Mon, Aug 26, 2019 at 11:27 AM Jan de Mooij wrote: > > On Mon, Aug 26, 2019 at 9:02 AM Henri Sivonen wrote: >> >> In what type of test does >> SpecialPowers.Cu.getJSTestingFunctions().newRope() actually return a >> rope within the calling compartment such that passing the rope to a >> WebIDL AP

Re: JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Jan de Mooij
On Mon, Aug 26, 2019 at 9:02 AM Henri Sivonen wrote: > In what type of test does > SpecialPowers.Cu.getJSTestingFunctions().newRope() actually return a > rope within the calling compartment such that passing the rope to a > WebIDL API really makes the rope enter the WebIDL bindings instead of > g

JS testing functions and compartments in mochitest-plain

2019-08-26 Thread Henri Sivonen
If in a plain mochitest I do var rope = SpecialPowers.Cu.getJSTestingFunctions().newRope(t.head, t.tail); var encoded = (new TextEncoder()).encode(rope); the encode() method doesn't see the rope. Instead, the call to encode() sees a linear string that was materialized by a copy in a cro