summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-12-04 16:42:15 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-12-04 16:42:15 +0100
commit04963c1beee371ff3cddea7e0027dfdb82e1a988 (patch)
tree3b51df16e6550ac3cc774d3cb7be9fcfc4c1f833
parent1f6fab7035db7ab1c25bb17b177a3f486d9012a8 (diff)
downloadqutebrowser-04963c1beee371ff3cddea7e0027dfdb82e1a988.tar.gz
qutebrowser-04963c1beee371ff3cddea7e0027dfdb82e1a988.zip
Add tests for reiniting private mode
See #5810 and #5813
-rw-r--r--tests/end2end/data/adblock/external_logo.html15
-rw-r--r--tests/end2end/data/adblock/qutebrowser1
-rw-r--r--tests/end2end/features/private.feature44
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"