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

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

Issue 1601093008: Remove duplicated WebGL layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 <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>
12
13 <script>
14 description("Verifies allocation of large array buffers");
15
16 var currentlyRunning = '';
17 var allPassed = true;
18 function running(str) {
19 currentlyRunning = str;
20 }
21
22 function output(str) {
23 debug(str);
24 }
25
26 function pass() {
27 testPassed(currentlyRunning);
28 }
29
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);
38 }
39
40 function assertEq(prefix, expected, val) {
41 if (expected != val) {
42 var str = prefix + ': expected ' + expected + ', got ' + val;
43 throw str;
44 }
45 }
46
47 function assert(prefix, expected) {
48 if (!expected) {
49 var str = prefix + ': expected value / true';
50 throw str;
51 }
52 }
53
54 function printSummary() {
55 if (allPassed) {
56 debug("Test passed.");
57 } else {
58 debug("TEST FAILED");
59 }
60 }
61
62
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");
73 }
74 }
75
76 function runTests() {
77 allPassed = true;
78
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;
85 }
86 var type = window[testCase.name];
87 var name = testCase.name;
88 testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
89 }
90 }
91
92 runTests();
93 var successfullyParsed = true;
94
95 </script>
96
97 </body>
98 </html>
99
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698