diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-01 15:15:50 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-06 11:08:04 -0500 |
commit | 88c6cb7612c472f2efc3a94c44e05c6115232e67 (patch) | |
tree | 6d15fd4341ecaf1d90de95dc8c30c36c3dfc9c2f /tests | |
parent | 78a230ab665daad0fe11d40bdaca1c995fbe9add (diff) |
Disable WebGL if typed arrays are not being used.
This fixes issue #195
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hello_world_gles_shell.html | 6 | ||||
-rwxr-xr-x | tests/runner.py | 21 |
2 files changed, 15 insertions, 12 deletions
diff --git a/tests/hello_world_gles_shell.html b/tests/hello_world_gles_shell.html index 7f0b2013..d3429e3a 100644 --- a/tests/hello_world_gles_shell.html +++ b/tests/hello_world_gles_shell.html @@ -25,9 +25,6 @@ canvas: document.getElementById('canvas') }; - // The compiled code - {{{ SCRIPT_CODE }}} - // Test code function simulateKeyEvent(keyCode) { var event = document.createEvent("KeyboardEvent"); @@ -50,6 +47,9 @@ }, 0); } addEventListener("load", doTest, false); + + // The compiled code + {{{ SCRIPT_CODE }}} </script> </body> </html> diff --git a/tests/runner.py b/tests/runner.py index a1fa8690..4eb085ff 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -5645,16 +5645,8 @@ f.close() class TestServerHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): assert s.path == expectedResult, 'Expected %s, got %s' % (expectedResult, s.path) - httpd.shutdown() - def handle_timeout(): - assert False, 'Timed out while waiting for the browser test to finish' - httpd.shutdown() httpd = BaseHTTPServer.HTTPServer(('localhost', 8888), TestServerHandler) - httpd.timeout = 5; - server_thread = threading.Thread(target=httpd.serve_forever) - server_thread.daemon = True - server_thread.start() - server_thread.join(5.5) + httpd.handle_request() # Finally, do some web browser tests def run_browser(html_file, message, expectedResult = None): @@ -5707,6 +5699,17 @@ f.close() assert os.path.exists('something.html'), output run_browser('something.html', 'You should see animating gears.', '/report_gl_result?true') + # Make sure that OpenGL ES is not available if typed arrays are not used + clear() + output = Popen([EMCC, path_from_root('tests', 'hello_world_gles.c'), '-o', 'something.html', + '-DHAVE_BUILTIN_SINCOS', + '-s', 'USE_TYPED_ARRAYS=0', + '--shell-file', path_from_root('tests', 'hello_world_gles_shell.html')], + stdout=PIPE, stderr=PIPE).communicate() + assert len(output[0]) == 0, output[0] + assert os.path.exists('something.html'), output + run_browser('something.html', 'You should not see animating gears.', '/report_gl_result?false') + def test_eliminator(self): input = open(path_from_root('tools', 'eliminator', 'eliminator-test.js')).read() expected = open(path_from_root('tools', 'eliminator', 'eliminator-test-output.js')).read() |