headless-browser: Navigate after attaching new callbacks for ref tests

This commit is contained in:
Andrew Kaster 2024-01-18 13:08:36 -07:00 committed by Alexander Kalenik
parent 1358fe85b0
commit 05ea3d6be0
Notes: sideshowbarker 2024-07-18 05:37:06 +09:00

View file

@ -364,8 +364,6 @@ static ErrorOr<TestResult> run_ref_test(HeadlessWebContentView& view, StringView
loop.quit(0);
}));
view.load(URL::create_with_file_scheme(TRY(FileSystem::real_path(input_path))));
RefPtr<Gfx::Bitmap> actual_screenshot, expectation_screenshot;
view.on_load_finish = [&](auto const&) {
if (actual_screenshot) {
@ -376,6 +374,11 @@ static ErrorOr<TestResult> run_ref_test(HeadlessWebContentView& view, StringView
view.debug_request("load-reference-page");
}
};
view.on_text_test_finish = [&] {
dbgln("Unexpected text test finished during ref test for {}", input_path);
};
view.load(URL::create_with_file_scheme(TRY(FileSystem::real_path(input_path))));
timeout_timer->start();
loop.exec();