From 5b6d25a1f8cbfdae88c70bf1161faff95ea6f9d2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Dec 2020 16:42:15 +0100 Subject: Add tests for reiniting private mode See #5810 and #5813 (cherry picked from commit 04963c1beee371ff3cddea7e0027dfdb82e1a988) --- tests/end2end/data/adblock/external_logo.html | 15 +++++++++ tests/end2end/data/adblock/qutebrowser | 1 + tests/end2end/features/private.feature | 44 +++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 tests/end2end/data/adblock/external_logo.html create mode 100644 tests/end2end/data/adblock/qutebrowser 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 @@ + + + + + External logo + + +

+ 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. +

+ + + 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" -- cgit v1.2.3-54-g00ecf