From 4c6a2323d90e9321ec2b78e226167b3013ea69ab Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 29 Jan 2022 00:03:51 +0100 Subject: make Haketilo buildable again (for Mozilla) How cool it is to throw away 5755 lines of code... --- test/unit/test_content.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/unit/test_content.py') diff --git a/test/unit/test_content.py b/test/unit/test_content.py index 35ab027..8220160 100644 --- a/test/unit/test_content.py +++ b/test/unit/test_content.py @@ -33,7 +33,7 @@ dynamic_script = \ '''; this.haketilo_secret = "abracadabra"; this.haketilo_pattern_tree = {}; - this.haketilo_defualt_allow = false; + this.haketilo_default_allow = false; if (this.haketilo_content_script_main) this.haketilo_content_script_main(); @@ -69,7 +69,7 @@ content_script = \ async function mock_payload_ok([type, res_id]) { if (type === "indexeddb_files") - return [1, 2].map(n => `window.haketilo_injected_${n} = ${n}${n};`); + return {files: [1, 2].map(n => `window.hak_injected_${n} = ${n};`)}; } if (/payload_error/.test(document.URL)) { @@ -162,7 +162,7 @@ def test_content_unprivileged_page(driver, execute_in_page, target1, target2): def vars_made_by_payload(driver): vars_values = driver.execute_script( - 'return [1, 2].map(n => window[`haketilo_injected_${n}`]);' + 'return [1, 2].map(n => window[`hak_injected_${n}`]);' ) if vars_values != [None, None]: return vars_values @@ -174,7 +174,7 @@ def test_content_unprivileged_page(driver, execute_in_page, target1, target2): } elif target2 == 'payload_ok': vars_values = WebDriverWait(driver, 10).until(vars_made_by_payload) - assert vars_values == [11, 22] + assert vars_values == [1, 2] @pytest.mark.ext_data({'content_script': content_script}) @pytest.mark.usefixtures('webextension') -- cgit v1.2.3