summaryrefslogtreecommitdiffstats
path: root/Tools/DumpRenderTree/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/DumpRenderTree/gtk')
-rw-r--r--Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp3
-rw-r--r--Tools/DumpRenderTree/gtk/DumpRenderTree.cpp49
-rw-r--r--Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp68
3 files changed, 107 insertions, 13 deletions
diff --git a/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp b/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp
index be66513..8d73d45 100644
--- a/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp
+++ b/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp
@@ -92,6 +92,9 @@ static gboolean axObjectEventListener(GSignalInvocationHint *signalHint,
} else if (!g_strcmp0(signal_query.signal_name, "children-changed")) {
signalName.set(g_strdup_printf("children-changed = %d",
g_value_get_uint(&paramValues[1])));
+ } else if (!g_strcmp0(signal_query.signal_name, "property-change")) {
+ signalName.set(g_strdup_printf("property-change:%s",
+ g_quark_to_string(signalHint->detail)));
} else
signalName.set(g_strdup(signal_query.signal_name));
diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 3f70b49..f768b43 100644
--- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -2,7 +2,7 @@
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008 Alp Toker <alp@nuanti.com>
* Copyright (C) 2009 Jan Alonzo <jmalonzo@gmail.com>
- * Copyright (C) 2010 Igalia S.L.
+ * Copyright (C) 2010, 2011 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -137,9 +137,13 @@ static void initializeGtkFontSettings(const char* testURL)
GtkSettings* settings = gtk_settings_get_default();
if (!settings)
return;
- g_object_set(settings, "gtk-xft-antialias", 1,
+ g_object_set(settings,
+ "gtk-xft-dpi", 98304, // This is 96 * 1024 or 96 DPI according to the GTK+ docs.
+ "gtk-xft-antialias", 1,
"gtk-xft-hinting", 0,
- "gtk-font-name", "Liberation Sans 16", NULL);
+ "gtk-font-name", "Liberation Sans 12",
+ NULL);
+ gdk_screen_set_resolution(gdk_screen_get_default(), 96.0);
// One test needs subpixel anti-aliasing turned on, but generally we
// want all text in other tests to use to grayscale anti-aliasing.
@@ -419,8 +423,8 @@ static void resetDefaultsToConsistentValues()
"sans-serif-font-family", "Helvetica",
"cursive-font-family", "cursive",
"fantasy-font-family", "fantasy",
- "default-font-size", 16,
- "default-monospace-font-size", 13,
+ "default-font-size", 12,
+ "default-monospace-font-size", 10,
"minimum-font-size", 0,
"enable-caret-browsing", FALSE,
"enable-page-cache", FALSE,
@@ -458,7 +462,7 @@ static void resetDefaultsToConsistentValues()
setlocale(LC_ALL, "");
DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(true);
- DumpRenderTreeSupportGtk::setIconDatabaseEnabled(false);
+ webkit_icon_database_set_path(webkit_get_icon_database(), 0);
DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(false);
if (axController)
@@ -583,8 +587,6 @@ void dump()
static void setDefaultsToConsistentStateValuesForTesting()
{
- gdk_screen_set_resolution(gdk_screen_get_default(), 72.0);
-
resetDefaultsToConsistentValues();
/* Disable the default auth dialog for testing */
@@ -598,6 +600,26 @@ static void setDefaultsToConsistentStateValuesForTesting()
gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "gtkwebkitdrt", "databases", NULL);
webkit_set_web_database_directory_path(databaseDirectory);
g_free(databaseDirectory);
+
+#if defined(GTK_API_VERSION_2)
+ gtk_rc_parse_string("style \"nix_scrollbar_spacing\" "
+ "{ "
+ " GtkScrolledWindow::scrollbar-spacing = 0 "
+ "} "
+ "class \"GtkWidget\" style \"nix_scrollbar_spacing\"");
+
+#else
+ GtkCssProvider* cssProvider = gtk_css_provider_new();
+ gtk_css_provider_load_from_data(cssProvider,
+ " * { "
+ " -GtkScrolledWindow-scrollbar-spacing: 0;"
+ "} ",
+ -1, 0);
+ gtk_style_context_add_provider_for_screen(gdk_display_get_default_screen(gdk_display_get_default()),
+ GTK_STYLE_PROVIDER(cssProvider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref(cssProvider);
+#endif
}
static void sendPixelResultsEOF()
@@ -1027,6 +1049,17 @@ static void frameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* webFram
static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame*, WebKitWebResource*, WebKitNetworkRequest* request, WebKitNetworkResponse*)
{
SoupMessage* soupMessage = webkit_network_request_get_message(request);
+ SoupURI* uri = soup_uri_new(webkit_network_request_get_uri(request));
+
+ if (SOUP_URI_VALID_FOR_HTTP(uri) && g_strcmp0(uri->host, "127.0.0.1")
+ && g_strcmp0(uri->host, "255.255.255.255")
+ && g_ascii_strncasecmp(uri->host, "localhost", 9)) {
+ printf("Blocked access to external URL %s\n", soup_uri_to_string(uri, FALSE));
+ soup_uri_free(uri);
+ return;
+ }
+ soup_uri_free(uri);
+
if (soupMessage) {
const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 77d6ae1..c26e2db 100644
--- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -332,9 +332,9 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
setUserStyleSheetEnabled(true);
}
-void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
+void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
{
- // FIXME: implement
+ DumpRenderTreeSupportGtk::setValueForUser(context, nodeObject, value);
}
void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
@@ -458,6 +458,11 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
// FIXME: implement
}
+void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled)
+{
+ DumpRenderTreeSupportGtk::setAutofilled(context, nodeObject, isAutofilled);
+}
+
void LayoutTestController::disableImageLoading()
{
// FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27896
@@ -488,6 +493,12 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
+int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
+{
+ // FIXME: Implement for Geolocation layout tests.
+ return -1;
+}
+
void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
@@ -496,7 +507,12 @@ void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double c
void LayoutTestController::setIconDatabaseEnabled(bool enabled)
{
- DumpRenderTreeSupportGtk::setIconDatabaseEnabled(enabled);
+ WebKitIconDatabase* database = webkit_get_icon_database();
+ if (enabled) {
+ GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_tmp_dir(), "DumpRenderTree", "icondatabase", NULL));
+ webkit_icon_database_set_path(database, iconDatabasePath.get());
+ } else
+ webkit_icon_database_set_path(database, 0);
}
void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
@@ -627,12 +643,23 @@ void LayoutTestController::clearPersistentUserStyleSheet()
void LayoutTestController::clearAllApplicationCaches()
{
- // FIXME: implement to support Application Cache quotas.
+ // FIXME: Implement to support application cache quotas.
}
void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
{
- // FIXME: implement to support Application Cache quotas.
+ // FIXME: Implement to support application cache quotas.
+}
+
+void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*)
+{
+ // FIXME: Implement to support deleting all application caches for an origin.
+}
+
+JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
+{
+ // FIXME: Implement to get origins that contain application caches.
+ return JSValueMakeUndefined(context);
}
void LayoutTestController::clearAllDatabases()
@@ -646,6 +673,32 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota)
webkit_security_origin_set_web_database_quota(origin, quota);
}
+JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
+{
+ // FIXME: implement
+ return JSValueMakeUndefined(context);
+}
+
+void LayoutTestController::deleteAllLocalStorage()
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef originIdentifier)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::syncLocalStorage()
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef)
{
// FIXME: implement
@@ -873,6 +926,11 @@ bool LayoutTestController::hasSpellingMarker(int from, int length)
return DumpRenderTreeSupportGtk::webkitWebFrameSelectionHasSpellingMarker(mainFrame, from, length);
}
+bool LayoutTestController::hasGrammarMarker(int from, int length)
+{
+ return false;
+}
+
void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);