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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/webgl/array-large-array-tests-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/webgl/array-large-array-tests.html
diff --git a/LayoutTests/fast/canvas/webgl/array-large-array-tests.html b/LayoutTests/fast/canvas/webgl/array-large-array-tests.html
new file mode 100644
index 0000000000000000000000000000000000000000..0d63287dcda77303a99e9b0f57a2e8a7fb2767af
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/array-large-array-tests.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/typed-array-test-cases.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+description("Verifies allocation of large array buffers");
+
+var currentlyRunning = '';
+var allPassed = true;
+function running(str) {
+ currentlyRunning = str;
+}
+
+function output(str) {
+ debug(str);
+}
+
+function pass() {
+ testPassed(currentlyRunning);
+}
+
+function fail(str) {
+ allPassed = false;
+ var exc;
+ if (str)
+ exc = currentlyRunning + ': ' + str;
+ else
+ exc = currentlyRunning;
+ testFailed(exc);
+}
+
+function assertEq(prefix, expected, val) {
+ if (expected != val) {
+ var str = prefix + ': expected ' + expected + ', got ' + val;
+ throw str;
+ }
+}
+
+function assert(prefix, expected) {
+ if (!expected) {
+ var str = prefix + ': expected value / true';
+ throw str;
+ }
+}
+
+function printSummary() {
+ if (allPassed) {
+ debug("Test passed.");
+ } else {
+ debug("TEST FAILED");
+ }
+}
+
+
+function testConstructionOfHugeArray(type, name, sz) {
+ if (sz == 1)
+ return;
+ try {
+ // Construction of huge arrays must fail because byteLength is
+ // an unsigned long
+ array = new type(3000000000);
+ testFailed("Construction of huge " + name + " should throw exception");
+ } catch (e) {
+ testPassed("Construction of huge " + name + " threw exception");
+ }
+}
+
+function runTests() {
+ allPassed = true;
+
+ for (var i = 0; i < testCases.length; i++) {
+ var testCase = testCases[i];
+ running(testCase.name);
+ if (!(testCase.name in window)) {
+ fail("does not exist");
+ continue;
+ }
+ var type = window[testCase.name];
+ var name = testCase.name;
+ testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
+ }
+}
+
+runTests();
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+
+</body>
+</html>
+
« 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