qutebrowser/tests/unit/javascript
Jimmy 5252541fe3 greasemonkey: better handle scripts without metadata
Previously calling `script.code()` would fail if the script didn't have
a `name`. This wasn't being hit in practice because the only place that
constructs GreasemonkeyScripts was checking for that condition and add
the filename there as a fallback.

This change make the `name` attribute more explicitly mandatory by
failing with a `ValueError` if it is not provided and make it still
possible to use the filename fallback in that case by adding a
`filename` keyward argument to `__init__()`.

Additionally where `script_meta` is used in `script.code()` a fallback
to and emptry string was added so it doesn't fail for raw javascript
files without greasemonkey metadata.
2018-09-09 20:51:19 +12:00
..
position_caret Remove unused imports 2018-03-19 19:42:56 +01:00
stylesheet Skip test_set_error entirely 2018-04-16 17:14:14 +02:00
base.html Reorganize tests directory. 2015-08-18 20:19:02 +02:00
conftest.py Log document.body in JS tests 2018-03-20 11:56:46 +01:00
test_greasemonkey.py greasemonkey: better handle scripts without metadata 2018-09-09 20:51:19 +12:00
test_js_execution.py Greasemonkey: Don't attempt scope isolation on webkit 2018-05-20 18:42:40 +12:00