@@ -1488,15 +1488,16 @@ def assert_out_queue_empty(self, who):
1488
1488
# synchronously, so we have a timeout, which can be hit if the VM
1489
1489
# we run on stalls temporarily), so we let each test try more than
1490
1490
# once by default
1491
- def run_browser (self , html_file , message , expectedResult = None , timeout = None , extra_tries = 1 ):
1491
+ def run_browser (self , html_file , expected = None , message = None , timeout = None , extra_tries = 1 ):
1492
1492
if not has_browser ():
1493
1493
return
1494
1494
if BrowserCore .unresponsive_tests >= BrowserCore .MAX_UNRESPONSIVE_TESTS :
1495
1495
self .skipTest ('too many unresponsive tests, skipping browser launch - check your setup!' )
1496
1496
self .assert_out_queue_empty ('previous test' )
1497
1497
if DEBUG :
1498
1498
print ('[browser launch:' , html_file , ']' )
1499
- if expectedResult is not None :
1499
+ assert not (message and expected ), 'run_browser expects `expected` or `message`, but not both'
1500
+ if expected is not None :
1500
1501
try :
1501
1502
self .harness_in_queue .put ((
1502
1503
'http://localhost:%s/%s' % (self .port , html_file ),
@@ -1526,12 +1527,12 @@ def run_browser(self, html_file, message, expectedResult=None, timeout=None, ext
1526
1527
# verify the result, and try again if we should do so
1527
1528
output = unquote (output )
1528
1529
try :
1529
- self .assertContained (expectedResult , output )
1530
+ self .assertContained (expected , output )
1530
1531
except Exception as e :
1531
1532
if extra_tries > 0 :
1532
1533
print ('[test error (see below), automatically retrying]' )
1533
1534
print (e )
1534
- return self .run_browser (html_file , message , expectedResult , timeout , extra_tries - 1 )
1535
+ return self .run_browser (html_file , message , expected , timeout , extra_tries - 1 )
1535
1536
else :
1536
1537
raise e
1537
1538
finally :
@@ -1693,7 +1694,7 @@ def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
1693
1694
1694
1695
def btest (self , filename , expected = None , reference = None ,
1695
1696
reference_slack = 0 , manual_reference = None , post_build = None ,
1696
- args = None , message = '.' , also_proxied = False ,
1697
+ args = None , also_proxied = False ,
1697
1698
url_suffix = '' , timeout = None , also_wasm2js = False ,
1698
1699
manually_trigger_reftest = False , extra_tries = 1 ,
1699
1700
reporting = Reporting .FULL ):
@@ -1729,13 +1730,13 @@ def btest(self, filename, expected=None, reference=None,
1729
1730
output = self .run_js ('test.js' )
1730
1731
self .assertContained ('RESULT: ' + expected [0 ], output )
1731
1732
else :
1732
- self .run_browser (outfile + url_suffix , message , ['/report_result?' + e for e in expected ], timeout = timeout , extra_tries = extra_tries )
1733
+ self .run_browser (outfile + url_suffix , expected = ['/report_result?' + e for e in expected ], timeout = timeout , extra_tries = extra_tries )
1733
1734
1734
1735
# Tests can opt into being run under asmjs as well
1735
1736
if 'WASM=0' not in original_args and (also_wasm2js or self .also_wasm2js ):
1736
1737
print ('WASM=0' )
1737
1738
self .btest (filename , expected , reference , reference_slack , manual_reference , post_build ,
1738
- original_args + ['-sWASM=0' ], message , also_proxied = False , timeout = timeout )
1739
+ original_args + ['-sWASM=0' ], also_proxied = False , timeout = timeout )
1739
1740
1740
1741
if also_proxied :
1741
1742
print ('proxied...' )
@@ -1746,7 +1747,7 @@ def btest(self, filename, expected=None, reference=None,
1746
1747
post_build = self .post_manual_reftest
1747
1748
# run proxied
1748
1749
self .btest (filename , expected , reference , reference_slack , manual_reference , post_build ,
1749
- original_args + ['--proxy-to-worker' , '-sGL_TESTING' ], message , timeout = timeout )
1750
+ original_args + ['--proxy-to-worker' , '-sGL_TESTING' ], timeout = timeout )
1750
1751
1751
1752
1752
1753
###################################################################################################
0 commit comments