Bug 1232864 - Hotfix test on a CLOSED TREE
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 16 Dec 2015 16:13:21 -0800
changeset 276651 d148b0aa6544da2172d95429eee9155ee148d344
parent 276650 09fcb5bd716705a5f600d9fb29b06b1aa491efbd
child 276652 92dd0bbbf087f1b72da49ae16748faf536a46fd4
push id69251
push userjgilbert@mozilla.com
push dateThu, 17 Dec 2015 00:32:14 +0000
treeherdermozilla-inbound@92dd0bbbf087 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1232864
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1232864 - Hotfix test on a CLOSED TREE
dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html
--- a/dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html
+++ b/dom/canvas/test/webgl-mochitest/test_webgl2_not_exposed.html
@@ -1,21 +1,37 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-<title>WebGL test: WebGL2RenderingContext not exposed</title>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" href="/tests/SimpleTest/test.css">
+<title>WebGL test: WebGL2RenderingContext only exposed when appropriate</title>
+<script src='/tests/SimpleTest/SimpleTest.js'></script>
+<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
 </head>
 <body>
 <script>
 
-var exposed = false;
-try {
-  null instanceof WebGL2RenderingContext;
-  exposed = true;
-} catch (e) {}
+function ShouldExpose() {
+  try {
+    return SpecialPowers.getBoolPref('webgl.enable-prototype-webgl2');
+  } catch (e) {}
+
+  return false;
+}
 
-ok(!exposed, 'WebGL2RenderingContext should not be exposed.');
+function DoesExpose() {
+  try {
+    null instanceof WebGL2RenderingContext;
+    return true;
+  } catch (e) {}
+
+  return false;
+}
+
+var doesExpose = DoesExpose();
+if (ShouldExpose()) {
+  ok(doesExpose, 'WebGL2RenderingContext should be exposed.');
+} else {
+  ok(!doesExpose, 'WebGL2RenderingContext should not be exposed.');
+}
 
 </script>
 </body>
 </html>