diff options
author | Steve Block <steveblock@google.com> | 2010-09-29 17:32:26 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-29 17:35:08 +0100 |
commit | 68513a70bcd92384395513322f1b801e7bf9c729 (patch) | |
tree | 161b50f75a5921d61731bb25e730005994fcec85 /WebKitTools/WebKitTestRunner | |
parent | fd5c6425ce58eb75211be7718d5dee960842a37e (diff) | |
download | external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.zip external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.gz external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.bz2 |
Merge WebKit at r67908: Initial merge by Git
Change-Id: I43a553e7b3299b28cb6ee8aa035ed70fe342b972
Diffstat (limited to 'WebKitTools/WebKitTestRunner')
11 files changed, 334 insertions, 154 deletions
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp index 472cf6c..73de45b 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp @@ -92,30 +92,38 @@ void EventSendingController::leapForward(JSContextRef context, size_t argumentCo void EventSendingController::textZoomIn() { - WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly); - float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page()); - WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio); + // Ensure page zoom is reset. + WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1); + + double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page()); + WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio); } void EventSendingController::textZoomOut() { - WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly); - float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page()); - WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio); + // Ensure page zoom is reset. + WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1); + + double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page()); + WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio); } void EventSendingController::zoomPageIn() { - WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage); - float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page()); - WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio); + // Ensure text zoom is reset. + WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1); + + double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page()); + WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio); } void EventSendingController::zoomPageOut() { - WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage); - float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page()); - WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio); + // Ensure text zoom is reset. + WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1); + + double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page()); + WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio); } // Object Creation diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index bf7a029..dd92eca 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -31,54 +31,97 @@ #include <WebKit2/WKArray.h> #include <WebKit2/WKBundleFrame.h> #include <WebKit2/WKBundleFramePrivate.h> -#include <WebKit2/WKBundleNode.h> #include <WebKit2/WKBundlePagePrivate.h> -#include <WebKit2/WKRetainPtr.h> -#include <WebKit2/WKBundleRange.h> -#include <WebKit2/WKBundleScriptWorld.h> using namespace std; namespace WTR { -static ostream& operator<<(ostream& out, WKBundleFrameRef frame) +static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName) { - WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame)); - if (WKBundleFrameIsMainFrame(frame)) { - if (!WKStringIsEmpty(name.get())) - out << "main frame \"" << name << "\""; - else - out << "main frame"; - } else { - if (!WKStringIsEmpty(name.get())) - out << "frame \"" << name << "\""; - else - out << "frame (anonymous)"; - } + if (!object) + return 0; + JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName)); + return JSObjectGetProperty(context, object, propertyNameString.get(), 0); +} - return out; +static double propertyValueDouble(JSContextRef context, JSObjectRef object, const char* propertyName) +{ + JSValueRef value = propertyValue(context, object, propertyName); + if (!value) + return 0; + return JSValueToNumber(context, value, 0); } -static string dumpPath(WKBundleNodeRef node) +static int propertyValueInt(JSContextRef context, JSObjectRef object, const char* propertyName) { - if (!node) - return "(null)"; - WKRetainPtr<WKStringRef> nodeName(AdoptWK, WKBundleNodeCopyNodeName(node)); + return static_cast<int>(propertyValueDouble(context, object, propertyName)); +} + +static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName) +{ + JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame); + return propertyValueDouble(context, JSContextGetGlobalObject(context), propertyName); +} + +static string dumpPath(JSGlobalContextRef context, JSObjectRef nodeValue) +{ + JSValueRef nodeNameValue = propertyValue(context, nodeValue, "nodeName"); + JSRetainPtr<JSStringRef> jsStringNodeName(Adopt, JSValueToStringCopy(context, nodeNameValue, 0)); + WKRetainPtr<WKStringRef> nodeName = toWK(jsStringNodeName); + + JSValueRef parentNode = propertyValue(context, nodeValue, "parentNode"); + ostringstream out; out << nodeName; - if (WKBundleNodeRef parent = WKBundleNodeGetParent(node)) - out << " > " << dumpPath(parent); + + if (parentNode && JSValueIsObject(context, parentNode)) + out << " > " << dumpPath(context, (JSObjectRef)parentNode); + return out.str(); } -static ostream& operator<<(ostream& out, WKBundleRangeRef rangeRef) +static string dumpPath(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleNodeHandleRef node) { - if (rangeRef) - out << "range from " << WKBundleRangeGetStartOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetStartContainer(rangeRef)) << " to " << WKBundleRangeGetEndOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetEndContainer(rangeRef)); - else - out << "(null)"; + if (!node) + return "(null)"; - return out; + WKBundleFrameRef frame = WKBundlePageGetMainFrame(page); + + JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world); + JSValueRef nodeValue = WKBundleFrameGetJavaScriptWrapperForNodeForWorld(frame, node, world); + ASSERT(JSValueIsObject(context, nodeValue)); + JSObjectRef nodeObject = (JSObjectRef)nodeValue; + + return dumpPath(context, nodeObject); +} + +static string toStr(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleRangeHandleRef rangeRef) +{ + if (!rangeRef) + return "(null)"; + + WKBundleFrameRef frame = WKBundlePageGetMainFrame(page); + + JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world); + JSValueRef rangeValue = WKBundleFrameGetJavaScriptWrapperForRangeForWorld(frame, rangeRef, world); + ASSERT(JSValueIsObject(context, rangeValue)); + JSObjectRef rangeObject = (JSObjectRef)rangeValue; + + JSValueRef startNodeValue = propertyValue(context, rangeObject, "startContainer"); + ASSERT(JSValueIsObject(context, startNodeValue)); + JSObjectRef startNodeObject = (JSObjectRef)startNodeValue; + + JSValueRef endNodeValue = propertyValue(context, rangeObject, "endContainer"); + ASSERT(JSValueIsObject(context, endNodeValue)); + JSObjectRef endNodeObject = (JSObjectRef)endNodeValue; + + int startOffset = propertyValueInt(context, rangeObject, "startOffset"); + int endOffset = propertyValueInt(context, rangeObject, "endOffset"); + + ostringstream out; + out << "range from " << startOffset << " of " << dumpPath(context, startNodeObject) << " to " << endOffset << " of " << dumpPath(context, endNodeObject); + return out.str(); } static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style) @@ -90,8 +133,27 @@ static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style) return out; } +static ostream& operator<<(ostream& out, WKBundleFrameRef frame) +{ + WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame)); + if (WKBundleFrameIsMainFrame(frame)) { + if (!WKStringIsEmpty(name.get())) + out << "main frame \"" << name << "\""; + else + out << "main frame"; + } else { + if (!WKStringIsEmpty(name.get())) + out << "frame \"" << name << "\""; + else + out << "frame (anonymous)"; + } + + return out; +} + InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) : m_page(page) + , m_world(AdoptWK, WKBundleScriptWorldCreateWorld()) , m_isLoading(false) { WKBundlePageLoaderClient loaderClient = { @@ -105,6 +167,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) didFinishLoadForFrame, didFailLoadWithErrorForFrame, didReceiveTitleForFrame, + 0, + 0, didClearWindowForFrame, didCancelClientRedirectForFrame, willPerformClientRedirectForFrame, @@ -158,43 +222,48 @@ void InjectedBundlePage::reset() { WKBundlePageClearMainFrameName(m_page); - WKBundlePageSetZoomFactor(m_page, 1.0f); - WKBundlePageSetZoomMode(m_page, kWKBundlePageZoomModePage); + WKBundlePageSetPageZoomFactor(m_page, 1); + WKBundlePageSetTextZoomFactor(m_page, 1); } // Loader Client Callbacks -void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame); } -void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveServerRedirectForProvisionalLoadForFrame(frame); } -void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailProvisionalLoadWithErrorForFrame(frame); } -void InjectedBundlePage::didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didCommitLoadForFrame(frame); } -void InjectedBundlePage::didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(frame); } -void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo) +{ + static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame); +} + +void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadWithErrorForFrame(frame); } -void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo) +void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame); } @@ -219,11 +288,6 @@ void InjectedBundlePage::didChangeLocationWithinPageForFrame(WKBundlePageRef pag static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeLocationWithinPageForFrame(frame); } -void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo) -{ - static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame); -} - void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo) { static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didHandleOnloadEventsForFrame(frame); @@ -261,25 +325,6 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame) { } -static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName) -{ - if (!object) - return 0; - JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName)); - JSValueRef exception; - return JSObjectGetProperty(context, object, propertyNameString.get(), &exception); -} - -static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName) -{ - JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame); - JSValueRef value = propertyValue(context, JSContextGetGlobalObject(context), propertyName); - if (!value) - return 0; - JSValueRef exception; - return JSValueToNumber(context, value, &exception); -} - enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName }; static void dumpFrameScrollPosition(WKBundleFrameRef frame, FrameNamePolicy shouldIncludeFrameName = ShouldNotIncludeFrameName) @@ -343,7 +388,7 @@ void InjectedBundlePage::dump() { ASSERT(InjectedBundle::shared().isTestRunning()); - InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdog(); + InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer(); switch (InjectedBundle::shared().layoutTestController()->whatToDump()) { case LayoutTestController::RenderTree: { @@ -534,37 +579,37 @@ void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRe // Editor Client Callbacks -bool InjectedBundlePage::shouldBeginEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo) +bool InjectedBundlePage::shouldBeginEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldBeginEditing(range); } -bool InjectedBundlePage::shouldEndEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo) +bool InjectedBundlePage::shouldEndEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldEndEditing(range); } -bool InjectedBundlePage::shouldInsertNode(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo) +bool InjectedBundlePage::shouldInsertNode(WKBundlePageRef page, WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertNode(node, rangeToReplace, action); } -bool InjectedBundlePage::shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo) +bool InjectedBundlePage::shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertText(text, rangeToReplace, action); } -bool InjectedBundlePage::shouldDeleteRange(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo) +bool InjectedBundlePage::shouldDeleteRange(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldDeleteRange(range); } -bool InjectedBundlePage::shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo) +bool InjectedBundlePage::shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting); } -bool InjectedBundlePage::shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo) +bool InjectedBundlePage::shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo) { return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldApplyStyle(style, range); } @@ -589,27 +634,27 @@ void InjectedBundlePage::didChangeSelection(WKBundlePageRef page, WKStringRef no static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeSelection(notificationName); } -bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range) +bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range) { if (!InjectedBundle::shared().isTestRunning()) return true; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << range << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range) +bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range) { if (!InjectedBundle::shared().isTestRunning()) return true; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action) +bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) { if (!InjectedBundle::shared().isTestRunning()) return true; @@ -621,11 +666,11 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef }; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(node) << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(m_page, m_world.get(), node) << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action) +bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action) { if (!InjectedBundle::shared().isTestRunning()) return true; @@ -637,21 +682,21 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef ran }; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range) +bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range) { if (!InjectedBundle::shared().isTestRunning()) return true; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << toStr(m_page, m_world.get(), range) << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting) +bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting) { if (!InjectedBundle::shared().isTestRunning()) return true; @@ -666,17 +711,17 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, W }; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << fromRange << " toDOMRange:" << toRange << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << toStr(m_page, m_world.get(), fromRange) << " toDOMRange:" << toStr(m_page, m_world.get(), toRange) << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } -bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range) +bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range) { if (!InjectedBundle::shared().isTestRunning()) return true; if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) - InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n"; + InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n"; return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); } diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h index cde1655..c814c85 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h @@ -27,6 +27,8 @@ #define InjectedBundlePage_h #include <WebKit2/WKBundlePage.h> +#include <WebKit2/WKBundleScriptWorld.h> +#include <WebKit2/WKRetainPtr.h> namespace WTR { @@ -45,18 +47,18 @@ public: private: // Loader Client - static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, const void*); + static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didFinishDocumentLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); + static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, WKTypeRef*, const void*); static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void*); static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*); static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); - static void didFinishDocumentLoadForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); @@ -89,24 +91,24 @@ private: void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef); // Editor client - static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); - static bool shouldEndEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); - static bool shouldInsertNode(WKBundlePageRef, WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo); - static bool shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo); - static bool shouldDeleteRange(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); - static bool shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo); - static bool shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo); + static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo); + static bool shouldEndEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo); + static bool shouldInsertNode(WKBundlePageRef, WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo); + static bool shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo); + static bool shouldDeleteRange(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo); + static bool shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo); + static bool shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo); static void didBeginEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); static void didEndEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); static void didChange(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); static void didChangeSelection(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); - bool shouldBeginEditing(WKBundleRangeRef); - bool shouldEndEditing(WKBundleRangeRef); - bool shouldInsertNode(WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType); - bool shouldInsertText(WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType); - bool shouldDeleteRange(WKBundleRangeRef); - bool shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting); - bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range); + bool shouldBeginEditing(WKBundleRangeHandleRef); + bool shouldEndEditing(WKBundleRangeHandleRef); + bool shouldInsertNode(WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType); + bool shouldInsertText(WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType); + bool shouldDeleteRange(WKBundleRangeHandleRef); + bool shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting); + bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range); void didBeginEditing(WKStringRef notificationName); void didEndEditing(WKStringRef notificationName); void didChange(WKStringRef notificationName); @@ -116,6 +118,7 @@ private: void dumpAllFrameScrollPositions(); WKBundlePageRef m_page; + WKRetainPtr<WKBundleScriptWorldRef> m_world; bool m_isLoading; }; diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp index d54bb1d..f8cbd4f 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp @@ -41,7 +41,7 @@ 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. -static const CFTimeInterval waitToDumpWatchdogInterval = 6.0; +const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6; static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName) { @@ -94,6 +94,7 @@ LayoutTestController::LayoutTestController() , m_testRepaint(false) , m_testRepaintSweepHorizontally(false) { + platformInitialize(); } LayoutTestController::~LayoutTestController() @@ -110,32 +111,15 @@ void LayoutTestController::display() // FIXME: actually implement, once we want pixel tests } -void LayoutTestController::invalidateWaitToDumpWatchdog() -{ - if (m_waitToDumpWatchdog) { - CFRunLoopTimerInvalidate(m_waitToDumpWatchdog.get()); - m_waitToDumpWatchdog = 0; - } -} - -static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) -{ - InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); -} - void LayoutTestController::waitUntilDone() { m_waitToDump = true; - if (!m_waitToDumpWatchdog) { - m_waitToDumpWatchdog.adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, - 0, 0, 0, waitUntilDoneWatchdogFired, NULL)); - CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdog.get(), kCFRunLoopCommonModes); - } + initializeWaitToDumpWatchdogTimerIfNeeded(); } void LayoutTestController::waitToDumpWatchdogTimerFired() { - invalidateWaitToDumpWatchdog(); + invalidateWaitToDumpWatchdogTimer(); const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; InjectedBundle::shared().os() << message << "\n"; InjectedBundle::shared().done(); diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h index 2c112a7..6ae20d8 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h @@ -97,15 +97,20 @@ public: bool waitToDump() const { return m_waitToDump; } void waitToDumpWatchdogTimerFired(); - void invalidateWaitToDumpWatchdog(); + void invalidateWaitToDumpWatchdogTimer(); bool shouldAllowEditing() const { return m_shouldAllowEditing; } bool shouldCloseExtraWindowsAfterRunningTest() const { return m_shouldCloseExtraWindows; } private: + static const double waitToDumpWatchdogTimerInterval; + LayoutTestController(); + void platformInitialize(); + void initializeWaitToDumpWatchdogTimerIfNeeded(); + WhatToDump m_whatToDump; bool m_shouldDumpAllFrameScrollPositions; @@ -119,7 +124,11 @@ private: bool m_testRepaint; bool m_testRepaintSweepHorizontally; - RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdog; +#if PLATFORM(MAC) + RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdogTimer; +#elif PLATFORM(WIN) + UINT_PTR m_waitToDumpWatchdogTimer; +#endif }; } // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm new file mode 100644 index 0000000..2eb4d5b --- /dev/null +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "LayoutTestController.h" + +#include "InjectedBundle.h" + +namespace WTR { + +void LayoutTestController::platformInitialize() +{ +} + +void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +{ + if (!m_waitToDumpWatchdogTimer) + return; + + CFRunLoopTimerInvalidate(m_waitToDumpWatchdogTimer.get()); + m_waitToDumpWatchdogTimer = 0; +} + +static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info) +{ + InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); +} + +void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +{ + if (m_waitToDumpWatchdogTimer) + return; + + m_waitToDumpWatchdogTimer.adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogTimerInterval, 0, 0, 0, WTR::waitUntilDoneWatchdogTimerFired, NULL)); + CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes); +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp new file mode 100644 index 0000000..39cd727 --- /dev/null +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "LayoutTestController.h" + +#include "InjectedBundle.h" + +namespace WTR { + +void LayoutTestController::platformInitialize() +{ + m_waitToDumpWatchdogTimer = 0; +} + +void LayoutTestController::invalidateWaitToDumpWatchdogTimer() +{ + if (!m_waitToDumpWatchdogTimer) + return; + + ::KillTimer(0, m_waitToDumpWatchdogTimer); + m_waitToDumpWatchdogTimer = 0; +} + +static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD) +{ + InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired(); +} + +static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1; + +void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded() +{ + if (m_waitToDumpWatchdogTimer) + return; + + m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired); +} + +} // namespace WTR diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp index 6f97b9f..a71b07d 100644 --- a/WebKitTools/WebKitTestRunner/TestController.cpp +++ b/WebKitTools/WebKitTestRunner/TestController.cpp @@ -83,6 +83,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*) 0, 0, 0, + 0, 0 }; WKPageSetPageUIClient(newPage, &otherPageUIClient); @@ -142,7 +143,8 @@ void TestController::initialize(int argc, const char* argv[]) WKContextInjectedBundleClient injectedBundleClient = { 0, this, - didReceiveMessageFromInjectedBundle + didReceiveMessageFromInjectedBundle, + 0 }; WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient); @@ -160,6 +162,7 @@ void TestController::initialize(int argc, const char* argv[]) 0, 0, 0, + 0, 0 }; WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient); @@ -247,7 +250,7 @@ void TestController::run() // WKContextInjectedBundleClient -void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) +void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo) { static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody); } @@ -259,7 +262,7 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName // WKPageLoaderClient -void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo) +void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef, const void* clientInfo) { static_cast<TestController*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(page, frame); } diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h index 5f6d99d..a9e6ab3 100644 --- a/WebKitTools/WebKitTestRunner/TestController.h +++ b/WebKitTools/WebKitTestRunner/TestController.h @@ -75,7 +75,7 @@ private: void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody); // WKPageLoaderClient - static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void*); + static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*); void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame); diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj index f5ee6d5..6ecbef9 100644 --- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj +++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -54,6 +54,7 @@ BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.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 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -132,6 +133,7 @@ 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>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -223,6 +225,7 @@ BC14E4D8120E02D000826C0C /* GCController.h */, BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */, BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */, + C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */, ); name = Controllers; sourceTree = "<group>"; @@ -443,6 +446,7 @@ BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */, BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */, BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */, + C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj index 71dcf95..22c9a89 100644 --- a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj +++ b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj @@ -317,39 +317,39 @@ >
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundle.cpp"
+ RelativePath="..\InjectedBundle\EventSendingController.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundle.h"
+ RelativePath="..\InjectedBundle\EventSendingController.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundleMain.cpp"
+ RelativePath="..\InjectedBundle\GCController.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundlePage.cpp"
+ RelativePath="..\InjectedBundle\GCController.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\InjectedBundlePage.h"
+ RelativePath="..\InjectedBundle\InjectedBundle.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\EventSendingController.cpp"
+ RelativePath="..\InjectedBundle\InjectedBundle.h"
>
</File>
<File
- RelativePath="..\InjectedBundle\EventSendingController.h"
+ RelativePath="..\InjectedBundle\InjectedBundleMain.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\GCController.cpp"
+ RelativePath="..\InjectedBundle\InjectedBundlePage.cpp"
>
</File>
<File
- RelativePath="..\InjectedBundle\GCController.h"
+ RelativePath="..\InjectedBundle\InjectedBundlePage.h"
>
</File>
<File
@@ -360,6 +360,10 @@ RelativePath="..\InjectedBundle\LayoutTestController.h"
>
</File>
+ <File
+ RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp"
+ >
+ </File>
</Files>
<Globals>
</Globals>
|