blob: 5a759420cfdb9dafff61dc6531b562eed160c783 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="resources/webgl-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Verifies that the get method, and the set method for individual elements, on the WebGLArray types no longer exist.");
debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=38039">https://bugs.webkit.org/show_bug.cgi?id=38039</a>');
// Global scope so shouldThrow can see it
var webGLArray;
function negativeTestGetAndSetMethods(typeName) {
var type = window[typeName];
webGLArray = new type([2, 3]);
shouldBeUndefined("webGLArray.get");
var exceptionThrown = false;
// We deliberately check for an exception here rather than using
// shouldThrow here because the precise contents of the syntax
// error are not specified.
try {
webGLArray.set(0, 1);
} catch (e) {
exceptionThrown = true;
}
var output = "webGLArray.set(0, 1) ";
if (exceptionThrown) {
testPassed(output + "threw exception.");
} else {
testFailed(output + "did not throw exception.");
}
}
negativeTestGetAndSetMethods("Int8Array");
negativeTestGetAndSetMethods("Uint8Array");
negativeTestGetAndSetMethods("Int16Array");
negativeTestGetAndSetMethods("Uint16Array");
negativeTestGetAndSetMethods("Int32Array");
negativeTestGetAndSetMethods("Uint32Array");
negativeTestGetAndSetMethods("Float32Array");
</script>
</body>
</html>