summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac')
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm9
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm38
-rw-r--r--WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportPregenerated.pm (renamed from WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm)0
-rw-r--r--WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapPregenerated.c (renamed from WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapTiger.c)0
-rw-r--r--WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile19
5 files changed, 54 insertions, 12 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index e280fab..c08aee5 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -907,14 +907,15 @@ void dump()
{
invalidateAnyPreviousWaitToDumpWatchdog();
- bool dumpAsText = gLayoutTestController->dumpAsText();
if (dumpTree) {
NSString *resultString = nil;
NSData *resultData = nil;
NSString *resultMimeType = @"text/plain";
- dumpAsText |= [[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"];
- gLayoutTestController->setDumpAsText(dumpAsText);
+ if ([[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]) {
+ gLayoutTestController->setDumpAsText(true);
+ gLayoutTestController->setGeneratePixelResults(false);
+ }
if (gLayoutTestController->dumpAsText()) {
resultString = dumpFramesAsText(mainFrame);
} else if (gLayoutTestController->dumpAsPDF()) {
@@ -989,7 +990,7 @@ static bool shouldOpenWebInspector(const char* pathOrURL)
static bool shouldEnableDeveloperExtras(const char* pathOrURL)
{
- return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");
+ return true;
}
static void resetWebViewToConsistentStateBeforeTesting()
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index b19d6b5..be3eb09 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -373,7 +373,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
[[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
}
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
@@ -583,6 +583,42 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
[[mainFrame webView] _executeCoreCommandByName:nameNS value:valueNS];
}
+bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
+{
+ WebFindOptions options = 0;
+
+ JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length"));
+ JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0);
+ if (!JSValueIsNumber(context, lengthValue))
+ return false;
+
+ RetainPtr<CFStringRef> targetCFString(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, target));
+
+ 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 |= WebFindOptionsCaseInsensitive;
+ else if (JSStringIsEqualToUTF8CString(optionName.get(), "AtWordStarts"))
+ options |= WebFindOptionsAtWordStarts;
+ else if (JSStringIsEqualToUTF8CString(optionName.get(), "TreatMedialCapitalAsWordStart"))
+ options |= WebFindOptionsTreatMedialCapitalAsWordStart;
+ else if (JSStringIsEqualToUTF8CString(optionName.get(), "Backwards"))
+ options |= WebFindOptionsBackwards;
+ else if (JSStringIsEqualToUTF8CString(optionName.get(), "WrapAround"))
+ options |= WebFindOptionsWrapAround;
+ else if (JSStringIsEqualToUTF8CString(optionName.get(), "StartInSelection"))
+ options |= WebFindOptionsStartInSelection;
+ }
+
+ return [[mainFrame webView] findString:(NSString *)targetCFString.get() options:options];
+}
+
void LayoutTestController::setCacheModel(int cacheModel)
{
[[WebPreferences standardPreferences] setCacheModel:cacheModel];
diff --git a/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportPregenerated.pm
index 7b4ea34..7b4ea34 100644
--- a/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm
+++ b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportPregenerated.pm
diff --git a/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapTiger.c b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapPregenerated.c
index f734989..f734989 100644
--- a/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapTiger.c
+++ b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapPregenerated.c
diff --git a/WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile b/WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile
index 56b2ed2..16a9e51 100644
--- a/WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile
+++ b/WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile
@@ -31,10 +31,15 @@ DYLIB=$(OUTPUT_DIR)/DumpRenderTreeSupport.dylib
DUMPRENDERTREE=$(OUTPUT_DIR)/DumpRenderTree
PERL=/usr/bin/perl
-OSX_VERSION=$(shell sw_vers -productVersion | cut -d. -f 2)
-
-ifneq "$(OSX_VERSION)" "4"
+OSX_VERSION = $(shell sw_vers -productVersion | cut -d. -f 2)
+ifeq "$(OSX_VERSION)" "4"
+GENERATE_WRAPPER = NO
+endif
+ifeq "$(OSX_VERSION)" "7"
+GENERATE_WRAPPER = NO
+endif
+ifneq "$(GENERATE_WRAPPER)" "NO"
SWIG=/usr/bin/swig
@@ -50,12 +55,12 @@ else
all: $(DYLIB) $(PERL_MODULE)
-$(WRAPPER): DumpRenderTreeSupport_wrapTiger.c $(DUMPRENDERTREE)
+$(WRAPPER): DumpRenderTreeSupport_wrapPregenerated.c $(DUMPRENDERTREE)
mkdir -p $(WRAPPER_DIR)
- cp DumpRenderTreeSupport_wrapTiger.c $(WRAPPER)
+ cp DumpRenderTreeSupport_wrapPregenerated.c $(WRAPPER)
-$(PERL_MODULE): DumpRenderTreeSupportTiger.pm $(DUMPRENDERTREE)
- cp DumpRenderTreeSupportTiger.pm $(PERL_MODULE)
+$(PERL_MODULE): DumpRenderTreeSupportPregenerated.pm $(DUMPRENDERTREE)
+ cp DumpRenderTreeSupportPregenerated.pm $(PERL_MODULE)
endif