mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefTestServer that supports both HTTP and HTTPS (see issue #3348)
This commit is contained in:
39
libcef/browser/test/test_server_impl.h
Normal file
39
libcef/browser/test/test_server_impl.h
Normal file
@ -0,0 +1,39 @@
|
||||
// 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>
|
||||
|
||||
#include "include/test/cef_test_server.h"
|
||||
|
||||
class CefTestServerImpl : public CefTestServer {
|
||||
public:
|
||||
CefTestServerImpl() = default;
|
||||
|
||||
CefTestServerImpl(const CefTestServerImpl&) = delete;
|
||||
CefTestServerImpl& operator=(const CefTestServerImpl&) = delete;
|
||||
|
||||
bool Start(uint16 port,
|
||||
bool https_server,
|
||||
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_
|
Reference in New Issue
Block a user