Bug 1890277: part 4) Add CSPParser support for the `trusted-types` directive, guarded...
[gecko.git] / tools / fuzzing / smoke / tests.py
blobbc06e2427b8d0a28d871b366f8358c3e52f4071a
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 import os
5 from contextlib import contextmanager
7 import pytest
8 import smoke
10 JS = os.path.join(os.path.dirname(__file__), "js.py")
13 @contextmanager
14 def fake_js():
15 os.environ["JSSHELL"] = JS
16 try:
17 yield
18 finally:
19 del os.environ["JSSHELL"]
22 def test_run_no_jsshell():
23 with pytest.raises(FileNotFoundError):
24 smoke.run_jsshell("--fuzzing-safe -e 'print(\"PASSED\")'")
27 def test_run_jsshell_set():
28 with fake_js():
29 smoke.run_jsshell("--fuzzing-safe -e 'print(\"PASSED\")'")
32 def test_smoke_test():
33 with fake_js():
34 smoke.smoke_test()