summaryrefslogtreecommitdiff
path: root/Tools/DumpRenderTree
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-26 10:42:44 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-26 10:42:44 +0200
commit33b26980cb24288b5a9f2590ccf32a949281bb79 (patch)
treecc0203dac37338b24b0b25a4694c0b76d4e4164b /Tools/DumpRenderTree
parent715be629d51174233403237bfc563cf150087dc8 (diff)
downloadqtwebkit-33b26980cb24288b5a9f2590ccf32a949281bb79.tar.gz
Imported WebKit commit c596dd7f03007fa7ed896b928106497e8784b3b5 (http://svn.webkit.org/repository/webkit/trunk@129610)
New snapshot that removes QtQuick1 support (to be moved into QtQuick1 module)
Diffstat (limited to 'Tools/DumpRenderTree')
-rw-r--r--Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp4
-rw-r--r--Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp48
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp1
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp4
-rw-r--r--Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp7
-rw-r--r--Tools/DumpRenderTree/efl/TestRunnerEfl.cpp2
-rw-r--r--Tools/DumpRenderTree/gtk/DumpRenderTree.cpp2
-rw-r--r--Tools/DumpRenderTree/mac/Configurations/Base.xcconfig2
-rw-r--r--Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig10
-rw-r--r--Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig2
-rw-r--r--Tools/DumpRenderTree/mac/DumpRenderTree.mm2
-rw-r--r--Tools/DumpRenderTree/mac/FrameLoadDelegate.mm35
-rw-r--r--Tools/DumpRenderTree/mac/UIDelegate.mm4
-rwxr-xr-xTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp1
-rw-r--r--Tools/DumpRenderTree/win/UIDelegate.cpp1
15 files changed, 108 insertions, 17 deletions
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
index cc930e166..fa57c46fe 100644
--- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
@@ -664,8 +664,10 @@ void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lin
void DumpRenderTree::runJavaScriptAlert(const String& message)
{
- if (!testDone)
+ if (!testDone) {
printf("ALERT: %s\n", message.utf8().data());
+ fflush(stdout);
+ }
}
bool DumpRenderTree::runJavaScriptConfirm(const String& message)
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
index c0278cd57..b795aeb83 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
@@ -37,6 +37,7 @@
#include "platform/WebRect.h"
#include "platform/WebString.h"
#include <wtf/Assertions.h>
+#include <wtf/StringExtras.h>
using namespace WebKit;
using namespace std;
@@ -495,19 +496,23 @@ void AccessibilityUIElement::childrenCountGetterCallback(CppVariant* result)
void AccessibilityUIElement::insertionPointLineNumberGetterCallback(CppVariant* result)
{
- WebVector<int> lineBreaks;
- accessibilityObject().lineBreaks(lineBreaks);
- int cursor = accessibilityObject().selectionEnd();
- int line = 0;
- while (line < static_cast<int>(lineBreaks.size()) && lineBreaks[line] <= cursor)
- line++;
- result->set(line);
+ if (!accessibilityObject().isFocused()) {
+ result->set(-1);
+ return;
+ }
+
+ int lineNumber = accessibilityObject().selectionEndLineNumber();
+ result->set(lineNumber);
}
void AccessibilityUIElement::selectedTextRangeGetterCallback(CppVariant* result)
{
- // FIXME: Implement this.
- result->set(std::string());
+ unsigned selectionStart = accessibilityObject().selectionStart();
+ unsigned selectionEnd = accessibilityObject().selectionEnd();
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer), "{%d, %d}", selectionStart, selectionEnd - selectionStart);
+
+ result->set(std::string(buffer));
}
void AccessibilityUIElement::isEnabledGetterCallback(CppVariant* result)
@@ -628,9 +633,22 @@ void AccessibilityUIElement::parametrizedAttributeNamesCallback(const CppArgumen
result->setNull();
}
-void AccessibilityUIElement::lineForIndexCallback(const CppArgumentList&, CppVariant* result)
+void AccessibilityUIElement::lineForIndexCallback(const CppArgumentList& arguments, CppVariant* result)
{
- result->setNull();
+ if (!arguments.size() || !arguments[0].isNumber()) {
+ result->setNull();
+ return;
+ }
+
+ int index = arguments[0].toInt32();
+
+ WebVector<int> lineBreaks;
+ accessibilityObject().lineBreaks(lineBreaks);
+ int line = 0;
+ int vectorSize = static_cast<int>(lineBreaks.size());
+ while (line < vectorSize && lineBreaks[line] <= index)
+ line++;
+ result->set(line);
}
void AccessibilityUIElement::boundsForRangeCallback(const CppArgumentList&, CppVariant* result)
@@ -719,9 +737,15 @@ void AccessibilityUIElement::titleUIElementCallback(const CppArgumentList&, CppV
result->setNull();
}
-void AccessibilityUIElement::setSelectedTextRangeCallback(const CppArgumentList&, CppVariant* result)
+void AccessibilityUIElement::setSelectedTextRangeCallback(const CppArgumentList&arguments, CppVariant* result)
{
result->setNull();
+ if (arguments.size() != 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+
+ int selectionStart = arguments[0].toInt32();
+ int selectionEnd = selectionStart + arguments[1].toInt32();
+ accessibilityObject().setSelectedTextRange(selectionStart, selectionEnd);
}
void AccessibilityUIElement::attributeValueCallback(const CppArgumentList&, CppVariant* result)
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index 87faaf248..f8d804e96 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -546,6 +546,7 @@ WebString WebViewHost::autoCorrectWord(const WebString&)
void WebViewHost::runModalAlertDialog(WebFrame*, const WebString& message)
{
printf("ALERT: %s\n", message.utf8().data());
+ fflush(stdout);
}
bool WebViewHost::runModalConfirmDialog(WebFrame*, const WebString& message)
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
index 09d7d4033..51a78c9b4 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
@@ -145,6 +145,10 @@ Evas_Object* DumpRenderTreeChrome::createWebInspectorView()
if (!inspectorView)
return 0;
+ // Inspector-related views are not expected to have their output logged.
+ const bool ignoreMessages = true;
+ evas_object_data_set(inspectorView, "ignore-console-messages", &ignoreMessages);
+
ewk_view_theme_set(inspectorView, DATA_DIR"/default.edj");
Evas_Object* mainFrame = ewk_view_frame_main_get(inspectorView);
diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
index ee0d61502..ed31de328 100644
--- a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
+++ b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp
@@ -55,8 +55,12 @@ static WTF::String urlSuitableForTestResult(const WTF::String& uriString)
return (index == WTF::notFound) ? uriString : uriString.substring(index + 1);
}
-static void onConsoleMessage(Ewk_View_Smart_Data*, const char* message, unsigned int lineNumber, const char*)
+static void onConsoleMessage(Ewk_View_Smart_Data* smartData, const char* message, unsigned lineNumber, const char*)
{
+ Evas_Object* evasObject = smartData->self;
+ if (evas_object_data_get(evasObject, "ignore-console-messages"))
+ return;
+
// Tests expect only the filename part of local URIs
WTF::String newMessage = WTF::String::fromUTF8(message);
if (!newMessage.isEmpty()) {
@@ -78,6 +82,7 @@ static void onConsoleMessage(Ewk_View_Smart_Data*, const char* message, unsigned
static void onJavaScriptAlert(Ewk_View_Smart_Data*, Evas_Object*, const char* message)
{
printf("ALERT: %s\n", message);
+ fflush(stdout);
}
static Eina_Bool onJavaScriptConfirm(Ewk_View_Smart_Data*, Evas_Object*, const char* message)
diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
index 9797a3152..964b31c76 100644
--- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
+++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
@@ -711,6 +711,8 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
DumpRenderTreeSupportEfl::setCSSRegionsEnabled(browser->mainView(), toBool(value));
else if (equals(key, "WebKitWebAudioEnabled"))
ewk_view_setting_web_audio_set(browser->mainView(), toBool(value));
+ else if (equals(key, "WebKitDisplayImagesKey"))
+ ewk_view_setting_auto_load_images_set(browser->mainView(), toBool(value));
else
fprintf(stderr, "TestRunner::overridePreference tried to override unknown preference '%s'.\n", value->string().utf8().data());
}
diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
index a6c438399..1f96622bb 100644
--- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -517,6 +517,7 @@ static void resetDefaultsToConsistentValues()
DumpRenderTreeSupportGtk::setCSSGridLayoutEnabled(webView, false);
DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webView, true);
DumpRenderTreeSupportGtk::setShadowDOMEnabled(true);
+ DumpRenderTreeSupportGtk::setStyleScopedEnabled(true);
}
static bool useLongRunningServerMode(int argc, char *argv[])
@@ -925,6 +926,7 @@ static gboolean webViewConsoleMessage(WebKitWebView* view, const gchar* message,
static gboolean webViewScriptAlert(WebKitWebView* view, WebKitWebFrame* frame, const gchar* message, gpointer data)
{
fprintf(stdout, "ALERT: %s\n", message);
+ fflush(stdout);
return TRUE;
}
diff --git a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig
index 140714eac..99f525622 100644
--- a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig
+++ b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig
@@ -64,3 +64,5 @@ TARGETING_SAME_OS_X_VERSION_1090_1090 = YES;
// Don't build against an SDK unless we're targeting an older OS version.
SDKROOT = $(SDKROOT_TARGETING_SAME_OS_X_VERSION_$(TARGETING_SAME_OS_X_VERSION));
SDKROOT_TARGETING_SAME_OS_X_VERSION_ = macosx;
+
+WEBKIT_SYSTEM_INTERFACE_LIBRARY = WebKitSystemInterface
diff --git a/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig b/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
index b61d48485..8e3528d2d 100644
--- a/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
+++ b/Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
@@ -38,3 +38,13 @@ MACOSX_DEPLOYMENT_TARGET_1060 = 10.6;
MACOSX_DEPLOYMENT_TARGET_1070 = 10.7;
MACOSX_DEPLOYMENT_TARGET_1080 = 10.8;
MACOSX_DEPLOYMENT_TARGET_1090 = 10.9;
+
+WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(REAL_PLATFORM_NAME));
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos = WebKitSystemInterface;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphonesimulator = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos);
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1050 = WebKitSystemInterfaceLeopard;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1060 = WebKitSystemInterfaceSnowLeopard;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1070 = WebKitSystemInterfaceLion;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1080 = WebKitSystemInterfaceMountainLion;
+WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1090 = WebKitSystemInterfaceMountainLion;
diff --git a/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig b/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig
index b461f818a..8235bdb8f 100644
--- a/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig
+++ b/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig
@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-OTHER_LDFLAGS = -sectcreate __DATA Ahem qt/fonts/AHEM____.TTF -sectcreate __DATA WeightWatcher100 fonts/WebKitWeightWatcher100.ttf -sectcreate __DATA WeightWatcher200 fonts/WebKitWeightWatcher200.ttf -sectcreate __DATA WeightWatcher300 fonts/WebKitWeightWatcher300.ttf -sectcreate __DATA WeightWatcher400 fonts/WebKitWeightWatcher400.ttf -sectcreate __DATA WeightWatcher500 fonts/WebKitWeightWatcher500.ttf -sectcreate __DATA WeightWatcher600 fonts/WebKitWeightWatcher600.ttf -sectcreate __DATA WeightWatcher700 fonts/WebKitWeightWatcher700.ttf -sectcreate __DATA WeightWatcher800 fonts/WebKitWeightWatcher800.ttf -sectcreate __DATA WeightWatcher900 fonts/WebKitWeightWatcher900.ttf -sectcreate __DATA HiraMaruMono-W4 fonts/SampleFont.sfont
+OTHER_LDFLAGS = -sectcreate __DATA Ahem qt/fonts/AHEM____.TTF -sectcreate __DATA WeightWatcher100 fonts/WebKitWeightWatcher100.ttf -sectcreate __DATA WeightWatcher200 fonts/WebKitWeightWatcher200.ttf -sectcreate __DATA WeightWatcher300 fonts/WebKitWeightWatcher300.ttf -sectcreate __DATA WeightWatcher400 fonts/WebKitWeightWatcher400.ttf -sectcreate __DATA WeightWatcher500 fonts/WebKitWeightWatcher500.ttf -sectcreate __DATA WeightWatcher600 fonts/WebKitWeightWatcher600.ttf -sectcreate __DATA WeightWatcher700 fonts/WebKitWeightWatcher700.ttf -sectcreate __DATA WeightWatcher800 fonts/WebKitWeightWatcher800.ttf -sectcreate __DATA WeightWatcher900 fonts/WebKitWeightWatcher900.ttf -sectcreate __DATA HiraMaruMono-W4 fonts/SampleFont.sfont -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)
LD_RUNPATH_SEARCH_PATHS = "@loader_path/.";
PRODUCT_NAME = DumpRenderTree
GCC_ENABLE_OBJC_EXCEPTIONS = YES
diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
index ee82454b5..30ac8254c 100644
--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -674,6 +674,8 @@ static void resetDefaultsToConsistentValues()
[preferences setWebAudioEnabled:YES];
#endif
+ [preferences setScreenFontSubstitutionEnabled:YES];
+
[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
TestRunner::setSerializeHTTPLoads(false);
diff --git a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
index 274ea96b5..21be9227f 100644
--- a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
+++ b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm
@@ -45,6 +45,7 @@
#import "WorkQueue.h"
#import "WorkQueueItem.h"
#import <JavaScriptCore/JavaScriptCore.h>
+#import <WebKitSystemInterface.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebKit.h>
@@ -154,8 +155,41 @@
}
}
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+static NSString *testPathFromURL(NSURL* url)
+{
+ if ([url isFileURL]) {
+ NSString *filePath = [url path];
+ NSRange layoutTestsRange = [filePath rangeOfString:@"/LayoutTests/"];
+ if (layoutTestsRange.location == NSNotFound)
+ return nil;
+
+ return [filePath substringFromIndex:NSMaxRange(layoutTestsRange)];
+ }
+
+ // HTTP test URLs look like: http://127.0.0.1:8000/inspector/resource-tree/resource-request-content-after-loading-and-clearing-cache.html
+ if (![[url scheme] isEqualToString:@"http"] && ![[url scheme] isEqualToString:@"https"])
+ return nil;
+
+ if ([[url host] isEqualToString:@"127.0.0.1"] && ([[url port] intValue] == 8000 || [[url port] intValue] == 8443))
+ return [url path];
+
+ return nil;
+}
+#endif
+
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
{
+ ASSERT([frame provisionalDataSource]);
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ if (!done && [[sender mainFrame] isEqual:frame]) {
+ NSURL *provisionalLoadURL = [[[frame provisionalDataSource] initialRequest] URL];
+ if (NSString *testPath = testPathFromURL(provisionalLoadURL))
+ WKSetCrashReportApplicationSpecificInformation((CFStringRef)[@"CRASHING TEST: " stringByAppendingString:testPath]);
+ }
+#endif
+
if (!done && gTestRunner->dumpFrameLoadCallbacks()) {
NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
@@ -166,7 +200,6 @@
printf ("%s\n", [string UTF8String]);
}
- ASSERT([frame provisionalDataSource]);
// Make sure we only set this once per test. If it gets cleared, and then set again, we might
// end up doing two dumps for one test.
if (!topLoadingFrame && !done)
diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm
index 580b0d649..1b6103ac8 100644
--- a/Tools/DumpRenderTree/mac/UIDelegate.mm
+++ b/Tools/DumpRenderTree/mac/UIDelegate.mm
@@ -89,8 +89,10 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
{
- if (!done)
+ if (!done) {
printf("ALERT: %s\n", [message UTF8String]);
+ fflush(stdout);
+ }
}
- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index abe08aa26..46120a7b0 100755
--- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -225,6 +225,7 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message)
return;
fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
+ fflush(stdout);
}
void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature)
diff --git a/Tools/DumpRenderTree/win/UIDelegate.cpp b/Tools/DumpRenderTree/win/UIDelegate.cpp
index fd6a8f842..c7574883a 100644
--- a/Tools/DumpRenderTree/win/UIDelegate.cpp
+++ b/Tools/DumpRenderTree/win/UIDelegate.cpp
@@ -435,6 +435,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::runJavaScriptAlertPanelWithMessage(
/* [in] */ BSTR message)
{
printf("ALERT: %S\n", message ? message : L"");
+ fflush(stdout);
return S_OK;
}