tests: cover WebMediaController lifecycle with wxWebView stub

This commit is contained in:
peachismomo
2026-09-23 03:50:35 +08:00
parent 7d4d8276a2
commit ccaafb3003
4 changed files with 133 additions and 5 deletions
+14 -4
View File
@@ -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)