content/canvas/test/webgl-mochitest/test_webgl_conformance.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/webgl-mochitest/test_webgl_conformance.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,29 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +<title>WebGL test: 'webgl' context request</title>
     1.8 +<script src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +<link rel="stylesheet" href="/tests/SimpleTest/test.css">
    1.10 +<script src="webgl-util.js"></script>
    1.11 +</head>
    1.12 +<body>
    1.13 +<canvas id="c"></canvas>
    1.14 +<script>
    1.15 +
    1.16 +var gl = WebGLUtil.getWebGL('c', true);
    1.17 +
    1.18 +var isMobile = /Mobile/.test(navigator.userAgent);
    1.19 +var isTablet = /Tablet/.test(navigator.userAgent);
    1.20 +var shouldBeConformant = !isMobile && !isTablet;
    1.21 +
    1.22 +if (shouldBeConformant) {
    1.23 +  // Desktop.
    1.24 +  ok(gl, 'Expected conformance on: ' + navigator.userAgent);
    1.25 +} else {
    1.26 +  // Fennec, B2G.
    1.27 +  ok(!gl, 'Expected no conformance on: ' + navigator.userAgent);
    1.28 +}
    1.29 +
    1.30 +</script>
    1.31 +</body>
    1.32 +</html>

mercurial