aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-09 12:55:57 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-10 11:43:59 +0100
commitaacacbb831c5658fc10b142c3b71efff7a7bdbc1 (patch)
treefcc5885b620735817f1785c8bc65866dc444d3e6 /test
parentf37e4b6f950bd73cb846c1766790c3feba7fa217 (diff)
downloadbrowser-extension-aacacbb831c5658fc10b142c3b71efff7a7bdbc1.tar.gz
browser-extension-aacacbb831c5658fc10b142c3b71efff7a7bdbc1.zip
improvement to also properly sanitize intrinsics in XML documents under older browsers (IceCat 60)
Diffstat (limited to 'test')
-rw-r--r--test/haketilo_test/data/pages/scripts_to_block_2.xml2
-rw-r--r--test/haketilo_test/unit/test_policy_enforcing.py6
2 files changed, 2 insertions, 6 deletions
diff --git a/test/haketilo_test/data/pages/scripts_to_block_2.xml b/test/haketilo_test/data/pages/scripts_to_block_2.xml
index 6433a1d..7eea906 100644
--- a/test/haketilo_test/data/pages/scripts_to_block_2.xml
+++ b/test/haketilo_test/data/pages/scripts_to_block_2.xml
@@ -30,7 +30,7 @@
<html:img xmlns:html="http://www.w3.org/1999/xhtml"
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg=="
- onload="window.__run = [...(window.__run || []), 'melon'];console.log('delme melon')">
+ onload="window.__run = [...(window.__run || []), 'melon'];">
</html:img>
<!-- Will execute -->
diff --git a/test/haketilo_test/unit/test_policy_enforcing.py b/test/haketilo_test/unit/test_policy_enforcing.py
index 98b5044..bbc3eb9 100644
--- a/test/haketilo_test/unit/test_policy_enforcing.py
+++ b/test/haketilo_test/unit/test_policy_enforcing.py
@@ -144,11 +144,7 @@ def test_policy_enforcing_xml(driver, execute_in_page, csp_off_setting):
def assert_properly_blocked():
click_all()
- try:
- assert set(driver.execute_script('return window.__run || [];')) == set()
- except:
- from time import sleep
- sleep(100000)
+ assert set(driver.execute_script('return window.__run || [];')) == set()
assert bool(csp_off_setting) == are_scripts_allowed(driver)
# First, see if scripts run when not blocked.