@@ -1584,7 +1584,11 @@ def test_egl_width_height(self, args):
1584
1584
def test_egl_createcontext_error (self ):
1585
1585
self .btest_exit ('test_egl_createcontext_error.c' , args = ['-lEGL' , '-lGL' ])
1586
1586
1587
- def test_worker (self ):
1587
+ @parameterized ({
1588
+ '' : ([False ],),
1589
+ 'preload' : ([True ],),
1590
+ })
1591
+ def test_hello_world_worker (self , file_data ):
1588
1592
# Test running in a web worker
1589
1593
create_file ('file.dat' , 'data for worker' )
1590
1594
create_file ('main.html' , '''
@@ -1602,13 +1606,12 @@ def test_worker(self):
1602
1606
</html>
1603
1607
''' % self .port )
1604
1608
1605
- for file_data in (1 , 0 ):
1606
- cmd = [EMCC , test_file ('hello_world_worker.cpp' ), '-o' , 'worker.js' ] + self .get_emcc_args ()
1607
- if file_data :
1608
- cmd += ['--preload-file' , 'file.dat' ]
1609
- self .run_process (cmd )
1610
- self .assertExists ('worker.js' )
1611
- self .run_browser ('main.html' , '/report_result?hello from worker, and :' + ('data for w' if file_data else '' ) + ':' )
1609
+ cmd = [EMCC , test_file ('hello_world_worker.c' ), '-o' , 'worker.js' ] + self .get_emcc_args ()
1610
+ if file_data :
1611
+ cmd += ['--preload-file' , 'file.dat' ]
1612
+ self .run_process (cmd )
1613
+ self .assertExists ('worker.js' )
1614
+ self .run_browser ('main.html' , '/report_result?hello from worker, and :' + ('data for w' if file_data else '' ) + ':' )
1612
1615
1613
1616
# code should run standalone too
1614
1617
# To great memories >4gb we need the canary version of node
0 commit comments