Title: [111619] trunk/Tools
Revision
111619
Author
[email protected]
Date
2012-03-21 16:29:29 -0700 (Wed, 21 Mar 2012)

Log Message

WTR - log the pid of a crashing WebProcess
https://bugs.webkit.org/show_bug.cgi?id=81575

Reviewed by Alexey Proskuryakov.

This allows run-webkit-tests to find the right crash log for a
given crashed WebProcess in WebKit2.

* WebKitTestRunner/TestController.cpp:
(WTR::exceededDatabaseQuota):
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::runTest):
(WTR::TestController::processDidCrash):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (111618 => 111619)


--- trunk/Tools/ChangeLog	2012-03-21 23:18:20 UTC (rev 111618)
+++ trunk/Tools/ChangeLog	2012-03-21 23:29:29 UTC (rev 111619)
@@ -1,3 +1,21 @@
+2012-03-21  Dirk Pranke  <[email protected]>
+
+        WTR - log the pid of a crashing WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=81575
+
+        Reviewed by Alexey Proskuryakov.
+
+        This allows run-webkit-tests to find the right crash log for a
+        given crashed WebProcess in WebKit2.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::exceededDatabaseQuota):
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::initialize):
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::TestController::runTest):
+        (WTR::TestController::processDidCrash):
+
 2012-03-21  Enrica Casucci  <[email protected]>
 
         WebKitURLWithTitles pasteboard format should support URLs containing Emoji characters.

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (111618 => 111619)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2012-03-21 23:18:20 UTC (rev 111618)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2012-03-21 23:29:29 UTC (rev 111619)
@@ -38,6 +38,10 @@
 #include <cstdio>
 #include <wtf/PassOwnPtr.h>
 
+#if PLATFORM(MAC)
+#include <WebKit2/WKPagePrivateMac.h>
+#endif
+
 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK)
 #include "EventSenderProxy.h"
 #endif
@@ -125,7 +129,7 @@
 
 static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long, unsigned long long, const void*)
 {
-    static const unsigned long long defaultQuota = 5 * 1024 * 1024;    
+    static const unsigned long long defaultQuota = 5 * 1024 * 1024;
     return defaultQuota;
 }
 
@@ -173,7 +177,7 @@
         0, // takeFocus
         focus,
         unfocus,
-        0, // runJavaScriptAlert        
+        0, // runJavaScriptAlert
         0, // runJavaScriptConfirm
         0, // runJavaScriptPrompt
         0, // setStatusText
@@ -337,7 +341,7 @@
         0, // takeFocus
         0, // focus
         0, // unfocus
-        0, // runJavaScriptAlert        
+        0, // runJavaScriptAlert
         0, // runJavaScriptConfirm
         0, // runJavaScriptPrompt
         0, // setStatusText
@@ -404,7 +408,7 @@
         0, // didChangeBackForwardList
         0, // shouldGoToBackForwardListItem
         0, // didRunInsecureContentForFrame
-        0, // didDetectXSSForFrame 
+        0, // didDetectXSSForFrame
         0, // didNewFirstVisuallyNonEmptyLayout
         0, // willGoToBackForwardListItem
     };
@@ -414,7 +418,7 @@
 bool TestController::resetStateToConsistentValues()
 {
     m_state = Resetting;
-    
+
     m_beforeUnloadReturnValue = true;
 
     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("Reset"));
@@ -490,7 +494,12 @@
 bool TestController::runTest(const char* test)
 {
     if (!resetStateToConsistentValues()) {
+#if PLATFORM(MAC)
+        pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page());
+        fprintf(stderr, "#CRASHED - WebProcess (pid %ld)\n", static_cast<long>(pid));
+#else
         fputs("#CRASHED - WebProcess\n", stderr);
+#endif
         fflush(stderr);
         return false;
     }
@@ -508,7 +517,7 @@
     m_currentInvocation = adoptPtr(new TestInvocation(pathOrURL));
     m_currentInvocation->setSkipPixelTestOption(m_skipPixelTestOption);
     if (m_dumpPixels)
-        m_currentInvocation->setIsPixelTest(expectedPixelHash);    
+        m_currentInvocation->setIsPixelTest(expectedPixelHash);
 
     m_currentInvocation->invoke();
     m_currentInvocation.clear();
@@ -800,7 +809,12 @@
     // This function can be called multiple times when crash logs are being saved on Windows, so
     // ensure we only print the crashed message once.
     if (!m_didPrintWebProcessCrashedMessage) {
+#if PLATFORM(MAC)
+        pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page());
+        fprintf(stderr, "#CRASHED - WebProcess (pid %ld)\n", static_cast<long>(pid));
+#else
         fputs("#CRASHED - WebProcess\n", stderr);
+#endif
         fflush(stderr);
         m_didPrintWebProcessCrashedMessage = true;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to