Skip to content

Commit b116323

Browse files
authored
Test that JSPI works in chrome browser tests. (#19026)
1 parent 07af96a commit b116323

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ commands:
329329
# this flag for now: https://crbug.com/638180
330330
CHROME_FLAGS_BASE: "--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --user-data-dir=/tmp/chrome-emscripten-profile --enable-experimental-web-platform-features"
331331
CHROME_FLAGS_HEADLESS: "--headless --remote-debugging-port=1234"
332-
CHROME_FLAGS_WASM: "--enable-experimental-webassembly-features --js-flags=\"--experimental-wasm-memory64\""
332+
CHROME_FLAGS_WASM: "--enable-experimental-webassembly-features --js-flags=\"--experimental-wasm-memory64 --experimental-wasm-stack-switching --experimental-wasm-type-reflection\""
333333
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
334334
command: |
335335
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"

test/test_browser.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def no_firefox(note='firefox is not supported'):
149149
return lambda f: f
150150

151151

152+
def is_jspi(args):
153+
return '-sASYNCIFY=2' in args
154+
155+
152156
def no_swiftshader(f):
153157
assert callable(f)
154158

@@ -3320,10 +3324,17 @@ def test_cocos2d_hello(self):
33203324
'-Wno-inconsistent-missing-override',
33213325
'-Wno-deprecated-declarations'])
33223326

3323-
def test_async(self):
3327+
@parameterized({
3328+
'asyncify': (['-sASYNCIFY=1'],),
3329+
'jspi': (['-sASYNCIFY=2', '-Wno-experimental'],),
3330+
})
3331+
def test_async(self, args):
3332+
if is_jspi(args) and not is_chrome():
3333+
self.skipTest('only chrome supports jspi')
3334+
33243335
for opts in [0, 1, 2, 3]:
33253336
print(opts)
3326-
self.btest_exit('browser/async.cpp', args=['-O' + str(opts), '-g2', '-sASYNCIFY'])
3337+
self.btest_exit('browser/async.cpp', args=['-O' + str(opts), '-g2'] + args)
33273338

33283339
def test_asyncify_tricky_function_sig(self):
33293340
self.btest('browser/test_asyncify_tricky_function_sig.cpp', '85', args=['-sASYNCIFY_ONLY=[foo(char.const*?.int#),foo2(),main,__original_main]', '-sASYNCIFY'])

0 commit comments

Comments
 (0)