Skip to content

Commit

Permalink
Update event listener test to remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Jun 4, 2024
1 parent da228ca commit 516f384
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tests/Source/UnitTests/EventListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static const String document_decorator_rml = R"(
<body>
<div>
<button id="exit" onclick="exit">Exit</button>
<button id="exit" onclick="exit" />
</div>
</body>
</rml>
Expand All @@ -85,7 +85,7 @@ class DemoEventListener : public Rml::EventListener {
// current element will be destroyed, so we cannot use it after SetInnerRml(). The library should handle
// this case safely internally when propagating the event further.
Element* parent = element->GetParentNode();
parent->SetInnerRML("<button onclick='confirm_exit' onblur='cancel_exit' onmouseout='cancel_exit'>Are you sure?</button>");
parent->SetInnerRML("<button onclick='confirm_exit' onmouseout='cancel_exit' />");
if (Element* child = parent->GetChild(0))
child->Focus();
}
Expand All @@ -96,7 +96,7 @@ class DemoEventListener : public Rml::EventListener {
else if (value == "cancel_exit")
{
if (Element* parent = element->GetParentNode())
parent->SetInnerRML("<button id='exit' onclick='exit'>Exit</button>");
parent->SetInnerRML("<button id='exit' onclick='exit' />");
}
}

Expand All @@ -113,7 +113,7 @@ Rml::EventListener* DemoEventListenerInstancer::InstanceEventListener(const Rml:
return new DemoEventListener(value, element, this);
}

TEST_CASE("event_listener.inline_decorator_images")
TEST_CASE("event_listener.replace_current_element")
{
Context* context = TestsShell::GetContext();
REQUIRE(context);
Expand Down Expand Up @@ -158,5 +158,6 @@ TEST_CASE("event_listener.inline_decorator_images")
CHECK(event_listener_instancer.has_exited == !exit_cancelled);

document->Close();
Rml::Factory::RegisterEventListenerInstancer(nullptr);
TestsShell::ShutdownShell();
}

0 comments on commit 516f384

Please sign in to comment.