summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-28 21:08:57 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-28 22:03:57 +0200
commit549260d31149a6880975c40fa7cb56bb524caa1a (patch)
tree46e52c1987a4bbc5410579ee9373886c2f460373
parentad6027433d8dfb0b9dcd6b6968bbed236d43be47 (diff)
downloadserenity-549260d31149a6880975c40fa7cb56bb524caa1a.zip
headless-browser: Disable content filtering when running tests
URL filtering was taking up a huge amount of time when burning through the tests. We're not gonna have a bunch of ads to block in our local tests, so let's just turn it off when running them.
-rw-r--r--Userland/Utilities/headless-browser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp
index e203c2b723..b28880108e 100644
--- a/Userland/Utilities/headless-browser.cpp
+++ b/Userland/Utilities/headless-browser.cpp
@@ -86,6 +86,11 @@ public:
return String::from_deprecated_string(client().dump_text());
}
+ void clear_content_filters()
+ {
+ client().async_set_content_filters({});
+ }
+
private:
HeadlessWebContentView() = default;
@@ -315,6 +320,8 @@ static ErrorOr<void> collect_tests(Vector<Test>& tests, StringView path, StringV
static ErrorOr<int> run_tests(HeadlessWebContentView& view, StringView test_root_path)
{
+ view.clear_content_filters();
+
Vector<Test> tests;
TRY(collect_tests(tests, TRY(String::formatted("{}/Layout", test_root_path)), "."sv, TestMode::Layout));
TRY(collect_tests(tests, TRY(String::formatted("{}/Text", test_root_path)), "."sv, TestMode::Text));