mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
104 lines
3.7 KiB
HTML
104 lines
3.7 KiB
HTML
<!--
|
|
Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions are
|
|
met:
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
notice, this list of conditions and the following disclaimer.
|
|
* Redistributions in binary form must reproduce the above
|
|
copyright notice, this list of conditions and the following disclaimer
|
|
in the documentation and/or other materials provided with the
|
|
distribution.
|
|
* Neither the name of Google Inc. nor the names of its
|
|
contributors may be used to endorse or promote products derived from
|
|
this software without specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
-->
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="../resources/js-test-style.css"/>
|
|
<script src="../resources/js-test-pre.js"></script>
|
|
<script src="resources/webgl-test.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="description"></div>
|
|
<div id="console"></div>
|
|
|
|
<script>
|
|
|
|
description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32456">https://bugs.webkit.org/show_bug.cgi?id=32456</a> : <code>Errors in WebGL[T]Array set() and get() methods</code>');
|
|
|
|
debug("Testing WebGLFloatArray get / set");
|
|
var array = new WebGLFloatArray([1.5]);
|
|
shouldBe("array.get(0)", "1.5");
|
|
shouldBe("array[0]", "1.5");
|
|
shouldBeUndefined("array.set(0, 2.5)");
|
|
shouldBe("array.get(0)", "2.5");
|
|
shouldBe("array[0]", "2.5");
|
|
|
|
debug("Testing WebGLByteArray get / set");
|
|
array = new WebGLByteArray(1);
|
|
shouldBeUndefined("array.set(0, 127)");
|
|
shouldBe("array.get(0)", "127");
|
|
shouldBe("array[0]", "127");
|
|
shouldBeUndefined("array.set(0, -128)");
|
|
shouldBe("array.get(0)", "-128");
|
|
shouldBe("array[0]", "-128");
|
|
|
|
debug("Testing WebGLUnsignedByteArray get / set");
|
|
array = new WebGLUnsignedByteArray(1);
|
|
shouldBeUndefined("array.set(0, 255)");
|
|
shouldBe("array.get(0)", "255");
|
|
shouldBe("array[0]", "255");
|
|
|
|
debug("Testing WebGLShortArray get / set");
|
|
array = new WebGLShortArray(1);
|
|
shouldBeUndefined("array.set(0, 32767)");
|
|
shouldBe("array.get(0)", "32767");
|
|
shouldBe("array[0]", "32767");
|
|
shouldBeUndefined("array.set(0, -32768)");
|
|
shouldBe("array.get(0)", "-32768");
|
|
shouldBe("array[0]", "-32768");
|
|
|
|
debug("Testing WebGLUnsignedShortArray get / set");
|
|
array = new WebGLUnsignedShortArray(1);
|
|
shouldBeUndefined("array.set(0, 65535)");
|
|
shouldBe("array.get(0)", "65535");
|
|
shouldBe("array[0]", "65535");
|
|
|
|
debug("Testing WebGLIntArray get / set");
|
|
array = new WebGLIntArray(1);
|
|
shouldBeUndefined("array.set(0, -2147483648)");
|
|
shouldBe("array.get(0)", "-2147483648");
|
|
shouldBe("array[0]", "-2147483648");
|
|
shouldBeUndefined("array.set(0, 2147483647)");
|
|
shouldBe("array.get(0)", "2147483647");
|
|
shouldBe("array[0]", "2147483647");
|
|
|
|
debug("Testing WebGLUnsignedIntArray get / set");
|
|
array = new WebGLUnsignedIntArray(1);
|
|
shouldBeUndefined("array.set(0, 4294967295)");
|
|
shouldBe("array.get(0)", "4294967295");
|
|
shouldBe("array[0]", "4294967295");
|
|
|
|
successfullyParsed = true;
|
|
|
|
</script>
|
|
<script src="../resources/js-test-post.js"></script>
|
|
|
|
</body>
|
|
</html>
|