<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161996] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161996">161996</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-01-14 12:52:50 -0800 (Tue, 14 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore: [WebGL] Invalid range checking in WebGLRenderingContext::validateTexFuncLevel
https://bugs.webkit.org/show_bug.cgi?id=126925

Reviewed by Dean Jackson.

Added fast/canvas/webgl/webgl-compressed-texture-size-limit.html.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateTexFuncLevel): Avoid off-by-one error

LayoutTests: [WebGL] Invalid range checking in WebGLRenderContext::validateTexFunctionLevel
https://bugs.webkit.org/show_bug.cgi?id=126925

Reviewed by Dean Jackson.

* fast/canvas/webgl/resources/webgl-test-utils.js:
(WebGLTestUtils): Add missing 'waitForComposite' implementatino.
* fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt: Added.
* fast/canvas/webgl/webgl-compressed-texture-size-limit.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglresourceswebgltestutilsjs">trunk/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcanvaswebglwebglcompressedtexturesizelimitexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebglwebglcompressedtexturesizelimithtml">trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161995 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-14 20:28:23 UTC (rev 161995)
+++ trunk/LayoutTests/ChangeLog        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-01-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [WebGL] Invalid range checking in WebGLRenderContext::validateTexFunctionLevel
+        https://bugs.webkit.org/show_bug.cgi?id=126925
+
+        Reviewed by Dean Jackson.
+
+        * fast/canvas/webgl/resources/webgl-test-utils.js:
+        (WebGLTestUtils): Add missing 'waitForComposite' implementatino.
+        * fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt: Added.
+        * fast/canvas/webgl/webgl-compressed-texture-size-limit.html: Added.
+
</ins><span class="cx"> 2014-01-14  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r161978.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglresourceswebgltestutilsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js (161995 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js        2014-01-14 20:28:23 UTC (rev 161995)
+++ trunk/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -1312,6 +1312,23 @@
</span><span class="cx">   countDown();
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+/**
+ * Waits for the browser to composite the canvas associated with
+ * the WebGL context passed in.
+ */
+var waitForComposite = function(gl, callback) {
+  var frames = 5;
+  var countDown = function() {
+    if (frames == 0) {
+      callback();
+    } else {
+      --frames;
+      requestAnimFrame(countDown);
+    }
+  };
+  countDown();
+};
+
</ins><span class="cx"> return {
</span><span class="cx">   cancelAnimFrame: cancelAnimFrame,
</span><span class="cx">   create3DContext: create3DContext,
</span><span class="lines">@@ -1364,6 +1381,7 @@
</span><span class="cx">   readFileList: readFileList,
</span><span class="cx">   requestAnimFrame: requestAnimFrame,
</span><span class="cx">   waitFrames: waitFrames,
</span><ins>+  waitForComposite: waitForComposite,
</ins><span class="cx"> 
</span><span class="cx">   none: false
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglwebglcompressedtexturesizelimitexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt (0 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit-expected.txt        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -0,0 +1,496 @@
</span><ins>+Checks size limit of the webgl compressed textures
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+num levels: 14, levels used in positive test: 14
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_2D
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 12
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 13
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 14
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_2D
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 12
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 13
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 14
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_2D
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 12
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 13
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 14
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_2D
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 12
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 13
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 12
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_CUBE_MAP_POSITIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 12
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_CUBE_MAP_POSITIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 12
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_CUBE_MAP_POSITIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+num levels: 14, levels used in positive test: 12
+
+PASS Successfully enabled WEBGL_compressed_texture_s3tc extension
+
+TEXTURE_CUBE_MAP_POSITIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_X
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Y
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_POSITIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+
+TEXTURE_CUBE_MAP_NEGATIVE_Z
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 0
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 1
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 2
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 3
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 4
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 5
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 6
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 7
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 8
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 9
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 10
+PASS getError was expected value: NO_ERROR : uploading compressed texture should generate NO_ERROR. level is 11
+PASS getError was expected value: INVALID_VALUE : width or height out of bounds for level 0: should generate INVALID_VALUE.
+PASS getError was expected value: INVALID_VALUE : level out of bounds: should generate INVALID_VALUE. Size is 256x256
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebglwebglcompressedtexturesizelimithtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit.html (0 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit.html                                (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/webgl-compressed-texture-size-limit.html        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -0,0 +1,260 @@
</span><ins>+
+&lt;!--
+
+/*
+** Copyright (c) 2013 The Khronos Group Inc.
+** Copyright (c) 2013 Apple Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** &quot;Materials&quot;), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+--&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test-utils.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;script&gt;
+function init()
+{
+&quot;use strict&quot;;
+description(&quot;Checks size limit of the webgl compressed textures&quot;)
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
+
+var canvas;
+
+function numLevelsFromSize(size) {
+  var levels = 0;
+  while ((size &gt;&gt; levels) &gt; 0) {
+    ++levels;
+  }
+  return levels;
+}
+
+// More formats can be added here when more texture compression extensions are enabled in WebGL.
+var validFormats = {
+    COMPRESSED_RGB_S3TC_DXT1_EXT        : 0x83F0,
+    COMPRESSED_RGBA_S3TC_DXT1_EXT       : 0x83F1,
+    COMPRESSED_RGBA_S3TC_DXT3_EXT       : 0x83F2,
+    COMPRESSED_RGBA_S3TC_DXT5_EXT       : 0x83F3,
+};
+
+// format specific restrictions for COMPRESSED_RGB_S3TC_DXT1_EXT and COMPRESSED_RGBA_S3TC_DXT1_EXT
+// on the byteLength of the ArrayBufferView, pixels
+function func1 (width, height)
+{
+    return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+}
+
+// format specific restrictions for COMPRESSED_RGBA_S3TC_DXT3_EXT and COMPRESSED_RGBA_S3TC_DXT5_EXT
+// on the byteLength of the ArrayBufferView, pixels
+function func2 (width, height)
+{
+    return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;
+}
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext(&quot;example&quot;);
+var tests = [
+  // More tests can be added here when more texture compression extensions are enabled in WebGL.
+  // Level 0 image width and height must be a multiple of the sizeStep.
+  { extension: &quot;WEBGL_compressed_texture_s3tc&quot;, format: validFormats.COMPRESSED_RGB_S3TC_DXT1_EXT, dataType: Uint8Array, func: func1, sizeStep: 4},
+  { extension: &quot;WEBGL_compressed_texture_s3tc&quot;, format: validFormats.COMPRESSED_RGBA_S3TC_DXT1_EXT, dataType: Uint8Array, func: func1, sizeStep: 4},
+  { extension: &quot;WEBGL_compressed_texture_s3tc&quot;, format: validFormats.COMPRESSED_RGBA_S3TC_DXT3_EXT, dataType: Uint8Array, func: func2, sizeStep: 4},
+  { extension: &quot;WEBGL_compressed_texture_s3tc&quot;, format: validFormats.COMPRESSED_RGBA_S3TC_DXT5_EXT, dataType: Uint8Array, func: func2, sizeStep: 4},
+];
+
+// Note: We expressly only use 2 textures because first a texture will be defined
+// using all mip levels of 1 format, then for a moment it will have mixed formats which
+// may uncover bugs.
+var targets = [
+  { target: gl.TEXTURE_2D,
+    maxSize: gl.getParameter(gl.MAX_TEXTURE_SIZE),
+    tex: gl.createTexture(),
+    targets: [gl.TEXTURE_2D]
+  },
+  { target: gl.TEXTURE_CUBE_MAP,
+    maxSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE),
+    tex: gl.createTexture(),
+    targets: [
+      gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+      gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+      gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+      gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+      gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
+      gl.TEXTURE_CUBE_MAP_NEGATIVE_Z
+    ]
+  }
+];
+
+function getSharedArrayBufferSize() {
+  var sharedArrayBufferSize = 0;
+  for (var tt = 0; tt &lt; tests.length; ++tt) {
+    var test = tests[tt];
+    for (var trg = 0; trg &lt; targets.length; ++trg) {
+      var t = targets[trg];
+      var bufferSizeNeeded;
+      if (t.target === gl.TEXTURE_CUBE_MAP) {
+        var positiveTestSize = Math.min(2048, t.maxSize);
+        bufferSizeNeeded = test.func(positiveTestSize, positiveTestSize);
+      } else {
+        bufferSizeNeeded = test.func(t.maxSize, test.sizeStep);
+      }
+      if (bufferSizeNeeded &gt; sharedArrayBufferSize) {
+        sharedArrayBufferSize = bufferSizeNeeded;
+      }
+      bufferSizeNeeded = test.func(t.maxSize + test.sizeStep, t.maxSize + test.sizeStep);
+      // ArrayBuffers can be at most 4GB (minus 1 byte)
+      if (bufferSizeNeeded &gt; sharedArrayBufferSize &amp;&amp; bufferSizeNeeded &lt;= 4294967295) {
+        sharedArrayBufferSize = bufferSizeNeeded;
+      }
+    }
+  }
+  return sharedArrayBufferSize;
+}
+
+// Share an ArrayBuffer among tests to avoid too many large allocations
+var sharedArrayBuffer = new ArrayBuffer(getSharedArrayBufferSize());
+
+gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+var trg = 0;
+var tt = 0;
+runNextTest();
+
+function runNextTest() {
+  var t = targets[trg];
+
+  if (tt == 0) {
+    var tex = t.tex;
+    gl.bindTexture(t.target, tex);
+
+    //debug(&quot;&quot;);
+    //debug(&quot;max size for &quot; + wtu.glEnumToString(gl, t.target) + &quot;: &quot; + t.maxSize);
+  }
+
+  var test = tests[tt];
+  testFormatType(t, test);
+  ++tt;
+  if (tt == tests.length) {
+    tt = 0;
+    ++trg;
+    if (trg == targets.length) {
+      finishTest();
+      return;
+    }
+  }
+  wtu.waitForComposite(gl, runNextTest)
+}
+
+function testFormatType(t, test) {
+  var positiveTestSize = t.maxSize;
+  var positiveTestOtherDimension = test.sizeStep;
+  if (t.target === gl.TEXTURE_CUBE_MAP) {
+    // Can't always test the maximum size since that can cause OOM:
+    positiveTestSize = Math.min(2048, t.maxSize);
+    // Cube map textures need to be square:
+    positiveTestOtherDimension = positiveTestSize;
+  }
+  var positiveTestLevels = Math.min(14, numLevelsFromSize(positiveTestSize));
+  var numLevels = Math.min(14, numLevelsFromSize(t.maxSize));
+  debug(&quot;&quot;);
+  debug(&quot;num levels: &quot; + numLevels + &quot;, levels used in positive test: &quot; + positiveTestLevels);
+
+  debug(&quot;&quot;);
+
+  // Query the extension and store globally so shouldBe can access it
+  var ext = wtu.getExtensionWithKnownPrefixes(gl, test.extension);
+  if (ext) {
+
+    testPassed(&quot;Successfully enabled &quot; + test.extension + &quot; extension&quot;);
+
+    for (var j = 0; j &lt; t.targets.length; ++j) {
+      var target = t.targets[j];
+      debug(&quot;&quot;);
+      debug(wtu.glEnumToString(gl, target));
+
+      // positive test
+      var size = positiveTestSize;
+      var otherDimension = positiveTestOtherDimension;
+      for (var i = 0; i &lt; positiveTestLevels; i++) {
+        var pixels = new test.dataType(sharedArrayBuffer, 0, test.func(size, otherDimension));
+        gl.compressedTexImage2D(target, i, test.format, size, otherDimension, 0, pixels);
+        wtu.glErrorShouldBe(gl, gl.NO_ERROR, &quot;uploading compressed texture should generate NO_ERROR. level is &quot; + i);
+        //debug(&quot;level is &quot; + i + &quot;, size is &quot; + size + &quot;x&quot; + otherDimension);
+        size /= 2;
+        otherDimension /= 2;
+        if (otherDimension &lt; 1) {
+            otherDimension = 1;
+        }
+      }
+
+      var numLevels =  Math.min(14, numLevelsFromSize(t.maxSize));
+
+      // out of bounds tests
+      // width and height out of bounds
+      var dataSize = test.func(t.maxSize + test.sizeStep, t.maxSize + test.sizeStep);
+      // this check assumes that each element is 1 byte
+      if (dataSize &gt; sharedArrayBuffer.byteLength) {
+        testPassed(&quot;Unable to test texture larger than maximum size due to ArrayBuffer size limitations -- this is legal&quot;);
+      } else {
+        var pixelsNegativeTest1 = new test.dataType(sharedArrayBuffer, 0, dataSize);
+        gl.compressedTexImage2D(target, 0, test.format, t.maxSize + test.sizeStep, t.maxSize + test.sizeStep, 0, pixelsNegativeTest1);
+        wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, &quot;width or height out of bounds for level 0: should generate INVALID_VALUE.&quot;);
+        //debug(&quot;Level is 0, size is &quot; + (t.maxSize + test.sizeStep) + &quot;x&quot; + (t.maxSize + test.sizeStep));
+      }
+      // level out of bounds
+      var pixelsNegativeTest2 = new test.dataType(sharedArrayBuffer, 0, test.func(256, 256));
+      var totalLevelCount = numLevelsFromSize(t.maxSize); // I.e., one more than we can actually support.
+      gl.compressedTexImage2D(target, totalLevelCount, test.format, 256, 256, 0, pixelsNegativeTest2);
+      wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, &quot;level out of bounds: should generate INVALID_VALUE. Size is 256x256&quot;);
+      //debug(&quot;Level tried was &quot; + totalLevelCount);
+
+      /* This section disabled for now: See https://bugs.webkit.org/show_bug.cgi?id=126926
+      //width and height out of bounds for specified level
+      gl.compressedTexImage2D(target, numLevels - 1, test.format, 256, 256, 0, pixelsNegativeTest2);
+      wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, &quot;width or height out of bounds for specified level: should generate INVALID_VALUE.&quot;
+          + &quot; level is &quot; + (numLevels - 1) + &quot;, size is 256x256&quot;);
+      */
+    }
+  }
+  else
+    testPassed(&quot;No &quot; + test.extension + &quot; extension support -- this is legal&quot;);
+}
+}
+
+var successfullyParsed = true;
+&lt;/script&gt;
+&lt;body onload=&quot;init()&quot;&gt;
+&lt;canvas id=&quot;example&quot; width=&quot;32&quot; height=&quot;32&quot; style=&quot;width: 40px; height: 40px;&quot;&gt;&lt;/canvas&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161995 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-14 20:28:23 UTC (rev 161995)
+++ trunk/Source/WebCore/ChangeLog        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-01-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [WebGL] Invalid range checking in WebGLRenderingContext::validateTexFuncLevel
+        https://bugs.webkit.org/show_bug.cgi?id=126925
+
+        Reviewed by Dean Jackson.
+
+        Added fast/canvas/webgl/webgl-compressed-texture-size-limit.html.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::validateTexFuncLevel): Avoid off-by-one error
+
</ins><span class="cx"> 2014-01-14  Mark Rowe  &lt;mrowe@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebCore icon database appears to leak sudden termination assertions
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (161995 => 161996)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2014-01-14 20:28:23 UTC (rev 161995)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2014-01-14 20:52:50 UTC (rev 161996)
</span><span class="lines">@@ -5144,7 +5144,7 @@
</span><span class="cx">     }
</span><span class="cx">     switch (target) {
</span><span class="cx">     case GraphicsContext3D::TEXTURE_2D:
</span><del>-        if (level &gt; m_maxTextureLevel) {
</del><ins>+        if (level &gt;= m_maxTextureLevel) {
</ins><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;level out of range&quot;);
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="lines">@@ -5155,7 +5155,7 @@
</span><span class="cx">     case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:
</span><span class="cx">     case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
</span><span class="cx">     case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
</span><del>-        if (level &gt; m_maxCubeMapTextureLevel) {
</del><ins>+        if (level &gt;= m_maxCubeMapTextureLevel) {
</ins><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, &quot;level out of range&quot;);
</span><span class="cx">             return false;
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>