Skip to content

Commit ab6e3ee

Browse files
authored
test: Add Opera & Edge to list of JSPI-supporting browsers (#19291)
Opera and Edge are Chromium-based, so they also support JSPI (since O96). Use the current simple detection algorithm based on executable full path part pattern detection, but extend it with a new pattern for Opera and Edge. Also, print the available options for running test_async when a JSPI-capable browser was not provided.
1 parent a0d43fc commit ab6e3ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/test_browser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ def shell_with_script(shell_file, output_file, replacement):
149149
create_file(output_file, shell.replace('{{{ SCRIPT }}}', replacement))
150150

151151

152+
CHROMIUM_BASED_BROWSERS = ['chrom', 'edge', 'opera']
153+
154+
152155
def is_chrome():
153-
return EMTEST_BROWSER and 'chrom' in EMTEST_BROWSER.lower()
156+
return EMTEST_BROWSER and any(pattern in EMTEST_BROWSER.lower() for pattern in CHROMIUM_BASED_BROWSERS)
154157

155158

156159
def no_chrome(note='chrome is not supported'):
@@ -3350,7 +3353,7 @@ def test_cocos2d_hello(self):
33503353
})
33513354
def test_async(self, args):
33523355
if is_jspi(args) and not is_chrome():
3353-
self.skipTest('only chrome supports jspi')
3356+
self.skipTest(f'Current browser ({EMTEST_BROWSER}) does not support JSPI. Only chromium-based browsers ({CHROMIUM_BASED_BROWSERS}) support JSPI today.')
33543357

33553358
for opts in [0, 1, 2, 3]:
33563359
print(opts)

0 commit comments

Comments
 (0)