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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-large-texture.html

Issue 2447493002: Removed some duplicate layout tests under fast/canvas/webgl (Closed)
Patch Set: Created 4 years, 2 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
Index: third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-large-texture.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-large-texture.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-large-texture.html
deleted file mode 100644
index c79b9a1aa0364729749bb8ea094c41d769c198ff..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-large-texture.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Loading a large texture using texImage2D</title>
-<script src="../../../resources/js-test.js"></script>
-<script src="resources/webgl-test.js"></script>
-</head>
-
-<body>
-<canvas id="canvas" width="64" height="64"></canvas>
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-var successfullyParsed = false;
-
-function init()
-{
- if (window.initNonKhronosFramework)
- window.initNonKhronosFramework(true);
-
- if (window.internals)
- window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
-
- description('Test loading a large texture using texImage2D');
-
- runTest();
-}
-
-function andPixels(pixels32) {
- var pixelsAnd = 0xffffffff;
- for (var i = 0; i < pixels32.length; ++i) {
- pixelsAnd &= pixels32[i];
- }
- return pixelsAnd;
-}
-
-function runTest() {
- var width = 3900;
- var height = 3900;
-
- var canvas = document.getElementById('canvas');
- var gl = canvas.getContext('webgl');
-
- gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
-
- var texture = gl.createTexture();
- gl.bindTexture(gl.TEXTURE_2D, texture);
-
- var image = new Image();
- image.onerror = function (e) {
- testFailed('Image failed to load');
- }
- image.onload = function () {
- debug('Image width and height: ' + image.width + ', ' + image.height);
-
- if (image.width !== width || image.height !== height) {
- testFailed('Image did not have expected dimensions.');
- return;
- }
-
- var pixels = new ArrayBuffer(width * height * 4);
- var pixels8 = new Uint8Array(pixels);
- var pixels32 = new Uint32Array(pixels);
-
- if (width > gl.getParameter(gl.MAX_TEXTURE_SIZE) ||
- width > gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)) {
- // The image is allowed to be too big to be used as a texture.
- finishJSTest();
- return;
- }
-
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
- if (gl.getError() != gl.NO_ERROR) {
- // Loading the texture is allowed to fail due to resource constraints.
- finishJSTest();
- return;
- }
- var fb = gl.createFramebuffer();
- gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
- gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels8);
-
- // The image is filled with white, ignore last bit of each subpixel to account for decoding rounding differences.
- if ((andPixels(pixels32) & 0xfefefefe) !== (0xfefefefe | 0)) {
- testFailed('Texture was not loaded correctly.');
- }
-
- finishJSTest();
- }
- image.src = 'resources/white3900x3900.jpg';
-}
-
-init();
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698