Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: LayoutTests/fast/canvas/webgl/array-large-array-tests.html

Issue 19230002: Use V8 implementation of TypedArrays and DataView in Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased for relanding Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
6 <script src="../../js/resources/js-test-pre.js"></script>
7 <script src="resources/webgl-test.js"></script>
8 <script src="resources/typed-array-test-cases.js"></script>
9 </head>
10 <body>
11 <div id="description"></div>
12 <div id="console"></div>
13
14 <script>
15 description("Verifies allocation of large array buffers");
16
17 var currentlyRunning = '';
18 var allPassed = true;
19 function running(str) {
20 currentlyRunning = str;
21 }
22
23 function output(str) {
24 debug(str);
25 }
26
27 function pass() {
28 testPassed(currentlyRunning);
29 }
30
31 function fail(str) {
32 allPassed = false;
33 var exc;
34 if (str)
35 exc = currentlyRunning + ': ' + str;
36 else
37 exc = currentlyRunning;
38 testFailed(exc);
39 }
40
41 function assertEq(prefix, expected, val) {
42 if (expected != val) {
43 var str = prefix + ': expected ' + expected + ', got ' + val;
44 throw str;
45 }
46 }
47
48 function assert(prefix, expected) {
49 if (!expected) {
50 var str = prefix + ': expected value / true';
51 throw str;
52 }
53 }
54
55 function printSummary() {
56 if (allPassed) {
57 debug("Test passed.");
58 } else {
59 debug("TEST FAILED");
60 }
61 }
62
63
64 function testConstructionOfHugeArray(type, name, sz) {
65 if (sz == 1)
66 return;
67 try {
68 // Construction of huge arrays must fail because byteLength is
69 // an unsigned long
70 array = new type(3000000000);
71 testFailed("Construction of huge " + name + " should throw exception");
72 } catch (e) {
73 testPassed("Construction of huge " + name + " threw exception");
74 }
75 }
76
77 function runTests() {
78 allPassed = true;
79
80 for (var i = 0; i < testCases.length; i++) {
81 var testCase = testCases[i];
82 running(testCase.name);
83 if (!(testCase.name in window)) {
84 fail("does not exist");
85 continue;
86 }
87 var type = window[testCase.name];
88 var name = testCase.name;
89 testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
90 }
91 }
92
93 runTests();
94 var successfullyParsed = true;
95
96 </script>
97 <script src="../../js/resources/js-test-post.js"></script>
98
99 </body>
100 </html>
101
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/webgl/array-large-array-tests-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698