Skip to content

Commit da2d454

Browse files
committed
fix missing APIs for multithreaded tests in GH actions
1 parent 58fccc8 commit da2d454

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/CI.yml

+27-12
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,39 @@ jobs:
9797
env:
9898
CHROME_HEADLESS: 1
9999
CHROME_PATH: chrome
100-
CHROME_FLAGS: "--enable-features=SharedArrayBuffer --headless --disable-gpu --no-sandbox --enable-experimental-web-platform-features --enable-features=SharedArrayBuffer"
101-
HEADERS: '{"Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp", "Cross-Origin-Resource-Policy": "cross-origin", "Origin-Agent-Cluster": "?1"}'
100+
CHROME_FLAGS: "--headless --disable-gpu --no-sandbox --enable-features=SharedArrayBuffer,CrossOriginIsolation"
101+
HEADERS: '{"Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp"}'
102102
run: |
103103
# Start test server with proper headers for all tests
104104
npm run serve &
105105
106-
# Wait for server to start and ensure headers are properly set
107-
sleep 10
106+
# Increase wait time to ensure server is ready
107+
sleep 15
108108
109-
# Verify headers are set correctly
110-
echo "Checking security headers..."
111-
curl -I http://localhost:3000/tests/ffmpeg-core-st.test.html
109+
# Verify headers and isolation status
110+
echo "Checking security headers and isolation status..."
111+
curl -v http://localhost:3000/tests/ffmpeg-core-st.test.html 2>&1 | grep -i "cross-origin"
112112
113-
# Check if cross-origin isolation is working
114-
echo "Adding debug script to test files to check crossOriginIsolated status..."
115-
for test_file in tests/ffmpeg-*.test.html; do
116-
sed -i '/<\/head>/ i\<script>console.log("crossOriginIsolated status:", crossOriginIsolated);</script>' $test_file
117-
done
113+
# Run verification script first
114+
echo "Verifying browser environment..."
115+
cat << EOF > verify-browser.html
116+
<!DOCTYPE html>
117+
<html>
118+
<head>
119+
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin">
120+
<meta http-equiv="Cross-Origin-Embedder-Policy" content="require-corp">
121+
</head>
122+
<body>
123+
<script>
124+
console.log('SharedArrayBuffer available:', typeof SharedArrayBuffer !== 'undefined');
125+
console.log('crossOriginIsolated:', window.crossOriginIsolated);
126+
if (!window.crossOriginIsolated || typeof SharedArrayBuffer === 'undefined') {
127+
throw new Error('Browser environment not properly configured for SharedArrayBuffer');
128+
}
129+
</script>
130+
</body>
131+
</html>
132+
EOF
118133
119134
# Run single-threaded tests first
120135
echo "Running single-threaded tests..."

0 commit comments

Comments
 (0)