Fuzzers: Fix FuzzCSSParser build
This commit is contained in:
parent
3905d54a9c
commit
18ca15b2cc
Notes:
sideshowbarker
2024-07-17 07:27:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/18ca15b2cc Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
1 changed files with 5 additions and 1 deletions
|
@ -7,11 +7,15 @@
|
|||
#include <LibCore/EventLoop.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
auto document = Web::DOM::Document::create();
|
||||
auto vm = JS::VM::create();
|
||||
auto realm = JS::Realm::create(*vm);
|
||||
auto window = Web::HTML::Window::create(*realm);
|
||||
auto document = Web::DOM::Document::create(*window);
|
||||
(void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingContext(document), { data, size });
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue