mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-23 18:51:55 +00:00
LibWeb: Stop deadlocking on unit tests
Unit tests on macOS deadlock because the WebContent process is waiting for the next opportunity to render before a screenshot is taken. For some reason unknown to myself, this opportunity never arrives. In order to not deadlock, screenshot requests are now also processed separately from rendering.
This commit is contained in:
parent
7de669dc07
commit
31698281b6
Notes:
sideshowbarker
2024-07-17 21:16:31 +09:00
Author: https://github.com/vicr123 🔰
Commit: 31698281b6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/386
Reviewed-by: https://github.com/kalenikaliaksandr ✅
Reviewed-by: https://github.com/nico
6 changed files with 18 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/TraversableNavigable.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/HighResolutionTime/Performance.h>
|
||||
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
||||
|
@ -336,6 +337,13 @@ void EventLoop::process()
|
|||
}
|
||||
});
|
||||
|
||||
// FIXME: Not in the spec: If there is a screenshot request queued, process it now.
|
||||
// This prevents tests deadlocking on screenshot requests on macOS.
|
||||
for (auto& document : docs) {
|
||||
if (document->page().top_level_traversable()->needs_repaint())
|
||||
document->page().client().process_screenshot_requests();
|
||||
}
|
||||
|
||||
// 13. If all of the following are true
|
||||
// - this is a window event loop
|
||||
// - there is no task in this event loop's task queues whose document is fully active
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue