Skip to content

Commit aac3c87

Browse files
authored
Add browser test for SOURCE_PHASE_IMPORTS. NFC (#24667)
This feature is now available in chrome 139.0.7251.0.
1 parent 7708975 commit aac3c87

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ commands:
317317
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
318318
# --no-sandbox because we are running as root and chrome requires
319319
# this flag for now: https://crbug.com/638180
320-
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"
320+
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 --enable-features=JavaScriptSourcePhaseImports"
321321
# Increase the window size to avoid flaky sdl tests see #24236.
322322
CHROME_FLAGS_HEADLESS: "--headless=new --window-size=1024,768 --remote-debugging-port=1234"
323323
CHROME_FLAGS_WASM: "--enable-experimental-webassembly-features --js-flags=\"--experimental-wasm-stack-switching --experimental-wasm-type-reflection\""

test/test_browser.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,6 +3424,17 @@ def test_modularize(self, args, code, opts):
34243424
''' % code)
34253425
self.run_browser('a.html', '/report_result?0')
34263426

3427+
@no_firefox('source phase imports not implemented yet in firefox')
3428+
def test_source_phase_imports(self):
3429+
self.compile_btest('browser_test_hello_world.c', ['-sEXPORT_ES6', '-sSOURCE_PHASE_IMPORTS', '-Wno-experimental', '-o', 'out.mjs'])
3430+
create_file('a.html', '''
3431+
<script type="module">
3432+
import Module from "./out.mjs"
3433+
const mod = await Module();
3434+
</script>
3435+
''')
3436+
self.run_browser('a.html', '/report_result?0')
3437+
34273438
def test_modularize_network_error(self):
34283439
self.compile_btest('browser_test_hello_world.c', ['-sMODULARIZE', '-sEXPORT_NAME=createModule'], reporting=Reporting.NONE)
34293440
shutil.copy(test_file('browser_reporting.js'), '.')

0 commit comments

Comments
 (0)