1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/test/webgl-conformance/conformance/more/unit.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,881 @@ 1.4 +/* 1.5 +Unit testing library for the OpenGL ES 2.0 HTML Canvas context 1.6 + 1.7 +Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com> 1.8 + 1.9 +Permission is hereby granted, free of charge, to any person 1.10 +obtaining a copy of this software and associated documentation 1.11 +files (the "Software"), to deal in the Software without 1.12 +restriction, including without limitation the rights to use, 1.13 +copy, modify, merge, publish, distribute, sublicense, and/or sell 1.14 +copies of the Software, and to permit persons to whom the 1.15 +Software is furnished to do so, subject to the following 1.16 +conditions: 1.17 + 1.18 +The above copyright notice and this permission notice shall be 1.19 +included in all copies or substantial portions of the Software. 1.20 + 1.21 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 1.22 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 1.23 +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 1.24 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 1.25 +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 1.26 +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1.27 +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1.28 +OTHER DEALINGS IN THE SOFTWARE. 1.29 +*/ 1.30 +Tests = { 1.31 + autorun : true, 1.32 + message : null, 1.33 + delay : 0, 1.34 + 1.35 + startUnit : function(){ return []; }, 1.36 + setup : function() { return arguments; }, 1.37 + teardown : function() {}, 1.38 + endUnit : function() {} 1.39 +} 1.40 + 1.41 +var __testSuccess__ = true; 1.42 +var __testFailCount__ = 0; 1.43 +var __testLog__; 1.44 +var __backlog__ = []; 1.45 + 1.46 +Object.toSource = function(a, seen){ 1.47 + if (a == null) return "null"; 1.48 + if (typeof a == 'boolean') return a ? "true" : "false"; 1.49 + if (typeof a == 'string') return '"' + a.replace(/"/g, '\\"') + '"'; 1.50 + if (a instanceof HTMLElement) return a.toString(); 1.51 + if (a.width && a.height && a.data) return "[ImageData]"; 1.52 + if (a instanceof Array) { 1.53 + if (!seen) seen = []; 1.54 + var idx = seen.indexOf(a); 1.55 + if (idx != -1) return '#'+(idx+1)+'#'; 1.56 + seen.unshift(a); 1.57 + var srcs = a.map(function(o){ return Object.toSource(o,seen) }); 1.58 + var prefix = ''; 1.59 + idx = seen.indexOf(a); 1.60 + if (idx != -1) prefix = '#'+(idx+1)+'='; 1.61 + return prefix + '[' + srcs.join(", ") + ']'; 1.62 + } 1.63 + if (typeof a == 'object') { 1.64 + if (!seen) seen = []; 1.65 + var idx = seen.indexOf(a); 1.66 + if (idx != -1) return '#'+(idx+1)+'#'; 1.67 + seen.unshift(a); 1.68 + var members = []; 1.69 + var name; 1.70 + try { 1.71 + for (var i in a) { 1.72 + if (i.search(/^[a-zA-Z0-9]+$/) != -1) 1.73 + name = i; 1.74 + else 1.75 + name = '"' + i.replace(/"/g, '\\"') + '"'; 1.76 + var ai; 1.77 + try { ai = a[i]; } 1.78 + catch(e) { ai = 'null /*ERROR_ACCESSING*/'; } 1.79 + var s = name + ':' + Object.toSource(ai, seen); 1.80 + members.push(s); 1.81 + } 1.82 + } catch (e) {} 1.83 + var prefix = ''; 1.84 + idx = seen.indexOf(a); 1.85 + if (idx != -1) prefix = '#'+(idx+1)+'='; 1.86 + return prefix + '{' + members.join(", ") + '}' 1.87 + } 1.88 + if (typeof a == 'function') 1.89 + return '('+a.toString().replace(/\n/g, " ").replace(/\s+/g, " ")+')'; 1.90 + return a.toString(); 1.91 +} 1.92 + 1.93 +function formatError(e) { 1.94 + if (window.console) console.log(e); 1.95 + var pathSegs = location.href.toString().split("/"); 1.96 + var currentDoc = e.lineNumber != null ? pathSegs[pathSegs.length - 1] : null; 1.97 + var trace = (e.filename || currentDoc) + ":" + e.lineNumber + (e.trace ? "\n"+e.trace : ""); 1.98 + return e.message + "\n" + trace; 1.99 +} 1.100 + 1.101 +function runTests() { 1.102 + var h = document.getElementById('test-status'); 1.103 + if (h == null) { 1.104 + h = document.createElement('h1'); 1.105 + h.id = 'test-status'; 1.106 + document.body.appendChild(h); 1.107 + } 1.108 + h.textContent = ""; 1.109 + var log = document.getElementById('test-log'); 1.110 + if (log == null) { 1.111 + log = document.createElement('div'); 1.112 + log.id = 'test-log'; 1.113 + document.body.appendChild(log); 1.114 + } 1.115 + while (log.childNodes.length > 0) 1.116 + log.removeChild(log.firstChild); 1.117 + 1.118 + var setup_args = []; 1.119 + 1.120 + if (Tests.startUnit != null) { 1.121 + __testLog__ = document.createElement('div'); 1.122 + try { 1.123 + setup_args = Tests.startUnit(); 1.124 + if (__testLog__.childNodes.length > 0) 1.125 + log.appendChild(__testLog__); 1.126 + } catch(e) { 1.127 + testFailed("startUnit", formatError(e)); 1.128 + log.appendChild(__testLog__); 1.129 + printTestStatus(); 1.130 + return; 1.131 + } 1.132 + } 1.133 + 1.134 + var testsRun = false; 1.135 + var allTestsSuccessful = true; 1.136 + 1.137 + for (var i in Tests) { 1.138 + if (i.substring(0,4) != "test") continue; 1.139 + __testLog__ = document.createElement('div'); 1.140 + __testSuccess__ = true; 1.141 + try { 1.142 + doTestNotify (i); 1.143 + var args = setup_args; 1.144 + if (Tests.setup != null) 1.145 + args = Tests.setup.apply(Tests, setup_args); 1.146 + Tests[i].apply(Tests, args); 1.147 + if (Tests.teardown != null) 1.148 + Tests.teardown.apply(Tests, args); 1.149 + } 1.150 + catch (e) { 1.151 + testFailed(i, e.name, formatError(e)); 1.152 + } 1.153 + if (__testSuccess__ == false) { 1.154 + ++__testFailCount__; 1.155 + } 1.156 + var h = document.createElement('h2'); 1.157 + h.textContent = i; 1.158 + __testLog__.insertBefore(h, __testLog__.firstChild); 1.159 + log.appendChild(__testLog__); 1.160 + allTestsSuccessful = allTestsSuccessful && __testSuccess__ == true; 1.161 + reportTestResultsToHarness(__testSuccess__, i); 1.162 + doTestNotify (i+"--"+(__testSuccess__?"OK":"FAIL")); 1.163 + testsRun = true; 1.164 + } 1.165 + 1.166 + printTestStatus(testsRun); 1.167 + if (Tests.endUnit != null) { 1.168 + __testLog__ = document.createElement('div'); 1.169 + try { 1.170 + Tests.endUnit.apply(Tests, setup_args); 1.171 + if (__testLog__.childNodes.length > 0) 1.172 + log.appendChild(__testLog__); 1.173 + } catch(e) { 1.174 + testFailed("endUnit", e.name, formatError(e)); 1.175 + log.appendChild(__testLog__); 1.176 + } 1.177 + } 1.178 + notifyFinishedToHarness(allTestsSuccessful, "finished tests"); 1.179 +} 1.180 + 1.181 +function doTestNotify(name) { 1.182 + //try { 1.183 + // var xhr = new XMLHttpRequest(); 1.184 + // xhr.open("GET", "http://localhost:8888/"+name, true); 1.185 + // xhr.send(null); 1.186 + //} catch(e) {} 1.187 +} 1.188 + 1.189 +function testFailed(assertName, name) { 1.190 + var d = document.createElement('div'); 1.191 + var h = document.createElement('h3'); 1.192 + var d1 = document.createElement("span"); 1.193 + h.appendChild(d1); 1.194 + d1.appendChild(document.createTextNode("FAIL: ")); 1.195 + d1.style.color = "red"; 1.196 + h.appendChild(document.createTextNode( 1.197 + name==null ? assertName : name + " (in " + assertName + ")")); 1.198 + d.appendChild(h); 1.199 + var args = [] 1.200 + for (var i=2; i<arguments.length; i++) { 1.201 + var a = arguments[i]; 1.202 + var p = document.createElement('p'); 1.203 + p.style.whiteSpace = 'pre'; 1.204 + p.textContent = (a == null) ? "null" : 1.205 + (typeof a == 'boolean' || typeof a == 'string') ? a : Object.toSource(a); 1.206 + args.push(p.textContent); 1.207 + d.appendChild(p); 1.208 + } 1.209 + __testLog__.appendChild(d); 1.210 + __testSuccess__ = false; 1.211 + doTestNotify([assertName, name].concat(args).join("--")); 1.212 +} 1.213 + 1.214 +function testPassed(assertName, name) { 1.215 + var d = document.createElement('div'); 1.216 + var h = document.createElement('h3'); 1.217 + var d1 = document.createElement("span"); 1.218 + h.appendChild(d1); 1.219 + d1.appendChild(document.createTextNode("PASS: ")); 1.220 + d1.style.color = "green"; 1.221 + h.appendChild(document.createTextNode( 1.222 + name==null ? assertName : name + " (in " + assertName + ")")); 1.223 + d.appendChild(h); 1.224 + var args = [] 1.225 + for (var i=2; i<arguments.length; i++) { 1.226 + var a = arguments[i]; 1.227 + var p = document.createElement('p'); 1.228 + p.style.whiteSpace = 'pre'; 1.229 + p.textContent = (a == null) ? "null" : 1.230 + (typeof a == 'boolean' || typeof a == 'string') ? a : Object.toSource(a); 1.231 + args.push(p.textContent); 1.232 + d.appendChild(p); 1.233 + } 1.234 + __testLog__.appendChild(d); 1.235 + doTestNotify([assertName, name].concat(args).join("--")); 1.236 +} 1.237 + 1.238 +function checkTestSuccess() { 1.239 + return __testFailCount__ == 0; 1.240 +} 1.241 + 1.242 +window.addEventListener('load', function(){ 1.243 + for (var i=0; i<__backlog__.length; i++) 1.244 + log(__backlog__[i]); 1.245 +}, false); 1.246 + 1.247 +function log(msg) { 1.248 + var p = document.createElement('p'); 1.249 + var a = []; 1.250 + for (var i=0; i<arguments.length; i++) 1.251 + a.push(arguments[i]); 1.252 + p.textContent = a.join(", "); 1.253 + if (!__testLog__) { 1.254 + if (document.body) 1.255 + document.body.appendChild(p); 1.256 + else 1.257 + __backlog__.push(msg); 1.258 + } else { 1.259 + __testLog__.appendChild(p); 1.260 + } 1.261 +} 1.262 + 1.263 +function printTestStatus(testsRun) { 1.264 + var status = document.getElementById('test-status'); 1.265 + if (testsRun) { 1.266 + status.className = checkTestSuccess() ? 'ok' : 'fail'; 1.267 + status.textContent = checkTestSuccess() ? "PASS" : "FAIL"; 1.268 + } else { 1.269 + status.className = 'fail'; 1.270 + status.textContent = "NO TESTS FOUND"; 1.271 + } 1.272 +} 1.273 + 1.274 +function assertFail(name, f) { 1.275 + if (f == null) { f = name; name = null; } 1.276 + var r = false; 1.277 + try { f(); } catch(e) { r=true; } 1.278 + if (!r) { 1.279 + testFailed("assertFail", name, f); 1.280 + return false; 1.281 + } else { 1.282 + testPassed("assertFail", name, f); 1.283 + return true; 1.284 + } 1.285 +} 1.286 + 1.287 +function assertOk(name, f) { 1.288 + if (f == null) { f = name; name = null; } 1.289 + var r = false; 1.290 + var err; 1.291 + try { f(); r=true; } catch(e) { err = e; } 1.292 + if (!r) { 1.293 + testFailed("assertOk", name, f, err.toString()); 1.294 + return false; 1.295 + } else { 1.296 + testPassed("assertOk", name, f); 1.297 + return true; 1.298 + } 1.299 +} 1.300 + 1.301 +function assert(name, v) { 1.302 + if (v == null) { v = name; name = null; } 1.303 + if (!v) { 1.304 + testFailed("assert", name, v); 1.305 + return false; 1.306 + } else { 1.307 + testPassed("assert", name, v); 1.308 + return true; 1.309 + } 1.310 +} 1.311 + 1.312 +function assertProperty(name, v, p) { 1.313 + if (p == null) { p = v; v = name; name = p; } 1.314 + if (v[p] == null) { 1.315 + testFailed("assertProperty", name); 1.316 + return false; 1.317 + } else { 1.318 + testPassed("assertProperty", name); 1.319 + return true; 1.320 + } 1.321 +} 1.322 + 1.323 +function compare(a,b) { 1.324 + if (typeof a == 'number' && typeof b == 'number') { 1.325 + return a == b; 1.326 + } else { 1.327 + return Object.toSource(a) == Object.toSource(b); 1.328 + } 1.329 +} 1.330 + 1.331 +function assertEquals(name, v, p) { 1.332 + if (p == null) { p = v; v = name; name = null; } 1.333 + if (!compare(v, p)) { 1.334 + testFailed("assertEquals", name, v, p); 1.335 + return false; 1.336 + } else { 1.337 + testPassed("assertEquals", name, v, p); 1.338 + return true; 1.339 + } 1.340 +} 1.341 + 1.342 +function assertArrayEquals(name, v, p) { 1.343 + if (p == null) { p = v; v = name; name = null; } 1.344 + if (!v) { 1.345 + testFailed("assertArrayEquals: first array undefined", name, v, p); 1.346 + return false; 1.347 + } 1.348 + if (!p) { 1.349 + testFailed("assertArrayEquals: second array undefined", name, v, p); 1.350 + return false; 1.351 + } 1.352 + if (v.length != p.length) { 1.353 + testFailed("assertArrayEquals", name, v, p); 1.354 + return false; 1.355 + } 1.356 + for (var ii = 0; ii < v.length; ++ii) { 1.357 + if (v[ii] != p[ii]) { 1.358 + testFailed("assertArrayEquals", name, v, p); 1.359 + return false; 1.360 + } 1.361 + } 1.362 + testPassed("assertArrayEquals", name, v, p); 1.363 + return true; 1.364 +} 1.365 + 1.366 +function assertNotEquals(name, v, p) { 1.367 + if (p == null) { p = v; v = name; name = null; } 1.368 + if (compare(v, p)) { 1.369 + testFailed("assertNotEquals", name, v, p) 1.370 + return false; 1.371 + } else { 1.372 + testPassed("assertNotEquals", name, v, p) 1.373 + return true; 1.374 + } 1.375 +} 1.376 + 1.377 +function time(elementId, f) { 1.378 + var s = document.getElementById(elementId); 1.379 + var t0 = new Date().getTime(); 1.380 + f(); 1.381 + var t1 = new Date().getTime(); 1.382 + s.textContent = 'Elapsed: '+(t1-t0)+' ms'; 1.383 +} 1.384 + 1.385 +function randomFloat () { 1.386 + // note that in fuzz-testing, this can used as the size of a buffer to allocate. 1.387 + // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big. 1.388 + var fac = 1.0; 1.389 + var r = Math.random(); 1.390 + if (r < 0.25) 1.391 + fac = 10; 1.392 + else if (r < 0.4) 1.393 + fac = 100; 1.394 + else if (r < 0.5) 1.395 + fac = 1000; 1.396 + else if (r < 0.6) 1.397 + fac = 100000; 1.398 + else if (r < 0.7) 1.399 + fac = 10000000; 1.400 + else if (r < 0.8) 1.401 + fac = NaN; 1.402 + return -0.5*fac + Math.random() * fac; 1.403 +} 1.404 +function randomFloatFromRange(lo, hi) { 1.405 + var r = Math.random(); 1.406 + if (r < 0.05) 1.407 + return lo; 1.408 + else if (r > 0.95) 1.409 + return hi; 1.410 + else 1.411 + return lo + Math.random()*(hi-lo); 1.412 +} 1.413 +function randomInt (sz) { 1.414 + if (sz != null) 1.415 + return Math.floor(Math.random()*sz); 1.416 + else 1.417 + return Math.floor(randomFloat()); 1.418 +} 1.419 +function randomIntFromRange(lo, hi) { 1.420 + return Math.floor(randomFloatFromRange(lo, hi)); 1.421 +} 1.422 +function randomLength () { 1.423 + var l = Math.floor(Math.random() * 256); 1.424 + if (Math.random < 0.5) l = l / 10; 1.425 + if (Math.random < 0.3) l = l / 10; 1.426 + return l; 1.427 +} 1.428 +function randomSmallIntArray () { 1.429 + var l = randomLength(); 1.430 + var s = new Array(l); 1.431 + for (var i=0; i<l; i++) 1.432 + s[i] = Math.floor(Math.random() * 256)-1; 1.433 + return s; 1.434 +} 1.435 +function randomFloatArray () { 1.436 + var l = randomLength(); 1.437 + var s = new Array(l); 1.438 + for (var i=0; i<l; i++) 1.439 + s[i] = randomFloat(); 1.440 + return s; 1.441 +} 1.442 +function randomIntArray () { 1.443 + var l = randomLength(); 1.444 + var s = new Array(l); 1.445 + for (var i=0; i<l; i++) 1.446 + s[i] = randomFloat(); 1.447 + return s; 1.448 +} 1.449 +function randomMixedArray () { 1.450 + var l = randomLength(); 1.451 + var s = new Array(l); 1.452 + for (var i=0; i<l; i++) 1.453 + s[i] = randomNonArray(); 1.454 + return s; 1.455 +} 1.456 +function randomArray () { 1.457 + var r = Math.random(); 1.458 + if (r < 0.3) 1.459 + return randomFloatArray(); 1.460 + else if (r < 0.6) 1.461 + return randomIntArray(); 1.462 + else if (r < 0.8) 1.463 + return randomSmallIntArray(); 1.464 + else 1.465 + return randomMixedArray(); 1.466 +} 1.467 +function randomString () { 1.468 + return String.fromCharCode.apply(String, randomSmallIntArray()); 1.469 +} 1.470 +function randomGLConstant () { 1.471 + return GLConstants[Math.floor(Math.random() * GLConstants.length)]; 1.472 +} 1.473 + 1.474 +function randomNonArray() { 1.475 + var r = Math.random(); 1.476 + if (r < 0.25) { 1.477 + return randomFloat(); 1.478 + } else if (r < 0.6) { 1.479 + return randomInt(); 1.480 + } else if (r < 0.7) { 1.481 + return (r < 0.65); 1.482 + } else if (r < 0.87) { 1.483 + return randomString(); 1.484 + } else if (r < 0.98) { 1.485 + return randomGLConstant(); 1.486 + } else { 1.487 + return null; 1.488 + } 1.489 +} 1.490 + 1.491 +function generateRandomArg(pos, count) { 1.492 + if (pos == 0 && Math.random() < 0.5) 1.493 + return randomGLConstant(); 1.494 + if (pos == count-1 && Math.random() < 0.25) 1.495 + if (Math.random() < 0.5) 1.496 + return randomString(); 1.497 + else 1.498 + return randomArray(); 1.499 + var r = Math.random(); 1.500 + if (r < 0.25) { 1.501 + return randomFloat(); 1.502 + } else if (r < 0.6) { 1.503 + return randomInt(); 1.504 + } else if (r < 0.7) { 1.505 + return (r < 0.65); 1.506 + } else if (r < 0.77) { 1.507 + return randomString(); 1.508 + } else if (r < 0.84) { 1.509 + return randomArray(); 1.510 + } else if (r < 0.98) { 1.511 + return randomGLConstant(); 1.512 + } else { 1.513 + return null; 1.514 + } 1.515 +} 1.516 + 1.517 + 1.518 +function generateRandomArgs(count) { 1.519 + var arr = new Array(count); 1.520 + for (var i=0; i<count; i++) 1.521 + arr[i] = generateRandomArg(i, count); 1.522 + return arr; 1.523 +} 1.524 + 1.525 +// qc (arg1gen, arg2gen, ..., predicate) 1.526 +// qc (randomString, randomInt, randomInt, function(s,i,j){ s.substring(i,j) }) 1.527 +function qc() { 1.528 +} 1.529 + 1.530 +GLConstants = [ 1.531 +1, 1.532 +0x00000100, 1.533 +0x00000400, 1.534 +0x00004000, 1.535 +0x0000, 1.536 +0x0001, 1.537 +0x0002, 1.538 +0x0003, 1.539 +0x0004, 1.540 +0x0005, 1.541 +0x0006, 1.542 +0, 1.543 +1, 1.544 +0x0300, 1.545 +0x0301, 1.546 +0x0302, 1.547 +0x0303, 1.548 +0x0304, 1.549 +0x0305, 1.550 +0x0306, 1.551 +0x0307, 1.552 +0x0308, 1.553 +0x8006, 1.554 +0x8009, 1.555 +0x8009, 1.556 +0x883D, 1.557 +0x800A, 1.558 +0x800B, 1.559 +0x80C8, 1.560 +0x80C9, 1.561 +0x80CA, 1.562 +0x80CB, 1.563 +0x8001, 1.564 +0x8002, 1.565 +0x8003, 1.566 +0x8004, 1.567 +0x8005, 1.568 +0x8892, 1.569 +0x8893, 1.570 +0x8894, 1.571 +0x8895, 1.572 +0x88E0, 1.573 +0x88E4, 1.574 +0x88E8, 1.575 +0x8764, 1.576 +0x8765, 1.577 +0x8626, 1.578 +0x0404, 1.579 +0x0405, 1.580 +0x0408, 1.581 +0x0DE1, 1.582 +0x0B44, 1.583 +0x0BE2, 1.584 +0x0BD0, 1.585 +0x0B90, 1.586 +0x0B71, 1.587 +0x0C11, 1.588 +0x8037, 1.589 +0x809E, 1.590 +0x80A0, 1.591 +0, 1.592 +0x0500, 1.593 +0x0501, 1.594 +0x0502, 1.595 +0x0505, 1.596 +0x0900, 1.597 +0x0901, 1.598 +0x0B21, 1.599 +0x846D, 1.600 +0x846E, 1.601 +0x0B45, 1.602 +0x0B46, 1.603 +0x0B70, 1.604 +0x0B72, 1.605 +0x0B73, 1.606 +0x0B74, 1.607 +0x0B91, 1.608 +0x0B92, 1.609 +0x0B94, 1.610 +0x0B95, 1.611 +0x0B96, 1.612 +0x0B97, 1.613 +0x0B93, 1.614 +0x0B98, 1.615 +0x8800, 1.616 +0x8801, 1.617 +0x8802, 1.618 +0x8803, 1.619 +0x8CA3, 1.620 +0x8CA4, 1.621 +0x8CA5, 1.622 +0x0BA2, 1.623 +0x0C10, 1.624 +0x0C22, 1.625 +0x0C23, 1.626 +0x0CF5, 1.627 +0x0D05, 1.628 +0x0D33, 1.629 +0x0D3A, 1.630 +0x0D50, 1.631 +0x0D52, 1.632 +0x0D53, 1.633 +0x0D54, 1.634 +0x0D55, 1.635 +0x0D56, 1.636 +0x0D57, 1.637 +0x2A00, 1.638 +0x8038, 1.639 +0x8069, 1.640 +0x80A8, 1.641 +0x80A9, 1.642 +0x80AA, 1.643 +0x80AB, 1.644 +0x86A2, 1.645 +0x86A3, 1.646 +0x1100, 1.647 +0x1101, 1.648 +0x1102, 1.649 +0x8192, 1.650 +0x1400, 1.651 +0x1401, 1.652 +0x1402, 1.653 +0x1403, 1.654 +0x1404, 1.655 +0x1405, 1.656 +0x1406, 1.657 +0x140C, 1.658 +0x1902, 1.659 +0x1906, 1.660 +0x1907, 1.661 +0x1908, 1.662 +0x1909, 1.663 +0x190A, 1.664 +0x8033, 1.665 +0x8034, 1.666 +0x8363, 1.667 +0x8B30, 1.668 +0x8B31, 1.669 +0x8869, 1.670 +0x8DFB, 1.671 +0x8DFC, 1.672 +0x8B4D, 1.673 +0x8B4C, 1.674 +0x8872, 1.675 +0x8DFD, 1.676 +0x8B4F, 1.677 +0x8B80, 1.678 +0x8B82, 1.679 +0x8B83, 1.680 +0x8B85, 1.681 +0x8B86, 1.682 +0x8B87, 1.683 +0x8B89, 1.684 +0x8B8A, 1.685 +0x8B8C, 1.686 +0x8B8D, 1.687 +0x0200, 1.688 +0x0201, 1.689 +0x0202, 1.690 +0x0203, 1.691 +0x0204, 1.692 +0x0205, 1.693 +0x0206, 1.694 +0x0207, 1.695 +0x1E00, 1.696 +0x1E01, 1.697 +0x1E02, 1.698 +0x1E03, 1.699 +0x150A, 1.700 +0x8507, 1.701 +0x8508, 1.702 +0x1F00, 1.703 +0x1F01, 1.704 +0x1F02, 1.705 +0x1F03, 1.706 +0x2600, 1.707 +0x2601, 1.708 +0x2700, 1.709 +0x2701, 1.710 +0x2702, 1.711 +0x2703, 1.712 +0x2800, 1.713 +0x2801, 1.714 +0x2802, 1.715 +0x2803, 1.716 +0x1702, 1.717 +0x8513, 1.718 +0x8514, 1.719 +0x8515, 1.720 +0x8516, 1.721 +0x8517, 1.722 +0x8518, 1.723 +0x8519, 1.724 +0x851A, 1.725 +0x851C, 1.726 +0x84C0, 1.727 +0x84C1, 1.728 +0x84C2, 1.729 +0x84C3, 1.730 +0x84C4, 1.731 +0x84C5, 1.732 +0x84C6, 1.733 +0x84C7, 1.734 +0x84C8, 1.735 +0x84C9, 1.736 +0x84CA, 1.737 +0x84CB, 1.738 +0x84CC, 1.739 +0x84CD, 1.740 +0x84CE, 1.741 +0x84CF, 1.742 +0x84D0, 1.743 +0x84D1, 1.744 +0x84D2, 1.745 +0x84D3, 1.746 +0x84D4, 1.747 +0x84D5, 1.748 +0x84D6, 1.749 +0x84D7, 1.750 +0x84D8, 1.751 +0x84D9, 1.752 +0x84DA, 1.753 +0x84DB, 1.754 +0x84DC, 1.755 +0x84DD, 1.756 +0x84DE, 1.757 +0x84DF, 1.758 +0x84E0, 1.759 +0x2901, 1.760 +0x812F, 1.761 +0x8370, 1.762 +0x8B50, 1.763 +0x8B51, 1.764 +0x8B52, 1.765 +0x8B53, 1.766 +0x8B54, 1.767 +0x8B55, 1.768 +0x8B56, 1.769 +0x8B57, 1.770 +0x8B58, 1.771 +0x8B59, 1.772 +0x8B5A, 1.773 +0x8B5B, 1.774 +0x8B5C, 1.775 +0x8B5E, 1.776 +0x8B60, 1.777 +0x8622, 1.778 +0x8623, 1.779 +0x8624, 1.780 +0x8625, 1.781 +0x886A, 1.782 +0x8645, 1.783 +0x889F, 1.784 +0x8B9A, 1.785 +0x8B9B, 1.786 +0x8B81, 1.787 +0x8B84, 1.788 +0x8B88, 1.789 +0x8DFA, 1.790 +0x8DF8, 1.791 +0x8DF9, 1.792 +0x8DF0, 1.793 +0x8DF1, 1.794 +0x8DF2, 1.795 +0x8DF3, 1.796 +0x8DF4, 1.797 +0x8DF5, 1.798 +0x8D40, 1.799 +0x8D41, 1.800 +0x8056, 1.801 +0x8057, 1.802 +0x8D62, 1.803 +0x81A5, 1.804 +0x1901, 1.805 +0x8D48, 1.806 +0x8D42, 1.807 +0x8D43, 1.808 +0x8D44, 1.809 +0x8D50, 1.810 +0x8D51, 1.811 +0x8D52, 1.812 +0x8D53, 1.813 +0x8D54, 1.814 +0x8D55, 1.815 +0x8CD0, 1.816 +0x8CD1, 1.817 +0x8CD2, 1.818 +0x8CD3, 1.819 +0x8CE0, 1.820 +0x8D00, 1.821 +0x8D20, 1.822 +0, 1.823 +0x8CD5, 1.824 +0x8CD6, 1.825 +0x8CD7, 1.826 +0x8CD9, 1.827 +0x8CDD, 1.828 +0x8CA6, 1.829 +0x8CA7, 1.830 +0x84E8, 1.831 +0x0506, 1.832 +0x809D 1.833 +]; 1.834 + 1.835 +function reportTestResultsToHarness(success, msg) { 1.836 + if (window.parent.webglTestHarness) { 1.837 + window.parent.webglTestHarness.reportResults(success, msg); 1.838 + } 1.839 +} 1.840 + 1.841 +function notifyFinishedToHarness() { 1.842 + if (window.parent.webglTestHarness) { 1.843 + window.parent.webglTestHarness.notifyFinished(); 1.844 + } 1.845 +} 1.846 + 1.847 +function initTests() { 1.848 + if (Tests.message != null) { 1.849 + var h = document.getElementById('test-message'); 1.850 + if (h == null) { 1.851 + h = document.createElement('p'); 1.852 + h.id = 'test-message'; 1.853 + document.body.insertBefore(h, document.body.firstChild); 1.854 + } 1.855 + h.textContent = Tests.message; 1.856 + } 1.857 + if (Tests.autorun) { 1.858 + runTests(); 1.859 + } else { 1.860 + var h = document.getElementById('test-run'); 1.861 + if (h == null) { 1.862 + h = document.createElement('input'); 1.863 + h.type = 'submit'; 1.864 + h.value = "Run tests"; 1.865 + h.addEventListener('click', function(ev){ 1.866 + runTests(); 1.867 + ev.preventDefault(); 1.868 + }, false); 1.869 + h.id = 'test-run'; 1.870 + document.body.insertBefore(h, document.body.firstChild); 1.871 + } 1.872 + h.textContent = Tests.message; 1.873 + } 1.874 + 1.875 +} 1.876 + 1.877 +window.addEventListener('load', function(){ 1.878 + // let the browser hopefully finish updating the gl canvas surfaces if we are given a delay 1.879 + if (Tests.delay) 1.880 + setTimeout(initTests, Tests.delay); 1.881 + else 1.882 + initTests() 1.883 +}, false); 1.884 +