summaryrefslogtreecommitdiff
path: root/Source/WebKit/gtk/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit/gtk/tests
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit/gtk/tests')
-rw-r--r--Source/WebKit/gtk/tests/testatk.c38
-rw-r--r--Source/WebKit/gtk/tests/testwebview.c2
2 files changed, 39 insertions, 1 deletions
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index 60c27942b..cc51be804 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -55,7 +55,7 @@ static const char* comboBoxSelector = "<html><body><select><option selected valu
static const char* embeddedObjects = "<html><body><p>Choose: <input value='foo' type='checkbox'/>foo <input value='bar' type='checkbox'/>bar (pick one)</p><p>Choose: <select name='foo'><option>bar</option><option>baz</option></select> (pick one)</p><p><input name='foobarbutton' value='foobar' type='button'/></p></body></html>";
-static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>";
+static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /><input type='password' name='passwordEntry' /></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><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>";
@@ -1735,6 +1735,7 @@ static void testWebkitAtkTextChangedNotifications()
AtkObject* form = atk_object_ref_accessible_child(object, 0);
g_assert(ATK_IS_OBJECT(form));
+ /* First check normal text entries. */
AtkObject* textEntry = atk_object_ref_accessible_child(form, 0);
g_assert(ATK_IS_EDITABLE_TEXT(textEntry));
g_assert(atk_object_get_role(ATK_OBJECT(textEntry)) == ATK_ROLE_ENTRY);
@@ -1766,10 +1767,45 @@ static void testWebkitAtkTextChangedNotifications()
g_assert_cmpstr(textChangedResult, ==, "|1|4|8|'qux quux'|");
g_free(text);
+ /* Now check for password entries. */
+ AtkObject* passwordEntry = atk_object_ref_accessible_child(form, 1);
+ g_assert(ATK_IS_EDITABLE_TEXT(passwordEntry));
+ g_assert(atk_object_get_role(ATK_OBJECT(passwordEntry)) == ATK_ROLE_PASSWORD_TEXT);
+
+ g_signal_connect(passwordEntry, "text-insert",
+ G_CALLBACK(textChangedCb),
+ GINT_TO_POINTER(TEXT_CHANGE_INSERT));
+ g_signal_connect(passwordEntry, "text-remove",
+ G_CALLBACK(textChangedCb),
+ GINT_TO_POINTER(TEXT_CHANGE_REMOVE));
+
+ pos = 0;
+ atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "foobar", 6, &pos);
+ g_assert_cmpstr(textChangedResult, ==, "|1|0|6|'\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242'|");
+ text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1);
+ g_assert_cmpstr(text, ==, "\303\242\302\200\302\242\303\242\302\200\302\242");
+ g_free(text);
+
+ atk_editable_text_delete_text(ATK_EDITABLE_TEXT(passwordEntry), 2, 4);
+ g_assert_cmpstr(textChangedResult, ==, "|2|2|2|'\342\200\242\342\200\242'|");
+
+ text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1);
+ g_assert_cmpstr(text, ==, "\303\242\302\200\302\242\303\242");
+ g_free(text);
+
+ pos = 3;
+ atk_editable_text_insert_text(ATK_EDITABLE_TEXT(passwordEntry), "qux", 3, &pos);
+ g_assert_cmpstr(textChangedResult, ==, "|1|3|3|'\342\200\242\342\200\242\342\200\242'|");
+
+ text = atk_text_get_text(ATK_TEXT(passwordEntry), 0, -1);
+ g_assert_cmpstr(text, ==, "\303\242\302\200\302\242\303\242\302\200\302\242\303\242");
+ g_free(text);
+
g_free(textChangedResult);
g_object_unref(form);
g_object_unref(textEntry);
+ g_object_unref(passwordEntry);
g_object_unref(webView);
}
diff --git a/Source/WebKit/gtk/tests/testwebview.c b/Source/WebKit/gtk/tests/testwebview.c
index f71aa42b4..80d7eeadc 100644
--- a/Source/WebKit/gtk/tests/testwebview.c
+++ b/Source/WebKit/gtk/tests/testwebview.c
@@ -609,7 +609,9 @@ void doMouseButtonEvent(GtkWidget* widget, GdkEventType eventType, int x, int y,
event->button.state = modifiers;
event->button.button = button;
+#ifndef GTK_API_VERSION_2
event->button.device = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gtk_widget_get_display(widget)));
+#endif
int xRoot, yRoot;
gdk_window_get_root_coords(gtk_widget_get_window(widget), x, y, &xRoot, &yRoot);