LibWeb+WebContent: Do not include DOM HTML in text test expectations

For example, in the following abbreviated test HTML:

    <span>some text</span>
    <script>println("whf")</script>

We would have to craft the expectation file to include the "some text"
segment, usually with some leading whitespace. This is a bit annoying,
and makes it difficult to manually craft expectation files.

So instead of comparing the expectation against the entire DOM inner
text, we now send the inner text of just the <pre> element containing
the test output when we invoke `internals.signalTextTestIsDone`.
This commit is contained in:
Timothy Flynn
2024-10-02 12:38:10 -04:00
committed by Tim Flynn
parent f3f7f77dbc
commit bf668696de
319 changed files with 333 additions and 333 deletions

View File

@@ -84,11 +84,11 @@ void WebContentClient::did_finish_loading(u64 page_id, URL::URL const& url)
}
}
void WebContentClient::did_finish_text_test(u64 page_id)
void WebContentClient::did_finish_text_test(u64 page_id, String const& text)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_text_test_finish)
view->on_text_test_finish();
view->on_text_test_finish(text);
}
}