summaryrefslogtreecommitdiffstats
path: root/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-01-05 12:15:11 +0000
committerSteve Block <steveblock@google.com>2011-01-06 14:14:00 +0000
commitd06194330da2bb8da887d2e1adeacb3a5c1504b2 (patch)
treee0af8413af65a8e30630563441af7bdb8478e513 /WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
parent419a5cf2f8db6ca014df624865197ffb82caad37 (diff)
downloadexternal_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.zip
external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.gz
external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.bz2
Merge WebKit at r72805: Initial merge by Git
Note that this is a backwards merge from Chromium release 9.0.600.0 to 9.0.597.0, to align with the Chromium 9 stable release branch. Change-Id: I5d2bb4e8cee9d39ae8485abf48bdb55ecf8b3790
Diffstat (limited to 'WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp')
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp44
1 files changed, 3 insertions, 41 deletions
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()