|
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 type="application/javascript" 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 <div id="content" style="display: none"> |
|
16 <canvas width="1" height="1" id="c"></canvas> |
|
17 </div> |
|
18 <pre id="test"> |
|
19 <script type="application/javascript"> |
|
20 |
|
21 /** Test for Bug 775852 **/ |
|
22 function doTest() { |
|
23 var gl = $("c").getContext("experimental-webgl"); |
|
24 if (!gl) { |
|
25 // No WebGL support on MacOS 10.5. Just skip this test |
|
26 todo(false, "WebGL not supported"); |
|
27 return; |
|
28 } |
|
29 var setterCalled = false; |
|
30 |
|
31 extLength = gl.getSupportedExtensions().length; |
|
32 ok(extLength > 0, |
|
33 "This test won't work right if we have no supported extensions"); |
|
34 |
|
35 Object.defineProperty(Array.prototype, "0", |
|
36 { |
|
37 set: function(val) { |
|
38 setterCalled = true; |
|
39 } |
|
40 }); |
|
41 |
|
42 // Test that our property got defined correctly |
|
43 var arr = [] |
|
44 arr[0] = 5; |
|
45 is(setterCalled, true, "Setter should be called when setting prop on array"); |
|
46 |
|
47 setterCalled = false; |
|
48 |
|
49 is(gl.getSupportedExtensions().length, extLength, |
|
50 "We should still have the same number of extensions"); |
|
51 |
|
52 is(setterCalled, false, |
|
53 "Setter should not be called when getting supported extensions"); |
|
54 } |
|
55 doTest(); |
|
56 </script> |
|
57 </pre> |
|
58 </body> |
|
59 </html> |