diff --git a/testing/web-platform/tests/content-security-policy/securitypolicyviolation/source-file.html b/testing/web-platform/tests/content-security-policy/securitypolicyviolation/source-file.html index 354b8dfd20124..d215d0ede6916 100644 --- a/testing/web-platform/tests/content-security-policy/securitypolicyviolation/source-file.html +++ b/testing/web-platform/tests/content-security-policy/securitypolicyviolation/source-file.html @@ -22,11 +22,7 @@ eval(''); //# sourceURL=${input} `) - try { - eval(trusted_script); - assert_unreached(); - } catch (e) {} - + assert_throws_js(EvalError, _ => eval(trusted_script)); assert_equals((await violation).sourceFile, output); }, description); };