content/canvas/test/webgl-conformance/conformance/programs/gl-getshadersource.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/webgl-conformance/conformance/programs/gl-getshadersource.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +<!--
     1.5 +Copyright (c) 2011 The Chromium Authors. All rights reserved.
     1.6 +Use of this source code is governed by a BSD-style license that can be
     1.7 +found in the LICENSE file.
     1.8 + -->
     1.9 +<!DOCTYPE html>
    1.10 +<html>
    1.11 +<head>
    1.12 +<meta charset="utf-8">
    1.13 +   <title>WebGL getShaderSource conformance test.</title>
    1.14 +<link rel="stylesheet" href="../../resources/js-test-style.css"/>
    1.15 +<script src="../../resources/js-test-pre.js"></script>
    1.16 +<script src="../resources/webgl-test.js"> </script>
    1.17 +<script src="../resources/webgl-test-utils.js"> </script>
    1.18 +</head>
    1.19 +<body>
    1.20 +<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
    1.21 +<div id="description"></div>
    1.22 +<div id="console"></div>
    1.23 +<script id="vshader" type="x-shader/x-vertex">abc//defNOTASCII</script>
    1.24 +<script>
    1.25 +description("Tests that the source that goes into a shader is what comes out.");
    1.26 +var wtu = WebGLTestUtils;
    1.27 +var gl = wtu.create3DContext("example");
    1.28 +var original = document.getElementById("vshader").text;
    1.29 +var shader = gl.createShader(gl.VERTEX_SHADER);
    1.30 +gl.shaderSource(shader, original);
    1.31 +var source = gl.getShaderSource(shader);
    1.32 +shouldBe("source", "original");
    1.33 +glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
    1.34 +successfullyParsed = true;
    1.35 +</script>
    1.36 +<script>finishTest();</script>
    1.37 +
    1.38 +</body>
    1.39 +</html>
    1.40 +
    1.41 +

mercurial