mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
headless-browser: Restore ability to rebaseline new tests
This regressed in commit 6eca60504e.
If we are rebaslining tests, do not fail if we are unable to open the
expectation file for reading.
This commit is contained in:
parent
d80d951991
commit
10853898fc
|
|
@ -348,15 +348,17 @@ static void run_dump_test(HeadlessWebContentView& view, Test& test, URL::URL con
|
|||
};
|
||||
|
||||
ByteBuffer expectation;
|
||||
{
|
||||
auto expectation_file = TRY(open_expectation_file(Core::File::OpenMode::Read));
|
||||
expectation = TRY(expectation_file->read_until_eof());
|
||||
|
||||
if (auto expectation_file = open_expectation_file(Core::File::OpenMode::Read); !expectation_file.is_error()) {
|
||||
expectation = TRY(expectation_file.value()->read_until_eof());
|
||||
|
||||
auto result_trimmed = StringView { test.text }.trim("\n"sv, TrimMode::Right);
|
||||
auto expectation_trimmed = StringView { expectation }.trim("\n"sv, TrimMode::Right);
|
||||
|
||||
if (result_trimmed == expectation_trimmed)
|
||||
return TestResult::Pass;
|
||||
} else if (!Application::the().rebaseline) {
|
||||
return expectation_file.release_error();
|
||||
}
|
||||
|
||||
if (Application::the().rebaseline) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user