diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
tree | f6256640b6c46d7da221435803cae65326817ba2 /Tools/WebKitTestRunner | |
parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Tools/WebKitTestRunner')
21 files changed, 443 insertions, 263 deletions
diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt index badc2c471..4950fd9a9 100644 --- a/Tools/WebKitTestRunner/CMakeLists.txt +++ b/Tools/WebKitTestRunner/CMakeLists.txt @@ -42,7 +42,7 @@ SET(WebKitTestRunner_INCLUDE_DIRECTORIES ${DERIVED_SOURCES_DIR}/InjectedBundle ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Source - ${LIBSOUP24_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} ) SET(WebKitTestRunnerInjectedBundle_SOURCES @@ -55,7 +55,7 @@ SET(WebKitTestRunnerInjectedBundle_SOURCES ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundle.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundleMain.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/InjectedBundlePage.cpp - ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/LayoutTestController.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp diff --git a/Tools/WebKitTestRunner/DerivedSources.make b/Tools/WebKitTestRunner/DerivedSources.make index 187d41c4f..501df5911 100644 --- a/Tools/WebKitTestRunner/DerivedSources.make +++ b/Tools/WebKitTestRunner/DerivedSources.make @@ -32,7 +32,7 @@ INTERFACES = \ AccessibilityUIElement \ EventSendingController \ GCController \ - LayoutTestController \ + TestRunner \ TextInputController \ # diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am index 723ce77ee..85ad427de 100644 --- a/Tools/WebKitTestRunner/GNUmakefile.am +++ b/Tools/WebKitTestRunner/GNUmakefile.am @@ -72,7 +72,7 @@ webkittestrunner_built_sources += \ DerivedSources/InjectedBundle/JSAccessibilityUIElement.cpp \ DerivedSources/InjectedBundle/JSEventSendingController.cpp \ DerivedSources/InjectedBundle/JSGCController.cpp \ - DerivedSources/InjectedBundle/JSLayoutTestController.cpp \ + DerivedSources/InjectedBundle/JSTestRunner.cpp \ DerivedSources/InjectedBundle/JSTextInputController.cpp nodist_Libraries_libTestRunnerInjectedBundle_la_SOURCES = $(webkittestrunner_built_sources) BUILT_SOURCES += $(webkittestrunner_built_sources) @@ -98,14 +98,14 @@ Libraries_libTestRunnerInjectedBundle_la_SOURCES = \ Tools/WebKitTestRunner/InjectedBundle/gtk/AccessibilityUIElementGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp \ - Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp \ + Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp \ Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h \ - Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp \ - Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h \ + Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp \ + Tools/WebKitTestRunner/InjectedBundle/TestRunner.h \ Tools/WebKitTestRunner/InjectedBundle/TextInputController.cpp \ Tools/WebKitTestRunner/InjectedBundle/TextInputController.h diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl index df608da3a..ff91579e1 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl +++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl @@ -25,7 +25,7 @@ module WTR { - interface LayoutTestController { + interface TestRunner { // The basics. void dumpAsText(in boolean dumpPixels); void dumpChildFramesAsText(); @@ -44,6 +44,7 @@ module WTR { void dumpFullScreenCallbacks(); void dumpFrameLoadCallbacks(); void dumpProgressFinishedCallback(); + void dumpResourceLoadCallbacks(); void dumpResourceResponseMIMETypes(); // Special options. diff --git a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri index 07cdc6719..15211830c 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri @@ -18,7 +18,7 @@ IDL_BINDINGS += \ Bindings/AccessibilityUIElement.idl \ Bindings/EventSendingController.idl \ Bindings/GCController.idl \ - Bindings/LayoutTestController.idl \ + Bindings/TestRunner.idl \ Bindings/TextInputController.idl \ # GENERATOR 1: IDL compiler diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 002e7f901..a44cc54d6 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -169,19 +169,19 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag return; } if (WKStringIsEqualToUTF8CString(messageName, "CallAddChromeInputFieldCallback")) { - m_layoutTestController->callAddChromeInputFieldCallback(); + m_testRunner->callAddChromeInputFieldCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallRemoveChromeInputFieldCallback")) { - m_layoutTestController->callRemoveChromeInputFieldCallback(); + m_testRunner->callRemoveChromeInputFieldCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallFocusWebViewCallback")) { - m_layoutTestController->callFocusWebViewCallback(); + m_testRunner->callFocusWebViewCallback(); return; } if (WKStringIsEqualToUTF8CString(messageName, "CallSetBackingScaleFactorCallback")) { - m_layoutTestController->callSetBackingScaleFactorCallback(); + m_testRunner->callSetBackingScaleFactorCallback(); return; } @@ -211,7 +211,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) m_repaintRects.clear(); m_stringBuilder->clear(); - m_layoutTestController = LayoutTestController::create(); + m_testRunner = TestRunner::create(); m_gcController = GCController::create(); m_eventSendingController = EventSendingController::create(); m_textInputController = TextInputController::create(); @@ -228,7 +228,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings) WKBundleRemoveAllUserContent(m_bundle, m_pageGroup); - m_layoutTestController->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); + m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); page()->prepare(); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h index 26bedc45d..5309900da 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h @@ -29,7 +29,7 @@ #include "AccessibilityController.h" #include "EventSendingController.h" #include "GCController.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "TextInputController.h" #include <WebKit2/WKBase.h> #include <WebKit2/WKRetainPtr.h> @@ -57,7 +57,7 @@ public: WKBundleRef bundle() const { return m_bundle; } WKBundlePageGroupRef pageGroup() const { return m_pageGroup; } - LayoutTestController* layoutTestController() { return m_layoutTestController.get(); } + TestRunner* testRunner() { return m_testRunner.get(); } GCController* gcController() { return m_gcController.get(); } EventSendingController* eventSendingController() { return m_eventSendingController.get(); } TextInputController* textInputController() { return m_textInputController.get(); } @@ -115,7 +115,7 @@ private: Vector<OwnPtr<InjectedBundlePage> > m_pages; RefPtr<AccessibilityController> m_accessibilityController; - RefPtr<LayoutTestController> m_layoutTestController; + RefPtr<TestRunner> m_testRunner; RefPtr<GCController> m_gcController; RefPtr<EventSendingController> m_eventSendingController; RefPtr<TextInputController> m_textInputController; diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index de32cb08d..7d2cb9823 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -42,6 +42,7 @@ #include <WebKit2/WKBundleNodeHandlePrivate.h> #include <WebKit2/WKBundlePagePrivate.h> #include <WebKit2/WKURLRequest.h> +#include <wtf/HashMap.h> #include <wtf/text/CString.h> #include <wtf/text/StringBuilder.h> @@ -50,8 +51,8 @@ #endif #if ENABLE(WEB_INTENTS) +#include <WebKit2/WKBundleIntent.h> #include <WebKit2/WKBundleIntentRequest.h> -#include <WebKit2/WKIntentData.h> #endif #if ENABLE(WEB_INTENTS_TAG) #include <WebKit2/WKIntentServiceInfo.h> @@ -215,6 +216,58 @@ static WTF::String frameToStr(WKBundleFrameRef frame) return stringBuilder.toString(); } +static inline bool isLocalFileScheme(WKStringRef scheme) +{ + return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "file"); +} + +static const char divider = '/'; + +static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl) +{ + if (!fileUrl) + return String(); + + WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl)); + if (!isLocalFileScheme(schemeString.get())) + return toWTFString(adoptWK(WKURLCopyString(fileUrl))); + + String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl))); + WTF::StringBuilder stringBuilder; + + // Remove the leading path from file urls. + const size_t indexBaseName = pathString.reverseFind(divider); + if (indexBaseName != notFound) { + const size_t indexDirName = pathString.reverseFind(divider, indexBaseName - 1); + if (indexDirName != notFound) + stringBuilder.append(pathString.substring(indexDirName + 1, indexBaseName - indexDirName - 1)); + stringBuilder.append(divider); + stringBuilder.append(pathString.substring(indexBaseName + 1)); // Filename. + } else { + stringBuilder.append(divider); + stringBuilder.append(pathString); // Return "/pathString". + } + + return stringBuilder.toString(); +} + +static inline WTF::String urlSuitableForTestResult(WKURLRef fileUrl) +{ + if (!fileUrl) + return String(); + + WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl)); + if (!isLocalFileScheme(schemeString.get())) + return toWTFString(adoptWK(WKURLCopyString(fileUrl))); + + WTF::String urlString = toWTFString(adoptWK(WKURLCopyString(fileUrl))); + const size_t indexBaseName = urlString.reverseFind(divider); + + return (indexBaseName == notFound) ? urlString : urlString.substring(indexBaseName + 1); +} + +static HashMap<uint64_t, String> assignedUrlsCache; + InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) : m_page(page) , m_world(AdoptWK, WKBundleScriptWorldCreateWorld()) @@ -366,6 +419,7 @@ void InjectedBundlePage::resetAfterTest() #else WebCoreTestSupport::resetInternalsObject(context); #endif + assignedUrlsCache.clear(); } // Loader Client Callbacks @@ -396,6 +450,70 @@ static void dumpFrameDescriptionSuitableForTestResult(WKBundleFrameRef frame) InjectedBundle::shared().stringBuilder()->append("\""); } +static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request) +{ + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); + WKRetainPtr<WKURLRef> firstParty = adoptWK(WKURLRequestCopyFirstPartyForCookies(request)); + WKRetainPtr<WKStringRef> httpMethod = adoptWK(WKURLRequestCopyHTTPMethod(request)); + + InjectedBundle::shared().stringBuilder()->append("<NSURLRequest URL "); + InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get())); + InjectedBundle::shared().stringBuilder()->append(", main document URL "); + InjectedBundle::shared().stringBuilder()->append(urlSuitableForTestResult(firstParty.get())); + InjectedBundle::shared().stringBuilder()->append(", http method "); + + if (WKStringIsEmpty(httpMethod.get())) + InjectedBundle::shared().stringBuilder()->append("(none)"); + else + InjectedBundle::shared().stringBuilder()->append(toWTFString(httpMethod)); + + InjectedBundle::shared().stringBuilder()->append(">"); +} + +static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response) +{ + WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response)); + if (!url) { + InjectedBundle::shared().stringBuilder()->append("(null)"); + return; + } + InjectedBundle::shared().stringBuilder()->append("<NSURLResponse "); + InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get())); + InjectedBundle::shared().stringBuilder()->append(", http status code "); + InjectedBundle::shared().stringBuilder()->append(WTF::String::number(WKURLResponseHTTPStatusCode(response))); + InjectedBundle::shared().stringBuilder()->append(">"); +} + +static inline void dumpErrorDescriptionSuitableForTestResult(WKErrorRef error) +{ + WKRetainPtr<WKStringRef> errorDomain = adoptWK(WKErrorCopyDomain(error)); + int errorCode = WKErrorGetErrorCode(error); + + // We need to do some error mapping here to match the test expectations (Mac error names are expected). + if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitNetworkError")) { + errorDomain = adoptWK(WKStringCreateWithUTF8CString("NSURLErrorDomain")); + errorCode = -999; + } + + if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitPolicyError")) + errorDomain = adoptWK(WKStringCreateWithUTF8CString("WebKitErrorDomain")); + + InjectedBundle::shared().stringBuilder()->append("<NSError domain "); + InjectedBundle::shared().stringBuilder()->append(toWTFString(errorDomain)); + InjectedBundle::shared().stringBuilder()->append(", code "); + InjectedBundle::shared().stringBuilder()->append(String::number(errorCode)); + + WKRetainPtr<WKURLRef> url = adoptWK(WKErrorCopyFailingURL(error)); + if (url.get()) { + WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(url.get())); + InjectedBundle::shared().stringBuilder()->append(", failing URL \""); + InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString)); + InjectedBundle::shared().stringBuilder()->append("\""); + } + + InjectedBundle::shared().stringBuilder()->append(">"); +} + void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame); @@ -430,19 +548,24 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle { #if ENABLE(WEB_INTENTS) static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->m_currentIntentRequest = intentRequest; - WKRetainPtr<WKIntentDataRef> intent(AdoptWK, WKBundleIntentRequestCopyIntentData(intentRequest)); + WKRetainPtr<WKBundleIntentRef> intent(AdoptWK, WKBundleIntentRequestCopyIntent(intentRequest)); InjectedBundle::shared().stringBuilder()->append("Received Web Intent: action="); - WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(intent.get())); + WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKBundleIntentCopyAction(intent.get())); InjectedBundle::shared().stringBuilder()->append(toWTFString(wkAction.get())); InjectedBundle::shared().stringBuilder()->append(" type="); - WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(intent.get())); + WKRetainPtr<WKStringRef> wkType(AdoptWK, WKBundleIntentCopyType(intent.get())); InjectedBundle::shared().stringBuilder()->append(toWTFString(wkType.get())); InjectedBundle::shared().stringBuilder()->append("\n"); - // FIXME: Print number of ports when exposed in WebKit2 + const size_t numMessagePorts = WKBundleIntentMessagePortCount(intent.get()); + if (numMessagePorts) { + InjectedBundle::shared().stringBuilder()->append("Have "); + InjectedBundle::shared().stringBuilder()->append(WTF::String::number(numMessagePorts)); + InjectedBundle::shared().stringBuilder()->append(" ports\n"); + } - WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKIntentDataCopyService(intent.get())); + WKRetainPtr<WKURLRef> wkServiceUrl(AdoptWK, WKBundleIntentCopyService(intent.get())); if (wkServiceUrl) { WKRetainPtr<WKStringRef> wkService(AdoptWK, WKURLCopyString(wkServiceUrl.get())); if (wkService && !WKStringIsEmpty(wkService.get())) { @@ -452,7 +575,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle } } - WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKIntentDataCopyExtras(intent.get())); + WKRetainPtr<WKDictionaryRef> wkExtras(AdoptWK, WKBundleIntentCopyExtras(intent.get())); WKRetainPtr<WKArrayRef> wkExtraKeys(AdoptWK, WKDictionaryCopyKeys(wkExtras.get())); const size_t numExtraKeys = WKArrayGetSize(wkExtraKeys.get()); for (size_t i = 0; i < numExtraKeys; ++i) { @@ -465,7 +588,7 @@ void InjectedBundlePage::didReceiveIntentForFrame(WKBundlePageRef page, WKBundle InjectedBundle::shared().stringBuilder()->append("\n"); } - WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKIntentDataCopySuggestions(intent.get())); + WKRetainPtr<WKArrayRef> wkSuggestions(AdoptWK, WKBundleIntentCopySuggestions(intent.get())); const size_t numSuggestions = WKArrayGetSize(wkSuggestions.get()); for (size_t i = 0; i < numSuggestions; ++i) { WKStringRef wkSuggestion = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i)); @@ -580,7 +703,7 @@ void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef page, WKBundle void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKErrorRef error, const void* clientInfo) { - static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForResource(page, frame, identifier, error); + static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadForResource(page, frame, identifier, error); } void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame) @@ -588,7 +711,7 @@ void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didStartProvisionalLoadForFrame\n"); } @@ -611,7 +734,7 @@ void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRe return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().done(); @@ -622,7 +745,7 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -634,7 +757,7 @@ void InjectedBundlePage::didFinishProgress() if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpProgressFinishedCallback()) + if (!InjectedBundle::shared().testRunner()->shouldDumpProgressFinishedCallback()) return; InjectedBundle::shared().stringBuilder()->append("postProgressFinishedNotification\n"); @@ -742,7 +865,7 @@ void InjectedBundlePage::dump() { ASSERT(InjectedBundle::shared().isTestRunning()); - InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer(); + InjectedBundle::shared().testRunner()->invalidateWaitToDumpWatchdogTimer(); // Force a paint before dumping. This matches DumpRenderTree on Windows. (DumpRenderTree on Mac // does this at a slightly different time.) See <http://webkit.org/b/55469> for details. @@ -751,32 +874,32 @@ void InjectedBundlePage::dump() WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page); WTF::String url = toWTFString(adoptWK(WKURLCopyString(adoptWK(WKBundleFrameCopyURL(frame)).get()))); if (url.find("dumpAsText/") != WTF::notFound) - InjectedBundle::shared().layoutTestController()->dumpAsText(false); + InjectedBundle::shared().testRunner()->dumpAsText(false); - switch (InjectedBundle::shared().layoutTestController()->whatToDump()) { - case LayoutTestController::RenderTree: { + switch (InjectedBundle::shared().testRunner()->whatToDump()) { + case TestRunner::RenderTree: { WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page)); InjectedBundle::shared().stringBuilder()->append(toWTFString(text)); break; } - case LayoutTestController::MainFrameText: + case TestRunner::MainFrameText: dumpFrameText(WKBundlePageGetMainFrame(m_page)); break; - case LayoutTestController::AllFramesText: + case TestRunner::AllFramesText: dumpAllFramesText(); break; } - if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions()) + if (InjectedBundle::shared().testRunner()->shouldDumpAllFrameScrollPositions()) dumpAllFrameScrollPositions(); - else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition()) + else if (InjectedBundle::shared().testRunner()->shouldDumpMainFrameScrollPosition()) dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page)); - if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows()) + if (InjectedBundle::shared().testRunner()->shouldDumpBackForwardListsForAllWindows()) InjectedBundle::shared().dumpBackForwardListsForAllPages(); - if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().layoutTestController()->shouldDumpPixels()) { - InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotInViewCoordinates(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKImageOptionsShareable)).get()); + if (InjectedBundle::shared().shouldDumpPixels() && InjectedBundle::shared().testRunner()->shouldDumpPixels()) { + InjectedBundle::shared().setPixelResult(adoptWK(WKBundlePageCreateSnapshotWithOptions(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), kWKSnapshotOptionsShareable | kWKSnapshotOptionsInViewCoordinates)).get()); if (WKBundlePageIsTrackingRepaints(m_page)) InjectedBundle::shared().setRepaintRects(adoptWK(WKBundlePageCopyTrackedRepaintRects(m_page)).get()); } @@ -789,7 +912,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didFinishLoadForFrame\n"); } @@ -798,7 +921,7 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame) return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().page()->dump(); @@ -813,7 +936,7 @@ void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WK return; InjectedBundle::shared().setTopLoadingFrame(0); - if (InjectedBundle::shared().layoutTestController()->waitToDump()) + if (InjectedBundle::shared().testRunner()->waitToDump()) return; InjectedBundle::shared().done(); @@ -824,14 +947,14 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didReceiveTitle: "); InjectedBundle::shared().stringBuilder()->append(toWTFString(title)); InjectedBundle::shared().stringBuilder()->append("\n"); } - if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges()) + if (!InjectedBundle::shared().testRunner()->shouldDumpTitleChanges()) return; InjectedBundle::shared().stringBuilder()->append("TITLE CHANGED: "); @@ -848,12 +971,12 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundle JSObjectRef window = JSContextGetGlobalObject(context); if (WKBundleScriptWorldNormalWorld() != world) { - JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, LayoutTestController::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); + JSObjectSetProperty(context, window, toJS("__worldID").get(), JSValueMakeNumber(context, TestRunner::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0); return; } JSValueRef exception = 0; - InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception); + InjectedBundle::shared().testRunner()->makeWindowObject(context, window, &exception); InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception); InjectedBundle::shared().eventSendingController()->makeWindowObject(context, window, &exception); InjectedBundle::shared().textInputController()->makeWindowObject(context, window, &exception); @@ -871,7 +994,7 @@ void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -883,7 +1006,7 @@ void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef fram if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) return; dumpFrameDescriptionSuitableForTestResult(frame); @@ -901,7 +1024,7 @@ void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didFinishDocumentLoadForFrame\n"); } @@ -920,7 +1043,7 @@ void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundleFrameRef frame) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpFrameLoadCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpFrameLoadCallbacks()) { dumpFrameDescriptionSuitableForTestResult(frame); InjectedBundle::shared().stringBuilder()->append(" - didHandleOnloadEventsForFrame\n"); } @@ -938,8 +1061,16 @@ void InjectedBundlePage::didDetectXSSForFrame(WKBundleFrameRef frame) { } -void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, bool) +void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); + assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get())); } // Resource Load Client Callbacks @@ -954,11 +1085,23 @@ static inline bool isHTTPOrHTTPSScheme(WKStringRef scheme) return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "https"); } -WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t, WKURLRequestRef request, WKURLResponseRef) +WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response) { - if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull()) + if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().testRunner()->willSendRequestReturnsNull()) return 0; + if (InjectedBundle::shared().isTestRunning() + && InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) { + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - willSendRequest "); + dumpRequestDescriptionSuitableForTestResult(request); + InjectedBundle::shared().stringBuilder()->append(" redirectResponse "); + dumpResponseDescriptionSuitableForTestResult(response); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request)); WKRetainPtr<WKStringRef> host = adoptWK(WKURLCopyHostName(url.get())); WKRetainPtr<WKStringRef> scheme = adoptWK(WKURLCopyScheme(url.get())); @@ -990,12 +1133,22 @@ WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKB return request; } -void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLResponseRef response) +void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response) { if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceResponseMIMETypes()) + if (InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) { + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didReceiveResponse "); + dumpResponseDescriptionSuitableForTestResult(response); + InjectedBundle::shared().stringBuilder()->append("\n"); + } + + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceResponseMIMETypes()) return; WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response)); @@ -1012,12 +1165,35 @@ void InjectedBundlePage::didReceiveContentLengthForResource(WKBundlePageRef, WKB { } -void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t) +void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didFinishLoading\n"); } -void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKErrorRef) +void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef error) { + if (!InjectedBundle::shared().isTestRunning()) + return; + + if (!InjectedBundle::shared().testRunner()->shouldDumpResourceLoadCallbacks()) + return; + + InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier) + ? assignedUrlsCache.get(identifier) + : "<unknown>"); + InjectedBundle::shared().stringBuilder()->append(" - didFailLoadingWithError: "); + + dumpErrorDescriptionSuitableForTestResult(error); + InjectedBundle::shared().stringBuilder()->append("\n"); } @@ -1048,10 +1224,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB if (!InjectedBundle::shared().isTestRunning()) return WKBundlePagePolicyActionUse; - if (!InjectedBundle::shared().layoutTestController()->isPolicyDelegateEnabled()) + if (!InjectedBundle::shared().testRunner()->isPolicyDelegateEnabled()) return WKBundlePagePolicyActionUse; - if (InjectedBundle::shared().layoutTestController()->waitToDump()) { + if (InjectedBundle::shared().testRunner()->waitToDump()) { WKRetainPtr<WKStringRef> url = adoptWK(WKURLCopyString(WKURLRequestCopyURL(request))); InjectedBundle::shared().stringBuilder()->append("Policy delegate: attempt to load "); InjectedBundle::shared().stringBuilder()->append(toWTFString(url)); @@ -1065,10 +1241,10 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB } InjectedBundle::shared().stringBuilder()->append("\n"); - InjectedBundle::shared().layoutTestController()->notifyDone(); + InjectedBundle::shared().testRunner()->notifyDone(); } - if (InjectedBundle::shared().layoutTestController()->isPolicyDelegatePermissive()) + if (InjectedBundle::shared().testRunner()->isPolicyDelegatePermissive()) return WKBundlePagePolicyActionUse; return WKBundlePagePolicyActionPassThrough; } @@ -1161,7 +1337,7 @@ void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText) if (!InjectedBundle::shared().isTestRunning()) return; - if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks()) + if (!InjectedBundle::shared().testRunner()->shouldDumpStatusCallbacks()) return; InjectedBundle::shared().stringBuilder()->append("UI DELEGATE STATUS CALLBACK: setStatusText:"); @@ -1260,12 +1436,12 @@ bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldBeginEditingInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range) @@ -1273,12 +1449,12 @@ bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldEndEditingInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) @@ -1292,7 +1468,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa "WebViewInsertActionDropped", }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertNode:"); InjectedBundle::shared().stringBuilder()->append(dumpPath(m_page, m_world.get(), node)); InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:"); @@ -1301,7 +1477,7 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRa InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) @@ -1315,7 +1491,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR "WebViewInsertActionDropped", }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldInsertText:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(text)); InjectedBundle::shared().stringBuilder()->append(" replacingDOMRange:"); @@ -1324,7 +1500,7 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleR InjectedBundle::shared().stringBuilder()->append(insertactionstring[action]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range) @@ -1332,12 +1508,12 @@ bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range) if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldDeleteDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting) @@ -1354,7 +1530,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa "TRUE" }; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldChangeSelectedDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), fromRange)); InjectedBundle::shared().stringBuilder()->append(" toDOMRange:"); @@ -1365,7 +1541,7 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRa InjectedBundle::shared().stringBuilder()->append(boolstring[stillSelecting]); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range) @@ -1373,14 +1549,14 @@ bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, if (!InjectedBundle::shared().isTestRunning()) return true; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: shouldApplyStyle:"); InjectedBundle::shared().stringBuilder()->append(styleDecToStr(style)); InjectedBundle::shared().stringBuilder()->append(" toElementsInDOMRange:"); InjectedBundle::shared().stringBuilder()->append(rangeToStr(m_page, m_world.get(), range)); InjectedBundle::shared().stringBuilder()->append("\n"); } - return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); + return InjectedBundle::shared().testRunner()->shouldAllowEditing(); } void InjectedBundlePage::didBeginEditing(WKStringRef notificationName) @@ -1388,7 +1564,7 @@ void InjectedBundlePage::didBeginEditing(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidBeginEditing:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1400,7 +1576,7 @@ void InjectedBundlePage::didEndEditing(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidEndEditing:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1412,7 +1588,7 @@ void InjectedBundlePage::didChange(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChange:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1424,7 +1600,7 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName) if (!InjectedBundle::shared().isTestRunning()) return; - if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) { + if (InjectedBundle::shared().testRunner()->shouldDumpEditingCallbacks()) { InjectedBundle::shared().stringBuilder()->append("EDITING DELEGATE: webViewDidChangeSelection:"); InjectedBundle::shared().stringBuilder()->append(toWTFString(notificationName)); InjectedBundle::shared().stringBuilder()->append("\n"); @@ -1434,17 +1610,17 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName) #if ENABLE(FULLSCREEN_API) bool InjectedBundlePage::supportsFullScreen(WKBundlePageRef pageRef, WKFullScreenKeyboardRequestType requestType) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("supportsFullScreen() == true\n"); return true; } void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("enterFullScreenForElement()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillEnterFullScreen(pageRef); WKBundlePageDidEnterFullScreen(pageRef); } @@ -1452,10 +1628,10 @@ void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBu void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("exitFullScreenForElement()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillExitFullScreen(pageRef); WKBundlePageDidExitFullScreen(pageRef); } @@ -1463,22 +1639,22 @@ void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBun void InjectedBundlePage::beganEnterFullScreen(WKBundlePageRef, WKRect, WKRect) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("beganEnterFullScreen()\n"); } void InjectedBundlePage::beganExitFullScreen(WKBundlePageRef, WKRect, WKRect) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("beganExitFullScreen()\n"); } void InjectedBundlePage::closeFullScreen(WKBundlePageRef pageRef) { - if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks()) + if (InjectedBundle::shared().testRunner()->shouldDumpFullScreenCallbacks()) InjectedBundle::shared().stringBuilder()->append("closeFullScreen()\n"); - if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) { + if (!InjectedBundle::shared().testRunner()->hasCustomFullScreenBehavior()) { WKBundlePageWillExitFullScreen(pageRef); WKBundlePageDidExitFullScreen(pageRef); } diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri index 1a117de89..f46e44caa 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri @@ -22,14 +22,14 @@ SOURCES += \ EventSendingController.h \ GCController.cpp \ GCController.h \ - LayoutTestController.cpp \ - LayoutTestController.h \ + TestRunner.cpp \ + TestRunner.h \ TextInputController.cpp \ TextInputController.h \ Bindings/JSWrapper.cpp \ qt/ActivateFontsQt.cpp \ qt/InjectedBundleQt.cpp \ - qt/LayoutTestControllerQt.cpp + qt/TestRunnerQt.cpp # Adds the generated sources to SOURCES include(DerivedSources.pri) @@ -45,7 +45,7 @@ HEADERS += \ GCController.h \ InjectedBundle.h \ InjectedBundlePage.h \ - LayoutTestController.h \ + TestRunner.h \ TextInputController.h \ DESTDIR = $${ROOT_BUILD_DIR}/lib diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp index cdffcae08..b94e5d476 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp @@ -24,11 +24,11 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include "InjectedBundlePage.h" -#include "JSLayoutTestController.h" +#include "JSTestRunner.h" #include "PlatformWebView.h" #include "StringFunctions.h" #include "TestController.h" @@ -49,22 +49,22 @@ #include <wtf/text/StringBuilder.h> #if ENABLE(WEB_INTENTS) +#include <WebKit2/WKBundleIntent.h> #include <WebKit2/WKBundleIntentRequest.h> -#include <WebKit2/WKIntentData.h> #endif namespace WTR { // This is lower than DumpRenderTree's timeout, to make it easier to work through the failures // Eventually it should be changed to match. -const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6; +const double TestRunner::waitToDumpWatchdogTimerInterval = 6; -PassRefPtr<LayoutTestController> LayoutTestController::create() +PassRefPtr<TestRunner> TestRunner::create() { - return adoptRef(new LayoutTestController); + return adoptRef(new TestRunner); } -LayoutTestController::LayoutTestController() +TestRunner::TestRunner() : m_whatToDump(RenderTree) , m_shouldDumpAllFrameScrollPositions(false) , m_shouldDumpBackForwardListsForAllWindows(false) @@ -77,6 +77,7 @@ LayoutTestController::LayoutTestController() , m_dumpFullScreenCallbacks(false) , m_dumpFrameLoadCallbacks(false) , m_dumpProgressFinishedCallback(false) + , m_dumpResourceLoadCallbacks(false) , m_dumpResourceResponseMIMETypes(false) , m_waitToDump(false) , m_testRepaint(false) @@ -92,16 +93,16 @@ LayoutTestController::LayoutTestController() platformInitialize(); } -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -JSClassRef LayoutTestController::wrapperClass() +JSClassRef TestRunner::wrapperClass() { - return JSLayoutTestController::layoutTestControllerClass(); + return JSTestRunner::testRunnerClass(); } -void LayoutTestController::display() +void TestRunner::display() { WKBundlePageRef page = InjectedBundle::shared().page()->page(); WKBundlePageForceRepaint(page); @@ -109,7 +110,7 @@ void LayoutTestController::display() WKBundlePageResetTrackedRepaints(page); } -void LayoutTestController::dumpAsText(bool dumpPixels) +void TestRunner::dumpAsText(bool dumpPixels) { if (m_whatToDump < MainFrameText) m_whatToDump = MainFrameText; @@ -117,26 +118,26 @@ void LayoutTestController::dumpAsText(bool dumpPixels) } // FIXME: Needs a full implementation see https://bugs.webkit.org/show_bug.cgi?id=42546 -void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { m_policyDelegateEnabled = enabled; m_policyDelegatePermissive = permissive; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true); waitUntilDone(); } -void LayoutTestController::waitUntilDone() +void TestRunner::waitUntilDone() { m_waitToDump = true; if (InjectedBundle::shared().useWaitToDumpWatchdogTimer()) initializeWaitToDumpWatchdogTimerIfNeeded(); } -void LayoutTestController::waitToDumpWatchdogTimerFired() +void TestRunner::waitToDumpWatchdogTimerFired() { invalidateWaitToDumpWatchdogTimer(); const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; @@ -145,7 +146,7 @@ void LayoutTestController::waitToDumpWatchdogTimerFired() InjectedBundle::shared().done(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (!InjectedBundle::shared().isTestRunning()) return; @@ -156,7 +157,7 @@ void LayoutTestController::notifyDone() m_waitToDump = false; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -164,7 +165,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return WKBundleFrameGetNumberOfActiveAnimations(mainFrame); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -172,7 +173,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { // FIXME: Is it OK this works only for the main frame? // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? @@ -180,20 +181,20 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return WKBundleFramePauseTransitionOnElementWithId(mainFrame, toWK(propertyName).get(), toWK(elementId).get(), time); } -void LayoutTestController::suspendAnimations() +void TestRunner::suspendAnimations() { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); WKBundleFrameSuspendAnimations(mainFrame); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame)); return toJS(text); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); @@ -203,7 +204,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); @@ -212,12 +213,12 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSValueRef element) { // FIXME: Is it OK this works only for the main frame? WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); @@ -230,7 +231,7 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef el return value; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef element) +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSValueRef element) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); @@ -242,12 +243,12 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef return toJS(text); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument) +void TestRunner::execCommand(JSStringRef name, JSStringRef argument) { WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get()); } -bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArrayAsValue) +bool TestRunner::findString(JSStringRef target, JSValueRef optionsArrayAsValue) { WKFindOptions options = 0; @@ -285,117 +286,117 @@ bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArra return WKBundlePageFindString(InjectedBundle::shared().page()->page(), toWK(target).get(), options); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { WKBundleClearAllDatabases(InjectedBundle::shared().bundle()); } -void LayoutTestController::setDatabaseQuota(uint64_t quota) +void TestRunner::setDatabaseQuota(uint64_t quota) { return WKBundleSetDatabaseQuota(InjectedBundle::shared().bundle(), quota); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { WKBundleClearApplicationCache(InjectedBundle::shared().bundle()); } -void LayoutTestController::setAppCacheMaximumSize(uint64_t size) +void TestRunner::setAppCacheMaximumSize(uint64_t size) { WKBundleSetAppCacheMaximumSize(InjectedBundle::shared().bundle(), size); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get()); } -void LayoutTestController::setCanOpenWindows(bool) +void TestRunner::setCanOpenWindows(bool) { // It's not clear if or why any tests require opening windows be forbidden. // For now, just ignore this setting, and if we find later it's needed we can add it. } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitXSSAuditorEnabled")); WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), key.get(), enabled); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { WKBundleSetAllowUniversalAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { WKBundleSetAllowFileAccessFromFileURLs(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { WKBundleSetFrameFlatteningEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPluginsEnabled(bool enabled) +void TestRunner::setPluginsEnabled(bool enabled) { WKBundleSetPluginsEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setGeolocationPermission(bool enabled) +void TestRunner::setGeolocationPermission(bool enabled) { WKBundleSetGeolocationPermission(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { WKBundleSetJavaScriptCanAccessClipboard(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPrivateBrowsingEnabled(bool enabled) +void TestRunner::setPrivateBrowsingEnabled(bool enabled) { WKBundleSetPrivateBrowsingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setPopupBlockingEnabled(bool enabled) +void TestRunner::setPopupBlockingEnabled(bool enabled) { WKBundleSetPopupBlockingEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool enabled) +void TestRunner::setAuthorAndUserStylesEnabled(bool enabled) { WKBundleSetAuthorAndUserStylesEnabled(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), enabled); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WKBundleAddOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WKBundleRemoveOriginAccessWhitelistEntry(InjectedBundle::shared().bundle(), toWK(sourceOrigin).get(), toWK(destinationProtocol).get(), toWK(destinationHost).get(), allowDestinationSubdomains); } -int LayoutTestController::numberOfPages(double pageWidthInPixels, double pageHeightInPixels) +int TestRunner::numberOfPages(double pageWidthInPixels, double pageHeightInPixels) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels); } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return toJS(WKBundlePageSizeAndMarginsInPixels(InjectedBundle::shared().bundle(), mainFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft)); } -bool LayoutTestController::isPageBoxVisible(int pageIndex) +bool TestRunner::isPageBoxVisible(int pageIndex) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleIsPageBoxVisible(InjectedBundle::shared().bundle(), mainFrame, pageIndex); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) { if (!element || !JSValueIsObject(context, element)) return; @@ -404,38 +405,38 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem WKBundleNodeHandleSetHTMLInputElementValueForUser(nodeHandle.get(), toWK(value).get()); } -unsigned LayoutTestController::windowCount() +unsigned TestRunner::windowCount() { return InjectedBundle::shared().pageCount(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page())); } // Object Creation -void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) +void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { setProperty(context, windowObject, "testRunner", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { #if ENABLE(INSPECTOR) WKBundleInspectorShow(WKBundlePageGetInspector(InjectedBundle::shared().page()->page())); #endif // ENABLE(INSPECTOR) } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { #if ENABLE(INSPECTOR) WKBundleInspectorClose(WKBundlePageGetInspector(InjectedBundle::shared().page()->page())); #endif // ENABLE(INSPECTOR) } -void LayoutTestController::evaluateInWebInspector(long callID, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callID, JSStringRef script) { #if ENABLE(INSPECTOR) WKRetainPtr<WKStringRef> scriptWK = toWK(script); @@ -450,7 +451,7 @@ static WorldMap& worldMap() return map; } -unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world) +unsigned TestRunner::worldIDForWorld(WKBundleScriptWorldRef world) { WorldMap::const_iterator end = worldMap().end(); for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { @@ -461,7 +462,7 @@ unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned worldID, JSStringRef script) { // A worldID of 0 always corresponds to a new world. Any other worldID corresponds to a world // that is created once and cached forever. @@ -483,30 +484,30 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(JSContextRef context, u JSEvaluateScript(jsContext, script, 0, 0, 0, 0); } -void LayoutTestController::setPOSIXLocale(JSStringRef locale) +void TestRunner::setPOSIXLocale(JSStringRef locale) { char localeBuf[32]; JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf)); setlocale(LC_ALL, localeBuf); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); return WKBundleFrameSetTextDirection(mainFrame, toWK(direction).get()); } -void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage) +void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(bool shouldStayOnPage) { InjectedBundle::shared().postNewBeforeUnloadReturnValue(!shouldStayOnPage); } -void LayoutTestController::setDefersLoading(bool shouldDeferLoading) +void TestRunner::setDefersLoading(bool shouldDeferLoading) { WKBundlePageSetDefersLoading(InjectedBundle::shared().page()->page(), shouldDeferLoading); } -void LayoutTestController::setPageVisibility(JSStringRef state) +void TestRunner::setPageVisibility(JSStringRef state) { WebCore::PageVisibilityState visibilityState = WebCore::PageVisibilityStateVisible; @@ -520,7 +521,7 @@ void LayoutTestController::setPageVisibility(JSStringRef state) WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), visibilityState, /* isInitialState */ false); } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { WKBundleSetPageVisibilityState(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), WebCore::PageVisibilityStateVisible, /* isInitialState */ true); } @@ -539,7 +540,7 @@ enum { SetBackingScaleFactorCallbackID }; -static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callback) +static void cacheTestRunnerCallback(unsigned index, JSValueRef callback) { if (!callback) return; @@ -550,7 +551,7 @@ static void cacheLayoutTestControllerCallback(unsigned index, JSValueRef callbac callbackMap().add(index, callback); } -static void callLayoutTestControllerCallback(unsigned index) +static void callTestRunnerCallback(unsigned index) { if (!callbackMap().contains(index)) return; @@ -561,61 +562,61 @@ static void callLayoutTestControllerCallback(unsigned index) JSValueUnprotect(context, callback); } -void LayoutTestController::addChromeInputField(JSValueRef callback) +void TestRunner::addChromeInputField(JSValueRef callback) { - cacheLayoutTestControllerCallback(AddChromeInputFieldCallbackID, callback); + cacheTestRunnerCallback(AddChromeInputFieldCallbackID, callback); InjectedBundle::shared().postAddChromeInputField(); } -void LayoutTestController::removeChromeInputField(JSValueRef callback) +void TestRunner::removeChromeInputField(JSValueRef callback) { - cacheLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID, callback); + cacheTestRunnerCallback(RemoveChromeInputFieldCallbackID, callback); InjectedBundle::shared().postRemoveChromeInputField(); } -void LayoutTestController::focusWebView(JSValueRef callback) +void TestRunner::focusWebView(JSValueRef callback) { - cacheLayoutTestControllerCallback(FocusWebViewCallbackID, callback); + cacheTestRunnerCallback(FocusWebViewCallbackID, callback); InjectedBundle::shared().postFocusWebView(); } -void LayoutTestController::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback) +void TestRunner::setBackingScaleFactor(double backingScaleFactor, JSValueRef callback) { - cacheLayoutTestControllerCallback(SetBackingScaleFactorCallbackID, callback); + cacheTestRunnerCallback(SetBackingScaleFactorCallbackID, callback); InjectedBundle::shared().postSetBackingScaleFactor(backingScaleFactor); } -void LayoutTestController::setWindowIsKey(bool isKey) +void TestRunner::setWindowIsKey(bool isKey) { InjectedBundle::shared().postSetWindowIsKey(isKey); } -void LayoutTestController::callAddChromeInputFieldCallback() +void TestRunner::callAddChromeInputFieldCallback() { - callLayoutTestControllerCallback(AddChromeInputFieldCallbackID); + callTestRunnerCallback(AddChromeInputFieldCallbackID); } -void LayoutTestController::callRemoveChromeInputFieldCallback() +void TestRunner::callRemoveChromeInputFieldCallback() { - callLayoutTestControllerCallback(RemoveChromeInputFieldCallbackID); + callTestRunnerCallback(RemoveChromeInputFieldCallbackID); } -void LayoutTestController::callFocusWebViewCallback() +void TestRunner::callFocusWebViewCallback() { - callLayoutTestControllerCallback(FocusWebViewCallbackID); + callTestRunnerCallback(FocusWebViewCallbackID); } -void LayoutTestController::callSetBackingScaleFactorCallback() +void TestRunner::callSetBackingScaleFactorCallback() { - callLayoutTestControllerCallback(SetBackingScaleFactorCallbackID); + callTestRunnerCallback(SetBackingScaleFactorCallbackID); } -void LayoutTestController::overridePreference(JSStringRef preference, bool value) +void TestRunner::overridePreference(JSStringRef preference, bool value) { WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value); } -void LayoutTestController::sendWebIntentResponse(JSStringRef reply) +void TestRunner::sendWebIntentResponse(JSStringRef reply) { #if ENABLE(WEB_INTENTS) WKRetainPtr<WKBundleIntentRequestRef> currentRequest = InjectedBundle::shared().page()->currentIntentRequest(); @@ -636,7 +637,7 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef reply) #endif } -void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) +void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) { #if ENABLE(WEB_INTENTS) WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); @@ -651,22 +652,22 @@ void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("type"), typeWK.get()); WKDictionaryAddItem(intentInitDict.get(), WKStringCreateWithUTF8CString("data"), dataWK.get()); - WKRetainPtr<WKIntentDataRef> wkIntentData(AdoptWK, WKIntentDataCreate(intentInitDict.get())); - WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntentData.get()); + WKRetainPtr<WKBundleIntentRef> wkIntent(AdoptWK, WKBundleIntentCreate(intentInitDict.get())); + WKBundlePageDeliverIntentToFrame(InjectedBundle::shared().page()->page(), mainFrame, wkIntent.get()); #endif } -void LayoutTestController::setAlwaysAcceptCookies(bool accept) +void TestRunner::setAlwaysAcceptCookies(bool accept) { WKBundleSetAlwaysAcceptCookies(InjectedBundle::shared().bundle(), accept); } -double LayoutTestController::preciseTime() +double TestRunner::preciseTime() { return currentTime(); } -void LayoutTestController::setUserStyleSheetEnabled(bool enabled) +void TestRunner::setUserStyleSheetEnabled(bool enabled) { m_userStyleSheetEnabled = enabled; @@ -675,7 +676,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled) WKBundleSetUserStyleSheetLocation(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), location); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef location) +void TestRunner::setUserStyleSheetLocation(JSStringRef location) { m_userStyleSheetLocation = adoptWK(WKStringCreateWithJSString(location)); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h index 517a5160a..32b43ff69 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h @@ -23,8 +23,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef TestRunner_h +#define TestRunner_h #include "JSWrappable.h" #include <JavaScriptCore/JSRetainPtr.h> @@ -51,10 +51,10 @@ typedef Ecore_Timer* PlatformTimerRef; namespace WTR { -class LayoutTestController : public JSWrappable { +class TestRunner : public JSWrappable { public: - static PassRefPtr<LayoutTestController> create(); - virtual ~LayoutTestController(); + static PassRefPtr<TestRunner> create(); + virtual ~TestRunner(); // JSWrappable virtual JSClassRef wrapperClass(); @@ -79,6 +79,7 @@ public: void dumpFullScreenCallbacks() { m_dumpFullScreenCallbacks = true; } void dumpFrameLoadCallbacks() { setShouldDumpFrameLoadCallbacks(true); } void dumpProgressFinishedCallback() { setShouldDumpProgressFinishedCallback(true); } + void dumpResourceLoadCallbacks() { m_dumpResourceLoadCallbacks = true; } void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; } void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; } @@ -163,6 +164,7 @@ public: bool shouldDumpFullScreenCallbacks() const { return m_dumpFullScreenCallbacks; } bool shouldDumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; } bool shouldDumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; } + bool shouldDumpResourceLoadCallbacks() const { return m_dumpResourceLoadCallbacks; } bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; } bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; } @@ -230,7 +232,7 @@ public: private: static const double waitToDumpWatchdogTimerInterval; - LayoutTestController(); + TestRunner(); void platformInitialize(); void initializeWaitToDumpWatchdogTimerIfNeeded(); @@ -249,6 +251,7 @@ private: bool m_dumpFullScreenCallbacks; bool m_dumpFrameLoadCallbacks; bool m_dumpProgressFinishedCallback; + bool m_dumpResourceLoadCallbacks; bool m_dumpResourceResponseMIMETypes; bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called. bool m_testRepaint; @@ -270,4 +273,4 @@ private: } // namespace WTR -#endif // LayoutTestController_h +#endif // TestRunner_h diff --git a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp index b1b6f844a..4c0ea22f8 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp @@ -18,7 +18,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include <Ecore.h> @@ -27,16 +27,16 @@ namespace WTR { static Eina_Bool waitToDumpWatchdogTimerCallback(void*) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); return false; } -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -45,7 +45,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -54,12 +54,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() waitToDumpWatchdogTimerCallback, 0); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("efl")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp index d8d0ed5d0..301038294 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp @@ -25,7 +25,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" #include <glib.h> @@ -34,16 +34,16 @@ namespace WTR { static gboolean waitToDumpWatchdogTimerCallback(gpointer) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); return FALSE; } -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -51,7 +51,7 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -60,12 +60,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() waitToDumpWatchdogTimerCallback, 0); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm index b1e0265bf..dca27e6a0 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm +++ b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm @@ -23,17 +23,17 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" namespace WTR { -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -44,10 +44,10 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -56,12 +56,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return JSStringRetain(url); // Do nothing on mac. } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac")); return platformName; diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp index 5de8ae71a..f5d149b3d 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp @@ -25,7 +25,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "ActivateFonts.h" #include "InjectedBundle.h" @@ -47,17 +47,17 @@ public: return theInstance; } -public slots: +public Q_SLOTS: void timerFired() { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } private: WatchdogTimerHelper() {} }; -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { // Make WebKit2 mimic the behaviour of DumpRenderTree, which is incorrect, // but tests are successfully passed. On the long run, Qt will move to QRawFont, @@ -69,12 +69,12 @@ void LayoutTestController::platformInitialize() QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired())); } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { m_waitToDumpWatchdogTimer.stop(); } -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (qgetenv("QT_WEBKIT2_DEBUG") == "1") return; @@ -85,7 +85,7 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() m_waitToDumpWatchdogTimer.start(waitToDumpWatchdogTimerInterval * 1000); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { QString localTmpUrl(QStringLiteral("file:///tmp/LayoutTests")); QString givenUrl(reinterpret_cast<const QChar*>(JSStringGetCharactersPtr(url)), JSStringGetLength(url)); @@ -104,7 +104,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u return url; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("qt")); return platformName; @@ -112,4 +112,4 @@ JSRetainPtr<JSStringRef> LayoutTestController::platformName() } // namespace WTR -#include "LayoutTestControllerQt.moc" +#include "TestRunnerQt.moc" diff --git a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp index be9c414cf..225394276 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp @@ -24,18 +24,18 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "InjectedBundle.h" namespace WTR { -void LayoutTestController::platformInitialize() +void TestRunner::platformInitialize() { m_waitToDumpWatchdogTimer = 0; } -void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +void TestRunner::invalidateWaitToDumpWatchdogTimer() { if (!m_waitToDumpWatchdogTimer) return; @@ -46,12 +46,12 @@ void LayoutTestController::invalidateWaitToDumpWatchdogTimer() static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD) { - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); + InjectedBundle::shared().testRunner()->waitToDumpWatchdogTimerFired(); } static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1; -void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() { if (m_waitToDumpWatchdogTimer) return; @@ -59,12 +59,12 @@ void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired); } -JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef url) +JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) { return JSStringRetain(url); // TODO. } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() +JSRetainPtr<JSStringRef> TestRunner::platformName() { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win")); return platformName; diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake index e967d557c..084cb5045 100644 --- a/Tools/WebKitTestRunner/PlatformEfl.cmake +++ b/Tools/WebKitTestRunner/PlatformEfl.cmake @@ -3,7 +3,6 @@ LIST(APPEND WebKitTestRunner_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) ADD_CUSTOM_TARGET(forwarding-headersEflForWebKitTestRunner @@ -34,7 +33,7 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES ${ECORE_X_INCLUDE_DIRS} ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} - ${Glib_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} ) LIST(APPEND WebKitTestRunner_LIBRARIES @@ -42,7 +41,7 @@ LIST(APPEND WebKitTestRunner_LIBRARIES ${ECORE_X_LIBRARIES} ${EDJE_LIBRARIES} ${EFLDEPS_LIBRARIES} - ${Glib_LIBRARIES} + ${GLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${WTF_LIBRARY_NAME} ) @@ -52,7 +51,7 @@ LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/ActivateFontsEfl.cpp ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/InjectedBundleEfl.cpp - ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/LayoutTestControllerEfl.cpp + ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/TestRunnerEfl.cpp ) # FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj index 3ebf18e8c..be8262ff6 100644 --- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj +++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -71,13 +71,13 @@ BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; }; BC9192051333E4F8003011DC /* TestInvocationCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9192041333E4F8003011DC /* TestInvocationCG.cpp */; }; BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; }; - BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */; }; + BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */; }; BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; }; BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; }; - BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; }; + BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; }; BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; }; BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; }; - C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */; }; + C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -185,21 +185,21 @@ BC952C0C11F3B965003398B4 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapper.cpp; sourceTree = "<group>"; }; BC952C0E11F3B97B003398B4 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrappable.h; sourceTree = "<group>"; }; BC952EC511F3C10F003398B4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; }; - BC952ED211F3C29F003398B4 /* LayoutTestController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LayoutTestController.idl; sourceTree = "<group>"; }; + BC952ED211F3C29F003398B4 /* TestRunner.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestRunner.idl; sourceTree = "<group>"; }; BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; }; - BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSLayoutTestController.cpp; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; - BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSLayoutTestController.h; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.h; sourceTree = BUILT_PRODUCTS_DIR; }; + BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSTestRunner.cpp; path = DerivedSources/WebKitTestRunner/JSTestRunner.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; + BC952F1E11F3C652003398B4 /* JSTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTestRunner.h; path = DerivedSources/WebKitTestRunner/JSTestRunner.h; sourceTree = BUILT_PRODUCTS_DIR; }; BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; }; BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; }; BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; }; BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; }; BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePage.h; sourceTree = "<group>"; }; - BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; }; - BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; }; + BCC9981611D3F51E0017BCA2 /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestRunner.h; sourceTree = "<group>"; }; + BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; }; BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; }; BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; }; BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; + C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -324,9 +324,9 @@ BC8FD8C8120E527F00F3E71A /* EventSendingController.h */, BC14E4D9120E02D000826C0C /* GCController.cpp */, BC14E4D8120E02D000826C0C /* GCController.h */, - BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */, - BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */, - C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */, + BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */, + BCC9981611D3F51E0017BCA2 /* TestRunner.h */, + C0CE720A1247C93300BC0EC4 /* TestRunnerMac.mm */, 5664A49814326384008881BE /* TextInputController.cpp */, 5664A49914326384008881BE /* TextInputController.h */, ); @@ -412,7 +412,7 @@ 29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */, BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */, BC14E4E1120E032000826C0C /* GCController.idl */, - BC952ED211F3C29F003398B4 /* LayoutTestController.idl */, + BC952ED211F3C29F003398B4 /* TestRunner.idl */, 5664A49614326377008881BE /* TextInputController.idl */, ); path = Bindings; @@ -433,8 +433,8 @@ BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */, BC14E4E8120E03D800826C0C /* JSGCController.cpp */, BC14E4E9120E03D800826C0C /* JSGCController.h */, - BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */, - BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */, + BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */, + BC952F1E11F3C652003398B4 /* JSTestRunner.h */, 5641E2CE14335E95008307E5 /* JSTextInputController.cpp */, 5641E2CF14335E95008307E5 /* JSTextInputController.h */, ); @@ -577,16 +577,16 @@ BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */, BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */, BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */, - BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */, + BCC9981811D3F51E0017BCA2 /* TestRunner.cpp in Sources */, 65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */, BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */, - BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */, + BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */, BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */, BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */, BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */, BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */, BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */, - C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */, + C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */, 5664A49A14326384008881BE /* TextInputController.cpp in Sources */, 5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */, 29210EAE144CACB700835BB5 /* AccessibilityUIElement.cpp in Sources */, diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index 8a752a831..21ed91bb1 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -48,7 +48,7 @@ public: connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status))); } -private slots: +private Q_SLOTS: void handleStatusChanged(QQuickView::Status status) { if (status != QQuickView::Ready) diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp index 1da12a7b2..d7abf16e6 100644 --- a/Tools/WebKitTestRunner/qt/main.cpp +++ b/Tools/WebKitTestRunner/qt/main.cpp @@ -55,7 +55,7 @@ public: delete m_controller; } -public slots: +public Q_SLOTS: void launch() { m_controller = new WTR::TestController(m_argc, const_cast<const char**>(m_argv)); diff --git a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj index 045ad6d52..c20bad946 100644 --- a/Tools/WebKitTestRunner/win/InjectedBundle.vcproj +++ b/Tools/WebKitTestRunner/win/InjectedBundle.vcproj @@ -718,7 +718,7 @@ > </File> <File - RelativePath="..\InjectedBundle\Bindings\LayoutTestController.idl" + RelativePath="..\InjectedBundle\Bindings\TestRunner.idl" > <FileConfiguration Name="Debug|Win32" @@ -874,11 +874,11 @@ > </File> <File - RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.cpp" + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.cpp" > </File> <File - RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.h" + RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTestRunner.h" > </File> <File @@ -967,15 +967,15 @@ > </File> <File - RelativePath="..\InjectedBundle\LayoutTestController.cpp" + RelativePath="..\InjectedBundle\TestRunner.cpp" > </File> <File - RelativePath="..\InjectedBundle\LayoutTestController.h" + RelativePath="..\InjectedBundle\TestRunner.h" > </File> <File - RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp" + RelativePath="..\InjectedBundle\win\TestRunnerWin.cpp" > </File> <File |