1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/test/webgl-conformance/conformance/glsl/misc/shader-with-long-line.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,67 @@ 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 GLSL Conformance Tests</title> 1.14 +<link rel="stylesheet" href="../../../resources/js-test-style.css"/> 1.15 +<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> 1.16 +<script src="../../../resources/desktop-gl-constants.js" type="text/javascript"></script> 1.17 +<script src="../../../resources/js-test-pre.js"></script> 1.18 +<script src="../../resources/webgl-test-utils.js"></script> 1.19 +<script src="../../resources/glsl-conformance-test.js"></script> 1.20 +</head> 1.21 +<body> 1.22 +<div id="description"></div> 1.23 +<div id="console"></div> 1.24 +<script id="fshaderWithLongLine" type="text/something-not-javascript"> 1.25 +precision mediump float; 1.26 +uniform float fooo; 1.27 +#if defined(someSymbolNotDefined) 1.28 +#error long 1.29 +#endif 1.30 +void main() 1.31 +{ 1.32 + gl_FragColor = vec4(fooo+fooo+fooo+fooo, fooo+fooo+fooo+fooo, fooo+fooo+fooo+fooo, 1.0); 1.33 +} 1.34 +</script> 1.35 +<script> 1.36 +description("checks shader with long line succeeds"); 1.37 + 1.38 +var wtu = WebGLTestUtils; 1.39 +GLSLConformanceTester.runTests([ 1.40 + { vShaderId: undefined, 1.41 + vShaderSuccess: true, 1.42 + fShaderId: 'fshaderWithLongLine', 1.43 + fShaderSuccess: true, 1.44 + fShaderPrep: function(str) { 1.45 + function expand(str, re, replacement, count) { 1.46 + for (var ii = 0; ii < count; ++ii) { 1.47 + str = str.replace(re, replacement); 1.48 + } 1.49 + return str; 1.50 + } 1.51 + str = expand(str, new RegExp(" ", 'g'), " ", 12); 1.52 + var manyZeros = expand("0", new RegExp("0", 'g'), "00", 8).substring(2); 1.53 + str = expand(str, new RegExp("0", 'g'), manyZeros, 1); 1.54 + str = expand(str, new RegExp("fooo", 'g'), "fooofooo", 6); 1.55 + str = expand(str, new RegExp("long", 'g'), "longlong", 6); 1.56 + //debug("len:" + str.length); 1.57 + //debug(str); 1.58 + return str; 1.59 + }, 1.60 + linkSuccess: true, 1.61 + passMsg: 'shader that uses long lines should succeed', 1.62 + } 1.63 + ]); 1.64 + 1.65 +debug(""); 1.66 +successfullyParsed = true; 1.67 + 1.68 +</script> 1.69 +</body> 1.70 +</html>