Skip to content
Permalink
Browse files
REGRESSION(r188548): Some tests crash after r188548 because injected …
…bundle messages are received after the test finishes

https://bugs.webkit.org/show_bug.cgi?id=148529

Reviewed by Darin Adler.

When there are pending EventSender messages after a test finishes,
they could be processed in the main loop started by the
resetStateToConsistentValues(), but the old EventSender has been
replaced by a new one at that point. The new Eventsender can crash
when processing messages that were sent to the old one. To avoid
this, we return early when receiving an EventSender message and
the TestController state is not RunningTest.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle):
(WTR::TestController::didReceiveMessageFromInjectedBundle):

Canonical link: https://commits.webkit.org/166824@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Sep 2, 2015
1 parent 7d2651f commit 9977ab0136324d96c10c8bd6bc3b5d7c15efff0b
Showing 2 changed files with 25 additions and 0 deletions.
@@ -1,3 +1,22 @@
2015-09-02 Carlos Garcia Campos <cgarcia@igalia.com>

REGRESSION(r188548): Some tests crash after r188548 because injected bundle messages are received after the test finishes
https://bugs.webkit.org/show_bug.cgi?id=148529

Reviewed by Darin Adler.

When there are pending EventSender messages after a test finishes,
they could be processed in the main loop started by the
resetStateToConsistentValues(), but the old EventSender has been
replaced by a new one at that point. The new Eventsender can crash
when processing messages that were sent to the old one. To avoid
this, we return early when receiving an EventSender message and
the TestController state is not RunningTest.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle):
(WTR::TestController::didReceiveMessageFromInjectedBundle):

2015-09-02 Carlos Garcia Campos <cgarcia@igalia.com>

REGRESSION(r188548): TestController state is Resseting while tests are running after r188548
@@ -1019,6 +1019,9 @@ void TestController::didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef
void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
if (m_state != RunningTest)
return;

ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);

@@ -1089,6 +1092,9 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName
WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
if (m_state != RunningTest)
return nullptr;

ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);

0 comments on commit 9977ab0

Please sign in to comment.