aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-20 16:05:42 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-20 16:05:42 -0700
commit6db9f86c1e92d2fc8aaa2e1e05c02778811f2c25 (patch)
treea0ec920054379e88591a9a7e2625cd1592720147
parent6ee65ab31f3671c0dc44a44291b8a8084971ae9d (diff)
enable proxied version of test_gles2_uniform_arrays
-rw-r--r--tests/gles2_uniform_arrays.cpp22
-rw-r--r--tests/test_browser.py2
2 files changed, 16 insertions, 8 deletions
diff --git a/tests/gles2_uniform_arrays.cpp b/tests/gles2_uniform_arrays.cpp
index d1823b0b..0ae79c4a 100644
--- a/tests/gles2_uniform_arrays.cpp
+++ b/tests/gles2_uniform_arrays.cpp
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <emscripten.h>
void RunTest(int testVariant)
{
@@ -95,13 +96,20 @@ void RunTest(int testVariant)
glDrawArrays(GL_TRIANGLES, 0, 6);
- unsigned char pixel[4];
- glReadPixels(1,1,1,1,GL_RGBA,GL_UNSIGNED_BYTE, pixel);
- //printf("%d,%d,%d,%d\n", pixel[0], pixel[1], pixel[2], pixel[3]);
- assert(pixel[0] == 255);
- assert(pixel[1] == 178);
- assert(pixel[2] == 102);
- assert(pixel[3] == 255);
+ int in_worker = EM_ASM_INT_V({
+ return typeof importScripts !== 'undefined'
+ });
+
+ if (!in_worker) {
+ printf("Doing readpixels check\n");
+ unsigned char pixel[4];
+ glReadPixels(1,1,1,1,GL_RGBA,GL_UNSIGNED_BYTE, pixel);
+ //printf("%d,%d,%d,%d\n", pixel[0], pixel[1], pixel[2], pixel[3]);
+ assert(pixel[0] == 255);
+ assert(pixel[1] == 178);
+ assert(pixel[2] == 102);
+ assert(pixel[3] == 255);
+ }
printf("OK: Case %d passed.\n", testVariant);
// Lazy, don't clean up afterwards.
diff --git a/tests/test_browser.py b/tests/test_browser.py
index a50d55d9..7df3c054 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1470,7 +1470,7 @@ keydown(100);keyup(100); // trigger the end
self.btest('gl_vertex_buffer.c', reference='gl_vertex_buffer.png', args=['-s', 'GL_UNSAFE_OPTS=0', '-s', 'LEGACY_GL_EMULATION=1'], reference_slack=1)
def test_gles2_uniform_arrays(self):
- self.btest('gles2_uniform_arrays.cpp', args=['-s', 'GL_ASSERTIONS=1'], expected=['1'])
+ self.btest('gles2_uniform_arrays.cpp', args=['-s', 'GL_ASSERTIONS=1'], expected=['1'], also_proxied=True)
def test_gles2_conformance(self):
self.btest('gles2_conformance.cpp', args=['-s', 'GL_ASSERTIONS=1'], expected=['1'])