Bug 1290333 - Add framebuffer size test case; r=ethlin,jgilbert
authordmu@mozilla.com <dmu@mozilla.com>
Mon, 15 Aug 2016 10:05:22 +0000
changeset 315572 7013608fdbbc0649dcfa79d04b25bc858565eb7f
parent 315571 199c73e2737df4e74dce37cfa1d139f0ed873f02
child 315573 c017d2d3ffe20384f6e4d82e0f5855a586143474
push id30751
push usercbook@mozilla.com
push dateThu, 29 Sep 2016 09:43:23 +0000
treeherdermozilla-central@b67dc49095dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin, jgilbert
bugs1290333
milestone52.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 1290333 - Add framebuffer size test case; r=ethlin,jgilbert MozReview-Commit-ID: 3qhBAPiZEpS
dom/canvas/test/webgl-mochitest/mochitest.ini
dom/canvas/test/webgl-mochitest/test_canvas_size.html
--- a/dom/canvas/test/webgl-mochitest/mochitest.ini
+++ b/dom/canvas/test/webgl-mochitest/mochitest.ini
@@ -48,16 +48,17 @@ fail-if = (os == 'android') || (os == 'w
 
 [regress/test_bug_1268096.html]
 
 
 [test_backends.html]
 [test_backbuffer_channels.html]
 fail-if = (os == 'b2g')
 [test_depth_readpixels.html]
+[test_canvas_size.html]
 [test_capture.html]
 support-files = ../captureStream_common.js
 # Even though we use ../ here, in the test HTML, we need to omit this. Sub-CWD relative
 # paths are fine, but they locate the file and dump it in the current directory.
 [test_cubemap_must_be_square.html]
 [test_depth_tex_lazy_clear.html]
 [test_draw.html]
 [test_fb_param.html]
new file mode 100644
--- /dev/null
+++ b/dom/canvas/test/webgl-mochitest/test_canvas_size.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <meta charset='UTF-8'>
+  <script src='/tests/SimpleTest/SimpleTest.js'></script>
+  <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
+</head>
+<title>WebGL test: Framebuffer maximum size test. (Bug 1290333)</title>
+<body>
+<script>
+function TestSize(contextName, testSize) {
+  var attributes = {
+    antialias: false,
+  };
+
+  var canvas = document.createElement('canvas');
+  var gl = canvas.getContext(contextName, attributes);
+
+  if (!gl) {
+    todo(false, contextName + 'is unavailable.');
+    return;
+  }
+  gl.canvas.width = testSize;
+  gl.canvas.height = testSize;
+
+  ok(true, contextName + 'test complete.');
+}
+
+function run() {
+  TestSize('webgl', 16384);
+  TestSize('webgl2', 16384);
+
+  ok(true, 'Test complete.');
+  SimpleTest.finish();
+}
+
+////////////////////////////////////////
+
+SimpleTest.waitForExplicitFinish();
+
+try {
+  var prefPairList = [
+    ['webgl.force-enabled', true],
+  ];
+  var prefEnv = {'set': prefPairList};
+  SpecialPowers.pushPrefEnv(prefEnv, run);
+} catch (e) {
+  warning('No SpecialPowers, but trying WebGL2 anyway...');
+  run();
+}
+
+</script>
+</body>
+</html>