<rdar://problem/13929704> [WK2] WebKitTestRunner always crashes on exit
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 20:38:04 +0000 (20:38 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 20:38:04 +0000 (20:38 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=116568

        Reviewed by Anders Carlsson.

        * WebKitTestRunner/WebNotificationProvider.cpp:
        (WTR::WebNotificationProvider::~WebNotificationProvider):
        * WebKitTestRunner/WebNotificationProvider.h:
        When the provider is destroyed, it should no longer be registered with the manager.

        * WebKitTestRunner/GeolocationProviderMock.cpp:
        (WTR::GeolocationProviderMock::~GeolocationProviderMock):
        * WebKitTestRunner/GeolocationProviderMock.h:
        I wasn't seeing a crash here, but this code has the same issue as notification
        provider, so applying the same fix.

        * WebKitTestRunner/TestController.cpp: (WTR::TestController::~TestController):
        Close icon database. I started seeing ASSERT(!isOpen()) in WebCore IconDatabase
        destructor having fixed the above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150474 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/GeolocationProviderMock.cpp
Tools/WebKitTestRunner/GeolocationProviderMock.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/WebNotificationProvider.cpp
Tools/WebKitTestRunner/WebNotificationProvider.h

index 4ee2efb95cf2db48634e7c45ecefe60e31ec8e81..1f6e58ecfa77befeeb3812f41b8be536575fe930 100644 (file)
@@ -1,3 +1,25 @@
+2013-05-21  Alexey Proskuryakov  <ap@apple.com>
+
+        <rdar://problem/13929704> [WK2] WebKitTestRunner always crashes on exit
+        https://bugs.webkit.org/show_bug.cgi?id=116568
+
+        Reviewed by Anders Carlsson.
+
+        * WebKitTestRunner/WebNotificationProvider.cpp:
+        (WTR::WebNotificationProvider::~WebNotificationProvider):
+        * WebKitTestRunner/WebNotificationProvider.h:
+        When the provider is destroyed, it should no longer be registered with the manager.
+
+        * WebKitTestRunner/GeolocationProviderMock.cpp:
+        (WTR::GeolocationProviderMock::~GeolocationProviderMock):
+        * WebKitTestRunner/GeolocationProviderMock.h:
+        I wasn't seeing a crash here, but this code has the same issue as notification
+        provider, so applying the same fix.
+
+        * WebKitTestRunner/TestController.cpp: (WTR::TestController::~TestController):
+        Close icon database. I started seeing ASSERT(!isOpen()) in WebCore IconDatabase
+        destructor having fixed the above.
+
 2013-05-21  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r150386 and r150397.
index 7fa0bdba9e718b0efe84614e6c5956c399d729a7..7111d487211bc78bfa51dcc16ef8cc67c4785b58 100644 (file)
@@ -58,6 +58,11 @@ GeolocationProviderMock::GeolocationProviderMock(WKContextRef context)
     WKGeolocationManagerSetProvider(m_geolocationManager, &providerCallback);
 }
 
+GeolocationProviderMock::~GeolocationProviderMock()
+{
+    WKGeolocationManagerSetProvider(m_geolocationManager, 0);
+}
+
 void GeolocationProviderMock::setPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
 {
     m_position.adopt(WKGeolocationPositionCreate_b(currentTime(), latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed));
index 1ebf67d1bf9d88a85f1c2cdeac3a84342afcd01c..ff5537e461c58abcb8a09f137e95d964a76bf023 100644 (file)
@@ -33,6 +33,7 @@ namespace WTR {
 class GeolocationProviderMock {
 public:
     GeolocationProviderMock(WKContextRef);
+    ~GeolocationProviderMock();
 
     void setPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed);
     void setPositionUnavailableError(WKStringRef errorMessage);
index 2d2855a5b5c1e120bebb3f9ff498605324a00bbc..b7c549e71816c44f7851d001a76d854c2e807a7e 100644 (file)
@@ -33,6 +33,7 @@
 #include <WebKit2/WKAuthenticationDecisionListener.h>
 #include <WebKit2/WKContextPrivate.h>
 #include <WebKit2/WKCredential.h>
+#include <WebKit2/WKIconDatabase.h>
 #include <WebKit2/WKNotification.h>
 #include <WebKit2/WKNotificationManager.h>
 #include <WebKit2/WKNotificationPermissionRequest.h>
@@ -120,6 +121,8 @@ TestController::TestController(int argc, const char* argv[])
 
 TestController::~TestController()
 {
+    WKIconDatabaseClose(WKContextGetIconDatabase(m_context.get()));
+
     platformDestroy();
 }
 
index be32cb9a937cb85c0f6369aeeb2aa23eecc6880c..14c95308f773c212ee6a71ca676238054d8d7c42 100644 (file)
@@ -63,6 +63,11 @@ WebNotificationProvider::WebNotificationProvider()
 {
 }
 
+WebNotificationProvider::~WebNotificationProvider()
+{
+    WKNotificationManagerSetProvider(m_notificationManager.get(), 0);
+}
+
 WKNotificationProvider WebNotificationProvider::provider()
 {
     WKNotificationProvider notificationProvider = {
index 63c559cfc3613e3db926e1b4dd22d77b702d1346..b25082923ab1cbd0690bd725ca08fb88d0f9d39e 100644 (file)
@@ -36,6 +36,7 @@ namespace WTR {
 class WebNotificationProvider {
 public:
     WebNotificationProvider();
+    ~WebNotificationProvider();
     WKNotificationProvider provider();
 
     void showWebNotification(WKPageRef, WKNotificationRef);