mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
Tests/LibWeb: Do not leak multiple GB of screenshots in the test runner
For every ref tests actual and expected screenshots are taken. These screenshots are only needed while the individual test executes. However, they are never freed during the run, leading to a continuous increase in memory usage of the test runner while executing ref tests. With the number of ref tests growing, this currently amounts to nearly 3 GB of uncompressed bitmap data being held in memory. Lets avoid that by clearing the screenshot data at the end of each test. With this change applied, the memory usage of test-web stays stable and below 100 MB for the entire test run.
This commit is contained in:
parent
18c0739bbb
commit
a259ed4db6
|
|
@ -50,6 +50,9 @@ void TestWebView::did_receive_screenshot(Badge<WebView::WebContentClient>, Gfx::
|
|||
|
||||
void TestWebView::on_test_complete(TestCompletion completion)
|
||||
{
|
||||
completion.test.actual_screenshot.clear();
|
||||
completion.test.expectation_screenshot.clear();
|
||||
|
||||
m_pending_screenshot.clear();
|
||||
m_pending_dialog = Web::Page::PendingDialog::None;
|
||||
m_pending_prompt_text.clear();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user