Re: How to reliably make an ArrayBufferView wrapped?

2019-03-25 Thread violet . bugreport
Thank you for the detailed explanation! It works.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: How to reliably make an ArrayBufferView wrapped?

2019-03-25 Thread Boris Zbarsky

On 3/25/19 11:22 AM, violet.bugrep...@gmail.com wrote:

I think it should be a browser test, because I need to call IndexedDB.


OK, makes sense.

In that case, the simplest option is to pick a browser test that 
involves Xray wrappers and modify it so you have an Xray to an 
ArrayBufferView.


If IndexedDB works in system-principal pages, you could take something 
like 
https://searchfox.org/mozilla-central/source/js/xpconnect/tests/chrome/test_xrayToJS.xul 
and use a similar setup.  So create a mochitest-chrome test that loads 
file_empty.html or equivalent in a subframe, then do:


  var view = new 
(document.getElementById('ifr').contentWindow.Int32Array)(5);


or so and go on from there.

If you run into trouble, please feel free to ping me on IRC ("bz" on 
#content or #developers) or mail me, or post here.


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: How to reliably make an ArrayBufferView wrapped?

2019-03-25 Thread violet . bugreport
> Are you trying to write a JS shell test or a browser test?

I think it should be a browser test, because I need to call IndexedDB.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: How to reliably make an ArrayBufferView wrapped?

2019-03-25 Thread Boris Zbarsky

On 3/25/19 4:22 AM, violet.bugrep...@gmail.com wrote:

In the test, I want to make sure the object is indeed a wrapped one. Is there a 
reliable way to write JavaScript code to achieve this?


Are you trying to write a JS shell test or a browser test?

-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform