mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
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.
This commit is contained in:
parent
ad6027433d
commit
549260d311
1 changed files with 7 additions and 0 deletions
|
@ -86,6 +86,11 @@ public:
|
||||||
return String::from_deprecated_string(client().dump_text());
|
return String::from_deprecated_string(client().dump_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear_content_filters()
|
||||||
|
{
|
||||||
|
client().async_set_content_filters({});
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HeadlessWebContentView() = default;
|
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)
|
static ErrorOr<int> run_tests(HeadlessWebContentView& view, StringView test_root_path)
|
||||||
{
|
{
|
||||||
|
view.clear_content_filters();
|
||||||
|
|
||||||
Vector<Test> tests;
|
Vector<Test> tests;
|
||||||
TRY(collect_tests(tests, TRY(String::formatted("{}/Layout", test_root_path)), "."sv, TestMode::Layout));
|
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));
|
TRY(collect_tests(tests, TRY(String::formatted("{}/Text", test_root_path)), "."sv, TestMode::Text));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue