summaryrefslogtreecommitdiffstats
path: root/Tools/WebKitTestRunner
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /Tools/WebKitTestRunner
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Tools/WebKitTestRunner')
-rw-r--r--Tools/WebKitTestRunner/DerivedSources.pro4
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro10
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp29
-rw-r--r--Tools/WebKitTestRunner/TestController.h3
-rw-r--r--Tools/WebKitTestRunner/mac/TestControllerMac.mm4
-rw-r--r--Tools/WebKitTestRunner/qt/WebKitTestRunner.pro10
9 files changed, 46 insertions, 20 deletions
diff --git a/Tools/WebKitTestRunner/DerivedSources.pro b/Tools/WebKitTestRunner/DerivedSources.pro
index 561a09e..1e4e461 100644
--- a/Tools/WebKitTestRunner/DerivedSources.pro
+++ b/Tools/WebKitTestRunner/DerivedSources.pro
@@ -37,8 +37,8 @@ defineTest(addExtraCompiler) {
SRC_ROOT_DIR = $$replace(PWD, /Tools/WebKitTestRunner, /)
# Make sure forwarded headers needed by this project are present
-fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKit2/Scripts/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/Tools/WebKitTestRunner $${OUTPUT_DIR}/include qt
-fwheader_generator.depends = $${SRC_ROOT_DIR}/WebKit2/Scripts/generate-forwarding-headers.pl
+fwheader_generator.commands = perl $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/Tools/WebKitTestRunner $${OUTPUT_DIR}/include qt
+fwheader_generator.depends = $${SRC_ROOT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl
generated_files.depends += fwheader_generator
QMAKE_EXTRA_TARGETS += fwheader_generator
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index f68d3c4..999ca3a 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -167,6 +167,8 @@ void InjectedBundle::done()
WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get());
+ closeOtherPages();
+
m_state = Idle;
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 765ff37..4bcb3c8 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -323,7 +323,7 @@ void InjectedBundlePage::didRunInsecureContentForFrame(WKBundlePageRef page, WKB
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didRunInsecureContentForFrame(frame);
}
-bool InjectedBundlePage::shouldLoadResourceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef, const void* clientInfo)
+bool InjectedBundlePage::shouldLoadResourceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKStringRef, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldLoadResourceForFrame(frame);
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index ac9fbc3..e9462df 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -64,7 +64,7 @@ private:
static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
- static bool shouldLoadResourceForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef, const void*);
+ static bool shouldLoadResourceForFrame(WKBundlePageRef, WKBundleFrameRef, WKStringRef, const void*);
void didStartProvisionalLoadForFrame(WKBundleFrameRef);
void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef);
void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef, WKErrorRef);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro b/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
index c15d1f2..92d31b8 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
@@ -46,8 +46,8 @@ HEADERS += \
include(../../../../WebKit.pri)
include(../../../../Source/JavaScriptCore/JavaScriptCore.pri)
addJavaScriptCoreLib(../../../../Source/JavaScriptCore)
-include(../../../../WebKit2/WebKit2.pri)
-addWebKit2Lib(../../../../WebKit2)
+include(../../../../Source/WebKit2/WebKit2.pri)
+addWebKit2Lib(../../../../Source/WebKit2)
INCLUDEPATH += \
$$PWD \
@@ -56,8 +56,8 @@ INCLUDEPATH += \
$$PWD/../Bindings \
$$PWD/../../../../Source/JavaScriptCore \
$$PWD/../../../../Source/JavaScriptCore/wtf \
- $$PWD/../../../../WebKit2 \
- $$PWD/../../../../WebKit2/Shared \
+ $$PWD/../../../../Source/WebKit2 \
+ $$PWD/../../../../Source/WebKit2/Shared \
$$GENERATED_SOURCES_DIR
INCLUDEPATH += \
@@ -65,7 +65,7 @@ INCLUDEPATH += \
$$WC_GENERATED_SOURCES_DIR
PREFIX_HEADER = $$PWD/../../WebKitTestRunnerPrefix.h
-QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
+*-g++*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
unix:!mac:!symbian {
CONFIG += link_pkgconfig
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index 3ea46ee..699982e 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -97,6 +97,12 @@ static void setWindowFrameOtherPage(WKPageRef page, WKRect frame, const void* cl
view->setWindowFrame(frame);
}
+static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo)
+{
+ printf("%s\n", toSTD(message).c_str());
+ return true;
+}
+
static void closeOtherPage(WKPageRef page, const void* clientInfo)
{
WKPageClose(page);
@@ -134,11 +140,12 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
0, // setIsResizable
getWindowFrameOtherPage,
setWindowFrameOtherPage,
- 0, // runBeforeUnloadConfirmPanel
+ runBeforeUnloadConfirmPanel,
0, // didDraw
0, // pageDidScroll
0, // exceededDatabaseQuota
- 0 // runOpenPanel
+ 0, // runOpenPanel
+ 0, // decidePolicyForGeolocationPermissionRequest
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -238,11 +245,12 @@ void TestController::initialize(int argc, const char* argv[])
0, // setIsResizable
getWindowFrameMainPage,
setWindowFrameMainPage,
- 0, // runBeforeUnloadConfirmPanel
+ runBeforeUnloadConfirmPanel,
0, // didDraw
0, // pageDidScroll
0, // exceededDatabaseQuota
- 0 // runOpenPanel
+ 0, // runOpenPanel
+ 0, // decidePolicyForGeolocationPermissionRequest
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
@@ -270,7 +278,7 @@ void TestController::initialize(int argc, const char* argv[])
0, // didFinishProgress
0, // didBecomeUnresponsive
0, // didBecomeResponsive
- 0, // processDidExit
+ processDidCrash, // processDidCrash
0 // didChangeBackForwardList
};
WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
@@ -393,6 +401,11 @@ void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKT
static_cast<TestController*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(page, frame);
}
+void TestController::processDidCrash(WKPageRef page, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->processDidCrash(page);
+}
+
void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
{
if (m_state != Resetting)
@@ -409,4 +422,10 @@ void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
shared().notifyDone();
}
+void TestController::processDidCrash(WKPageRef page)
+{
+ fputs("#CRASHED - WebProcess\n", stderr);
+ fflush(stderr);
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h
index ef41314..fc8bd30 100644
--- a/Tools/WebKitTestRunner/TestController.h
+++ b/Tools/WebKitTestRunner/TestController.h
@@ -82,6 +82,9 @@ private:
static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*);
void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame);
+ static void processDidCrash(WKPageRef, const void* clientInfo);
+ void processDidCrash(WKPageRef);
+
OwnPtr<TestInvocation> m_currentInvocation;
diff --git a/Tools/WebKitTestRunner/mac/TestControllerMac.mm b/Tools/WebKitTestRunner/mac/TestControllerMac.mm
index fee0070..6a4444f 100644
--- a/Tools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/Tools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -52,8 +52,10 @@ void TestController::initializeTestPluginDirectory()
void TestController::platformRunUntil(bool& done, double timeout)
{
CFAbsoluteTime end = CFAbsoluteTimeGetCurrent() + timeout;
+ CFDateRef endDate = CFDateCreate(0, end);
while (!done && CFAbsoluteTimeGetCurrent() < end)
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:(NSDate *)endDate];
+ CFRelease(endDate);
}
void TestController::platformInitializeContext()
diff --git a/Tools/WebKitTestRunner/qt/WebKitTestRunner.pro b/Tools/WebKitTestRunner/qt/WebKitTestRunner.pro
index bcfc159..73ab4b0 100644
--- a/Tools/WebKitTestRunner/qt/WebKitTestRunner.pro
+++ b/Tools/WebKitTestRunner/qt/WebKitTestRunner.pro
@@ -19,10 +19,10 @@ DEFINES += USE_SYSTEM_MALLOC=1
INCLUDEPATH += \
$$BASEDIR \
$$BASEDIR/../../Source/JavaScriptCore \
- $$BASEDIR/../../WebKit2 \
- $$BASEDIR/../../WebKit2/Shared \
- $$BASEDIR/../../WebKit2/UIProcess/API/qt \
- $$BASEDIR/../../WebKit2/UIProcess/API/cpp/qt \
+ $$BASEDIR/../../Source/WebKit2 \
+ $$BASEDIR/../../Source/WebKit2/Shared \
+ $$BASEDIR/../../Source/WebKit2/UIProcess/API/qt \
+ $$BASEDIR/../../Source/WebKit2/UIProcess/API/cpp/qt \
$$GENERATED_SOURCES_DIR
INCLUDEPATH += \
@@ -52,7 +52,7 @@ SOURCES = \
$$BASEDIR/TestInvocation.cpp \
PREFIX_HEADER = $$BASEDIR/WebKitTestRunnerPrefix.h
-QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
+*-g++*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
linux-* {
# From Creator's src/rpath.pri: