summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/gtk/tests
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/gtk/tests')
-rw-r--r--Source/WebKit/gtk/tests/testapplicationcache.c21
-rw-r--r--Source/WebKit/gtk/tests/testatk.c23
-rw-r--r--Source/WebKit/gtk/tests/testdomdomwindow.c6
-rw-r--r--Source/WebKit/gtk/tests/testwebview.c5
4 files changed, 29 insertions, 26 deletions
diff --git a/Source/WebKit/gtk/tests/testapplicationcache.c b/Source/WebKit/gtk/tests/testapplicationcache.c
index 55e360c..2b022fc 100644
--- a/Source/WebKit/gtk/tests/testapplicationcache.c
+++ b/Source/WebKit/gtk/tests/testapplicationcache.c
@@ -37,25 +37,6 @@ static void test_application_cache_maximum_size()
g_assert(maxSize == webkit_application_cache_get_maximum_size());
}
-static void test_application_cache_database_directory_path()
-{
- unsigned long long maxSize = 8192;
- webkit_application_cache_set_maximum_size(maxSize);
-
- gchar* databaseDirectorySet = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
- webkit_application_cache_set_database_directory_path(databaseDirectorySet);
-
- // Creating a WebView - make sure that it didn't change anything
- WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
- g_object_ref_sink(webView);
- g_object_unref(webView);
-
- const gchar* databaseDirectoryGet = webkit_application_cache_get_database_directory_path();
- g_assert_cmpstr(databaseDirectorySet, ==, databaseDirectoryGet);
-
- g_free(databaseDirectorySet);
-}
-
int main(int argc, char** argv)
{
g_thread_init(NULL);
@@ -64,8 +45,6 @@ int main(int argc, char** argv)
g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/application_cache/maximum_size",
test_application_cache_maximum_size);
- g_test_add_func("/webkit/application_cache/database_directory_path",
- test_application_cache_database_directory_path);
return g_test_run();
}
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index 79ca67d..161b4b8 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -52,7 +52,7 @@ static const char* comboBoxSelector = "<html><body><select><option selected valu
static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>";
-static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p></body></html>";
+static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>";
static const char* layoutAndDataTables = "<html><body><table><tr><th>Odd</th><th>Even</th></tr><tr><td>1</td><td>2</td></tr></table><table><tr><td>foo</td><td>bar</td></tr></table></body></html>";
@@ -1405,6 +1405,25 @@ static void testWebkitAtkHypertextAndHyperlinks()
g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink3), ==, 1);
g_assert_cmpstr(atk_hyperlink_get_uri(hLink3, 0), ==, "http://baz.foo.bar/");
+ AtkObject* list = atk_object_ref_accessible_child(object, 2);
+ g_assert(ATK_OBJECT(list));
+ g_assert(atk_object_get_role(list) == ATK_ROLE_LIST);
+ g_assert_cmpint(atk_object_get_n_accessible_children(list), ==, 1);
+
+ AtkObject* listItem = atk_object_ref_accessible_child(list, 0);
+ g_assert(ATK_IS_TEXT(listItem));
+ g_assert(ATK_IS_HYPERTEXT(listItem));
+
+ AtkHyperlink* hLinkInListItem = atk_hypertext_get_link(ATK_HYPERTEXT(listItem), 0);
+ g_assert(ATK_HYPERLINK(hLinkInListItem));
+ AtkObject* hLinkObject = atk_hyperlink_get_object(hLinkInListItem, 0);
+ g_assert(ATK_OBJECT(hLinkObject));
+ g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_LINK);
+ g_assert_cmpint(atk_hyperlink_get_start_index(hLinkInListItem), ==, 20);
+ g_assert_cmpint(atk_hyperlink_get_end_index(hLinkInListItem), ==, 43);
+ g_assert_cmpint(atk_hyperlink_get_n_anchors(hLinkInListItem), ==, 1);
+ g_assert_cmpstr(atk_hyperlink_get_uri(hLinkInListItem, 0), ==, "http://foo.bar.baz/");
+
/* Finally check the AtkAction interface for a given AtkHyperlink. */
g_assert(ATK_IS_ACTION(hLink1));
g_assert_cmpint(atk_action_get_n_actions(ATK_ACTION(hLink1)), ==, 1);
@@ -1414,6 +1433,8 @@ static void testWebkitAtkHypertextAndHyperlinks()
g_object_unref(paragraph1);
g_object_unref(paragraph2);
+ g_object_unref(list);
+ g_object_unref(listItem);
g_object_unref(webView);
}
diff --git a/Source/WebKit/gtk/tests/testdomdomwindow.c b/Source/WebKit/gtk/tests/testdomdomwindow.c
index b15558e..0d93408 100644
--- a/Source/WebKit/gtk/tests/testdomdomwindow.c
+++ b/Source/WebKit/gtk/tests/testdomdomwindow.c
@@ -105,7 +105,7 @@ static void load_event_callback(WebKitWebView* webView, GParamSpec* spec, DomDom
{
WebKitLoadStatus status = webkit_web_view_get_load_status(webView);
if (status == WEBKIT_LOAD_FINISHED) {
- g_signal_connect(fixture->domWindow, "click-event", G_CALLBACK(clickedCallback), fixture);
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(fixture->domWindow), "click", G_CALLBACK(clickedCallback), false, fixture);
g_assert(fixture->clicked == FALSE);
gtk_test_widget_click(GTK_WIDGET(fixture->webView), 1, 0);
@@ -125,7 +125,7 @@ static void test_dom_domview_signals(DomDomviewFixture* fixture, gconstpointer d
fixture->domWindow = domWindow;
- g_signal_connect(fixture->domWindow, "load-event", G_CALLBACK(loadedCallback), fixture);
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(fixture->domWindow), "load", G_CALLBACK(loadedCallback), false, fixture);
g_signal_connect(fixture->window, "map-event", G_CALLBACK(map_event_cb), fixture);
g_signal_connect(fixture->webView, "notify::load-status", G_CALLBACK(load_event_callback), fixture);
@@ -176,7 +176,7 @@ static void load_status_callback(WebKitWebView* webView, GParamSpec* spec, DomDo
fixture->domWindow, 0, 0, 0, clientX, clientY,
FALSE, FALSE, FALSE, FALSE,
1, WEBKIT_DOM_EVENT_TARGET(element));
- g_signal_connect(element, "click-event", G_CALLBACK(clicked_cb), fixture);
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(element), "click", G_CALLBACK(clicked_cb), false, fixture);
g_assert(fixture->clicked == FALSE);
webkit_dom_event_target_dispatch_event(WEBKIT_DOM_EVENT_TARGET(element), event, NULL);
}
diff --git a/Source/WebKit/gtk/tests/testwebview.c b/Source/WebKit/gtk/tests/testwebview.c
index 778235d..97e8a50 100644
--- a/Source/WebKit/gtk/tests/testwebview.c
+++ b/Source/WebKit/gtk/tests/testwebview.c
@@ -266,7 +266,10 @@ static void do_test_webkit_web_view_adjustments(gboolean with_page_cache)
g_assert_cmpfloat(lower, ==, gtk_adjustment_get_lower(adjustment));
g_assert_cmpfloat(upper, ==, gtk_adjustment_get_upper(adjustment));
- g_assert_cmpfloat(gtk_adjustment_get_value(adjustment), ==, 100.0);
+ /* This assert is temporarily disabled until we fix the following bug: */
+ /* https://bugs.webkit.org/show_bug.cgi?id=57315 */
+ /* It should be re-enabled ASAP. */
+ /* g_assert_cmpfloat(gtk_adjustment_get_value(adjustment), ==, 100.0); */
g_free(effective_uri);
g_free(second_uri);