mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
ece611718d
This commit adds a "echo_server_port" property to `WebContentOptions`. Additionally, it makes `Application::web_content_options()` return a mutable reference instead of a const reference so that we can set the port value from the fixture.
40 lines
775 B
C++
40 lines
775 B
C++
/*
|
|
* Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Error.h>
|
|
#include <AK/NonnullOwnPtr.h>
|
|
#include <AK/Optional.h>
|
|
#include <AK/StringView.h>
|
|
#include <AK/Vector.h>
|
|
|
|
namespace Ladybird {
|
|
|
|
class Fixture {
|
|
public:
|
|
virtual ~Fixture();
|
|
|
|
virtual ErrorOr<void> setup(WebView::WebContentOptions&) = 0;
|
|
|
|
void teardown()
|
|
{
|
|
if (is_running())
|
|
teardown_impl();
|
|
}
|
|
|
|
virtual StringView name() const = 0;
|
|
virtual bool is_running() const { return false; }
|
|
|
|
static void initialize_fixtures();
|
|
static Optional<Fixture&> lookup(StringView name);
|
|
static Vector<NonnullOwnPtr<Fixture>>& all();
|
|
|
|
protected:
|
|
virtual void teardown_impl() = 0;
|
|
};
|
|
|
|
}
|