mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
tests: cover WebMediaController lifecycle with wxWebView stub
This commit is contained in:
@@ -4,13 +4,23 @@
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
WebMediaController::WebMediaController(wxWebView* webview) : m_webview(webview)
|
||||
namespace {
|
||||
|
||||
void initialize_webview(wxWebView* webview)
|
||||
{
|
||||
if (!m_webview)
|
||||
if (!webview)
|
||||
return;
|
||||
|
||||
m_webview->SetBackgroundColour(*wxBLACK);
|
||||
m_webview->SetPage("<html><head><style>html,body{margin:0;height:100%;background:#000;}</style></head><body></body></html>", "");
|
||||
webview->SetBackgroundColour(*wxBLACK);
|
||||
webview->SetPage("<html><head><style>html,body{margin:0;height:100%;background:#000;}</style></head><body></body></html>", "");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
WebMediaController::WebMediaController(wxWebView* webview)
|
||||
: m_webview(webview)
|
||||
{
|
||||
initialize_webview(m_webview);
|
||||
}
|
||||
|
||||
void WebMediaController::Load(wxURI url)
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
void Stop() override;
|
||||
|
||||
private:
|
||||
wxWebView* m_webview;
|
||||
wxWebView* m_webview = nullptr;
|
||||
std::string m_url;
|
||||
CameraStreamMode m_stream_mode = CameraStreamMode::http;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user