diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-12-04 16:42:15 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-12-04 16:43:44 +0100 |
commit | 5b6d25a1f8cbfdae88c70bf1161faff95ea6f9d2 (patch) | |
tree | 9d3fd7db6c196e2399d809ecbcf96a2d9a26449d | |
parent | 00e233df97f4919ece4d4f9e5b5b8f1313236220 (diff) | |
download | qutebrowser-5b6d25a1f8cbfdae88c70bf1161faff95ea6f9d2.tar.gz qutebrowser-5b6d25a1f8cbfdae88c70bf1161faff95ea6f9d2.zip |
Add tests for reiniting private mode
See #5810 and #5813
(cherry picked from commit 04963c1beee371ff3cddea7e0027dfdb82e1a988)
-rw-r--r-- | tests/end2end/data/adblock/external_logo.html | 15 | ||||
-rw-r--r-- | tests/end2end/data/adblock/qutebrowser | 1 | ||||
-rw-r--r-- | tests/end2end/features/private.feature | 44 |
3 files changed, 60 insertions, 0 deletions
diff --git a/tests/end2end/data/adblock/external_logo.html b/tests/end2end/data/adblock/external_logo.html new file mode 100644 index 000000000..7fa7e9ebb --- /dev/null +++ b/tests/end2end/data/adblock/external_logo.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>External logo</title> + </head> + <body> + <p> + <b>NOTE:</> This should never be used in a test where + qutebrowser.org isn't blocked, as no network requests should be + made while running the testsuite. + </p> + <img src="https://qutebrowser.org/icons/qutebrowser.svg"> + </body> +</html> diff --git a/tests/end2end/data/adblock/qutebrowser b/tests/end2end/data/adblock/qutebrowser new file mode 100644 index 000000000..d104c0104 --- /dev/null +++ b/tests/end2end/data/adblock/qutebrowser @@ -0,0 +1 @@ +qutebrowser.org diff --git a/tests/end2end/features/private.feature b/tests/end2end/features/private.feature index fe870dded..f97683140 100644 --- a/tests/end2end/features/private.feature +++ b/tests/end2end/features/private.feature @@ -199,3 +199,47 @@ Feature: Using private browsing - history: - active: true url: http://localhost:*/data/numbers/5.txt + + # https://github.com/qutebrowser/qutebrowser/issues/5810 + + Scenario: Using qute:// scheme after reiniting private profile + When I open about:blank in a private window + And I run :close + And I open qute://version in a private window + Then the page should contain the plaintext "Version info" + + Scenario: Downloading after reiniting private profile + When I open about:blank in a private window + And I run :close + And I open data/downloads/downloads.html in a private window + And I run :click-element id download + And I wait for "*PromptMode.download*" in the log + And I run :leave-mode + Then "Removed download *: download.bin *" should be logged + + Scenario: Adblocking after reiniting private profile + When I open about:blank in a private window + And I run :close + And I set content.host_blocking.lists to ["http://localhost:(port)/data/adblock/qutebrowser"] + And I run :adblock-update + And I wait for the message "adblock: Read 1 hosts from 1 sources." + And I open data/adblock/external_logo.html in a private window + Then "Request to qutebrowser.org blocked by host blocker." should be logged + + Scenario: Cookie filtering after reiniting private profile + When I open about:blank in a private window + And I run :close + And I set content.cookies.accept to never + And I open data/title.html in a private window + And I run :jseval document.cookie = "testcookie" + And I run :jseval "has cookie: " + !!document.cookie + Then "has cookie: false" should be logged + + Scenario: Disabling JS after reiniting private profile + When I open about:blank in a new window + And I run :window-only + And I set content.javascript.enabled to false + And I open about:blank in a private window + And I run :close + And I open data/javascript/enabled.html in a private window + Then the page should contain the plaintext "JavaScript is disabled" |