Bug 1941046 - Part 4: Send a callback request for impression and clicks of MARS Top...
[gecko.git] / dom / bindings / test / test_sequence_wrapping.html
blob2b1d657b6cfff163b1af2c3ee5ca76cf9848a070
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=775852
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 775852</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=775852">Mozilla Bug 775852</a>
14 <p id="display"></p>
15 <iframe id="content" style="display: none">
16 </iframe>
17 <pre id="test">
18 <script type="application/javascript">
20 /** Test for Bug 775852 **/
21 function doTest() {
22 let win = document.getElementById("content").contentWindow;
23 let doc = win.document;
24 doc.body.innerHTML = `<canvas width="1" height="1" id="c"></canvas>`;
26 let gl = doc.getElementById("c").getContext("experimental-webgl");
27 if (!gl) {
28 // No WebGL support on MacOS 10.5. Just skip this test
29 todo(false, "WebGL not supported");
30 return;
32 var setterCalled = false;
34 var extLength = gl.getSupportedExtensions().length;
35 ok(extLength > 0,
36 "This test won't work right if we have no supported extensions");
38 win.Object.defineProperty(win.Array.prototype, "0",
40 set() {
41 setterCalled = true;
43 });
45 // Test that our property got defined correctly
46 let arr = new win.Array();
47 arr[0] = 5;
48 is(setterCalled, true, "Setter should be called when setting prop on array");
50 setterCalled = false;
52 is(gl.getSupportedExtensions().length, extLength,
53 "We should still have the same number of extensions");
55 is(setterCalled, false,
56 "Setter should not be called when getting supported extensions");
58 doTest();
59 </script>
60 </pre>
61 </body>
62 </html>