Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / array-large-array-tests.html
blob65d89cff7fdd61ce2b78de418966db63e7e97461
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../../../resources/js-test.js"></script>
6 <script src="resources/webgl-test.js"></script>
7 <script src="resources/typed-array-test-cases.js"></script>
8 </head>
9 <body>
10 <div id="description"></div>
11 <div id="console"></div>
13 <script>
14 description("Verifies allocation of large array buffers");
16 var currentlyRunning = '';
17 var allPassed = true;
18 function running(str) {
19 currentlyRunning = str;
22 function output(str) {
23 debug(str);
26 function pass() {
27 testPassed(currentlyRunning);
30 function fail(str) {
31 allPassed = false;
32 var exc;
33 if (str)
34 exc = currentlyRunning + ': ' + str;
35 else
36 exc = currentlyRunning;
37 testFailed(exc);
40 function assertEq(prefix, expected, val) {
41 if (expected != val) {
42 var str = prefix + ': expected ' + expected + ', got ' + val;
43 throw str;
47 function assert(prefix, expected) {
48 if (!expected) {
49 var str = prefix + ': expected value / true';
50 throw str;
54 function printSummary() {
55 if (allPassed) {
56 debug("Test passed.");
57 } else {
58 debug("TEST FAILED");
63 function testConstructionOfHugeArray(type, name, sz) {
64 if (sz == 1)
65 return;
66 try {
67 // Construction of huge arrays must fail because byteLength is
68 // an unsigned long
69 array = new type(3000000000);
70 testFailed("Construction of huge " + name + " should throw exception");
71 } catch (e) {
72 testPassed("Construction of huge " + name + " threw exception");
76 function runTests() {
77 allPassed = true;
79 for (var i = 0; i < testCases.length; i++) {
80 var testCase = testCases[i];
81 running(testCase.name);
82 if (!(testCase.name in window)) {
83 fail("does not exist");
84 continue;
86 var type = window[testCase.name];
87 var name = testCase.name;
88 testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
92 runTests();
93 var successfullyParsed = true;
95 </script>
97 </body>
98 </html>