2022-07-29 18:34:30 +02:00
|
|
|
// Copyright 2022 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found
|
|
|
|
// in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_TEST_TEST_SERVER_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_TEST_TEST_SERVER_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/test/cef_test_server.h"
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
class CefTestServerImpl : public CefTestServer {
|
|
|
|
public:
|
|
|
|
CefTestServerImpl() = default;
|
|
|
|
|
|
|
|
CefTestServerImpl(const CefTestServerImpl&) = delete;
|
|
|
|
CefTestServerImpl& operator=(const CefTestServerImpl&) = delete;
|
|
|
|
|
2023-06-01 16:06:15 +02:00
|
|
|
bool Start(uint16_t port,
|
2022-07-29 18:34:30 +02:00
|
|
|
bool https_server,
|
2022-08-04 18:37:12 +02:00
|
|
|
cef_test_cert_type_t https_cert_type,
|
2022-07-29 18:34:30 +02:00
|
|
|
CefRefPtr<CefTestServerHandler> handler);
|
|
|
|
|
|
|
|
// CefTestServer methods:
|
|
|
|
void Stop() override;
|
|
|
|
CefString GetOrigin() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Only accessed on the creation thread.
|
|
|
|
class Context;
|
|
|
|
std::unique_ptr<Context> context_;
|
|
|
|
|
|
|
|
// Safe to access on any thread.
|
|
|
|
CefString origin_;
|
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefTestServerImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_TEST_TEST_SERVER_IMPL_H_
|