diff options
Diffstat (limited to 'WebKitTools/WebKitTestRunner/InjectedBundle')
5 files changed, 5 insertions, 64 deletions
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl index acc2f47..583eb0a 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl @@ -73,9 +73,6 @@ module WTR { // Compositing testing. DOMString layerTreeAsText(); - - // Text search testing. - boolean findString(in DOMString target, in object optionsArray); }; } diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 49d9db6..6bc1802 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -61,11 +61,6 @@ void InjectedBundle::willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, c static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page); } -void InjectedBundle::didInitializePageGroup(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, const void* clientInfo) -{ - static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didInitializePageGroup(pageGroup); -} - void InjectedBundle::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo) { static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(messageName, messageBody); @@ -80,7 +75,6 @@ void InjectedBundle::initialize(WKBundleRef bundle) this, didCreatePage, willDestroyPage, - didInitializePageGroup, didReceiveMessage }; WKBundleSetClient(m_bundle, &client); @@ -105,11 +99,6 @@ void InjectedBundle::willDestroyPage(WKBundlePageRef page) } } -void InjectedBundle::didInitializePageGroup(WKBundlePageGroupRef pageGroup) -{ - m_pageGroup = pageGroup; -} - InjectedBundlePage* InjectedBundle::page() const { // It might be better to have the UI process send over a reference to the main @@ -148,7 +137,7 @@ void InjectedBundle::beginTesting() WKBundleSetShouldTrackVisitedLinks(m_bundle, false); WKBundleRemoveAllVisitedLinks(m_bundle); - WKBundleRemoveAllUserContent(m_bundle, m_pageGroup); + WKBundleRemoveAllUserContent(m_bundle); page()->reset(); } diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h index c1d8b37..2c6d14b 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h @@ -48,7 +48,6 @@ public: void initialize(WKBundleRef); WKBundleRef bundle() const { return m_bundle; } - WKBundlePageGroupRef pageGroup() const { return m_pageGroup; } LayoutTestController* layoutTestController() { return m_layoutTestController.get(); } GCController* gcController() { return m_gcController.get(); } @@ -71,18 +70,15 @@ private: static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo); static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo); - static void didInitializePageGroup(WKBundleRef, WKBundlePageGroupRef, const void* clientInfo); - static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo); + static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo); void didCreatePage(WKBundlePageRef); void willDestroyPage(WKBundlePageRef); - void didInitializePageGroup(WKBundlePageGroupRef); void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody); void beginTesting(); WKBundleRef m_bundle; - WKBundlePageGroupRef m_pageGroup; Vector<OwnPtr<InjectedBundlePage> > m_pages; RefPtr<LayoutTestController> m_layoutTestController; diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp index 60e3130..de37383 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp @@ -174,7 +174,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); - WKBundleAddUserScript(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, + WKBundleAddUserScript(InjectedBundle::shared().bundle(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, (runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd), (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } @@ -184,7 +184,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) WKRetainPtr<WKStringRef> sourceWK = toWK(source); WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld()); - WKBundleAddUserStyleSheet(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, + WKBundleAddUserStyleSheet(InjectedBundle::shared().bundle(), scriptWorld.get(), sourceWK.get(), 0, 0, 0, (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly)); } @@ -233,44 +233,6 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument) WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get()); } -bool LayoutTestController::findString(JSStringRef target, JSValueRef optionsArrayAsValue) -{ - WKFindOptions options = 0; - - WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); - JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); - JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length")); - JSObjectRef optionsArray = JSValueToObject(context, optionsArrayAsValue, 0); - JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0); - if (!JSValueIsNumber(context, lengthValue)) - return false; - - size_t length = static_cast<size_t>(JSValueToNumber(context, lengthValue, 0)); - for (size_t i = 0; i < length; ++i) { - JSValueRef value = JSObjectGetPropertyAtIndex(context, optionsArray, i, 0); - if (!JSValueIsString(context, value)) - continue; - - JSRetainPtr<JSStringRef> optionName(Adopt, JSValueToStringCopy(context, value, 0)); - - if (JSStringIsEqualToUTF8CString(optionName.get(), "CaseInsensitive")) - options |= kWKFindOptionsCaseInsensitive; - else if (JSStringIsEqualToUTF8CString(optionName.get(), "AtWordStarts")) - options |= kWKFindOptionsAtWordStarts; - else if (JSStringIsEqualToUTF8CString(optionName.get(), "TreatMedialCapitalAsWordStart")) - options |= kWKFindOptionsTreatMedialCapitalAsWordStart; - else if (JSStringIsEqualToUTF8CString(optionName.get(), "Backwards")) - options |= kWKFindOptionsBackwards; - else if (JSStringIsEqualToUTF8CString(optionName.get(), "WrapAround")) - options |= kWKFindOptionsWrapAround; - else if (JSStringIsEqualToUTF8CString(optionName.get(), "StartInSelection")) { - // FIXME: No kWKFindOptionsStartInSelection. - } - } - - return WKBundlePageFindString(InjectedBundle::shared().page()->page(), toWK(target).get(), options); -} - bool LayoutTestController::isCommandEnabled(JSStringRef name) { return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get()); @@ -284,7 +246,7 @@ void LayoutTestController::setCanOpenWindows(bool) void LayoutTestController::setXSSAuditorEnabled(bool enabled) { - WKBundleOverrideXSSAuditorEnabledForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), true); + WKBundleOverrideXSSAuditorEnabledForTestRunner(InjectedBundle::shared().bundle(), true); } unsigned LayoutTestController::windowCount() diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h index 2aaad08..427d05e 100644 --- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h +++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h @@ -101,9 +101,6 @@ public: void addUserScript(JSStringRef source, bool runAtStart, bool allFrames); void addUserStyleSheet(JSStringRef source, bool allFrames); - // Text search testing. - bool findString(JSStringRef, JSValueRef optionsArray); - enum WhatToDump { RenderTree, MainFrameText, AllFramesText }; WhatToDump whatToDump() const { return m_whatToDump; } |