Title: [101951] trunk
Revision
101951
Author
ma...@webkit.org
Date
2011-12-04 01:39:28 -0800 (Sun, 04 Dec 2011)

Log Message

Source/WebKit/gtk: Removing document related events from DRT

[GTK] Don't log document events in DRT
https://bugs.webkit.org/show_bug.cgi?id=73746

Reviewed by Martin Robinson.

New unit test to check events when reloading a document. This
replaces the former document-reload-events.html layout test.

* tests/testatk.c:
(updateLoadingEventsResult): New, updates a global variable to
allow checking later on that the right signals were emmitted.
(documentLoadingEventCallback): New, global listener for load-complete
and reload signals over the document object (the web area).
(testWebkitAtkDocumentLoadingEvents): New unit test, globally
connects to document-related signals and check they are properly
emitted when reloading the web view.
(main): Added new test.

Tools: [GTK] Don't log document events in DRT
https://bugs.webkit.org/show_bug.cgi?id=73746

Reviewed by Martin Robinson.

Stop connecting globally to document-related events.

* DumpRenderTree/gtk/AccessibilityCallbacks.cpp:
(connectAccessibilityCallbacks): Removed connections.
(disconnectAccessibilityCallbacks): Removed disconnections.

LayoutTests: [GTK] Don't log document events in DRT
https://bugs.webkit.org/show_bug.cgi?id=73746

Reviewed by Martin Robinson.

Unskip passing test, remove other transformed into a unit test and
rebaseline expectations now we stopped logging document events.

* platform/gtk/Skipped: Removed two skipped tests.
* platform/gtk/accessibility/aria-slider-required-attributes-expected.txt: Rebaselined
* platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Ditto.
* platform/gtk/accessibility/document-reload-events-expected.txt: Removed.
* platform/gtk/accessibility/document-reload-events.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101950 => 101951)


--- trunk/LayoutTests/ChangeLog	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/ChangeLog	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,3 +1,19 @@
+2011-12-03  Mario Sanchez Prada  <msanc...@igalia.com>
+
+        [GTK] Don't log document events in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=73746
+
+        Reviewed by Martin Robinson.
+
+        Unskip passing test, remove other transformed into a unit test and
+        rebaseline expectations now we stopped logging document events.
+
+        * platform/gtk/Skipped: Removed two skipped tests.
+        * platform/gtk/accessibility/aria-slider-required-attributes-expected.txt: Rebaselined
+        * platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Ditto.
+        * platform/gtk/accessibility/document-reload-events-expected.txt: Removed.
+        * platform/gtk/accessibility/document-reload-events.html: Removed.
+
 2011-12-04  Ryosuke Niwa  <rn...@webkit.org>
 
         Add failing expectation to css3/unicode-bidi-isolate-aharon-failing.html as it was split from

Modified: trunk/LayoutTests/platform/gtk/Skipped (101950 => 101951)


--- trunk/LayoutTests/platform/gtk/Skipped	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/platform/gtk/Skipped	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1360,10 +1360,6 @@
 # Need layoutTestController.setShouldStayOnPageAfterHandlingBeforeUnload
 fast/loader/form-submission-after-beforeunload-cancel.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=67398
-platform/gtk/accessibility/combo-box-collapsed-selection-changed.html
-platform/gtk/accessibility/document-reload-events.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=67713
 accessibility/textbox-role-reports-selection.html
 

Modified: trunk/LayoutTests/platform/gtk/accessibility/aria-slider-required-attributes-expected.txt (101950 => 101951)


--- trunk/LayoutTests/platform/gtk/accessibility/aria-slider-required-attributes-expected.txt	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/platform/gtk/accessibility/aria-slider-required-attributes-expected.txt	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,6 +1,5 @@
 Accessibility object emitted "focus-event = 1" / Name: "(No name)" / Role: 50
 Accessibility object emitted "state-change:focused = 1" / Name: "(No name)" / Role: 50
-Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
 Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
 Accessibility object emitted "property-change:accessible-value" / Name: "(No name)" / Role: 50
 Accessibility object emitted "property-change:accessible-value" / Name: "(No name)" / Role: 50

Modified: trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt (101950 => 101951)


--- trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt	2011-12-04 09:39:28 UTC (rev 101951)
@@ -26,8 +26,6 @@
 Accessibility object emitted "state-change:selected = 1" / Name: "foo" / Role: 34
 Accessibility object emitted "focus-event = 1" / Name: "foo" / Role: 34
 Accessibility object emitted "state-change:focused = 1" / Name: "foo" / Role: 34
-Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
-Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
 
 This tests that the 'state-changed:selected' signal is emitted when arrowing through the options of a combobox while collapsed.
 

Deleted: trunk/LayoutTests/platform/gtk/accessibility/document-reload-events-expected.txt (101950 => 101951)


--- trunk/LayoutTests/platform/gtk/accessibility/document-reload-events-expected.txt	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/platform/gtk/accessibility/document-reload-events-expected.txt	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,16 +0,0 @@
-Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
-Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
-Accessibility object emitted "state-change:busy = 1" / Name: "(No name)" / Role: 80
-Accessibility object emitted "reload" / Name: "(No name)" / Role: 80
-Accessibility object emitted "state-change:defunct = 1" / Name: "(No name)" / Role: 80
-Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
-Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
-Test that AtkDocument emits the right signals when reloading.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/platform/gtk/accessibility/document-reload-events.html (101950 => 101951)


--- trunk/LayoutTests/platform/gtk/accessibility/document-reload-events.html	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/LayoutTests/platform/gtk/accessibility/document-reload-events.html	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-<script>
-
-function runTest()
-{
-  if (!layoutTestController.globalFlag) {
-    layoutTestController.globalFlag = true;
-
-    if (window.layoutTestController) {
-      layoutTestController.dumpAsText();
-      layoutTestController.waitUntilDone();
-    }
-
-    setTimeout("window.location.reload()", 0);
-  } else {
-    layoutTestController.globalFlag = false;
-    if (window.layoutTestController)
-      layoutTestController.notifyDone();
-  }
-}
-</script>
-</head>
-<body id="body" _onload_="runTest();">
-<p id="description"></p>
-<div id="console"></div>
-<script>
-description("Test that AtkDocument emits the right signals when reloading.");
-
-if (window.accessibilityController)
-  accessibilityController.logAccessibilityEvents();
-
-</script>
-<script src=""
-</body>
-</html>

Modified: trunk/Source/WebKit/gtk/ChangeLog (101950 => 101951)


--- trunk/Source/WebKit/gtk/ChangeLog	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/Source/WebKit/gtk/ChangeLog	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,3 +1,25 @@
+2011-12-03  Mario Sanchez Prada  <msanc...@igalia.com>
+
+        Removing document related events from DRT
+
+        [GTK] Don't log document events in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=73746
+
+        Reviewed by Martin Robinson.
+
+        New unit test to check events when reloading a document. This
+        replaces the former document-reload-events.html layout test.
+
+        * tests/testatk.c:
+        (updateLoadingEventsResult): New, updates a global variable to
+        allow checking later on that the right signals were emmitted.
+        (documentLoadingEventCallback): New, global listener for load-complete
+        and reload signals over the document object (the web area).
+        (testWebkitAtkDocumentLoadingEvents): New unit test, globally
+        connects to document-related signals and check they are properly
+        emitted when reloading the web view.
+        (main): Added new test.
+
 2011-12-03  Xan Lopez  <xlo...@igalia.com>
 
         [GTK] Implement History API FrameLoaderClient methods

Modified: trunk/Source/WebKit/gtk/tests/testatk.c (101950 => 101951)


--- trunk/Source/WebKit/gtk/tests/testatk.c	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/Source/WebKit/gtk/tests/testatk.c	2011-12-04 09:39:28 UTC (rev 101951)
@@ -487,6 +487,60 @@
     g_object_unref(webView);
 }
 
+static gchar* loadingEventsResult = 0;
+
+static void updateLoadingEventsResult(const gchar* signalName)
+{
+    g_assert(signalName);
+
+    gchar* previousResult = loadingEventsResult;
+    loadingEventsResult = g_strdup_printf("%s|%s", previousResult, signalName);
+    g_free(previousResult);
+}
+
+static gboolean documentLoadingEventCallback(GSignalInvocationHint *signalHint, guint numParamValues, const GValue *paramValues, gpointer data)
+{
+    // At least we should receive the instance emitting the signal.
+    if (numParamValues < 1)
+        return TRUE;
+
+    GSignalQuery signal_query;
+    g_signal_query(signalHint->signal_id, &signal_query);
+
+    updateLoadingEventsResult(signal_query.signal_name);
+    return TRUE;
+}
+
+static void testWebkitAtkDocumentLoadingEvents()
+{
+    WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    g_object_ref_sink(webView);
+    GtkAllocation allocation = { 0, 0, 800, 600 };
+    gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation);
+    webkit_web_view_load_string(webView, contents, 0, 0, 0);
+
+    /* Trigger the creation of the full accessibility hierarchy by
+       asking for the webArea object, so we can listen to events. */
+    getWebAreaObject(webView);
+
+    /* Connect globally to see those events during a reload, since the
+       document after that will be different than what we have now. */
+    guint loadCompleteListenerId = atk_add_global_event_listener(documentLoadingEventCallback, "ATK:AtkDocument:load-complete");
+    guint reloadListenerId = atk_add_global_event_listener(documentLoadingEventCallback, "ATK:AtkDocument:reload");
+
+    /* Reload, so we can see those load events happening. */
+    loadingEventsResult = g_strdup("");
+    webkit_web_view_reload(webView);
+
+    atk_remove_global_event_listener(loadCompleteListenerId);
+    atk_remove_global_event_listener(reloadListenerId);
+
+    g_assert_cmpstr(loadingEventsResult, ==, "|reload|load-complete");
+
+    g_free(loadingEventsResult);
+    g_object_unref(webView);
+}
+
 static void testWebkitAtkEmbeddedObjects()
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
@@ -1719,6 +1773,7 @@
     g_test_add_func("/webkit/atk/caretOffsets", testWebkitAtkCaretOffsets);
     g_test_add_func("/webkit/atk/caretOffsetsAndExtranousWhiteSpaces", testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces);
     g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox);
+    g_test_add_func("/webkit/atk/documentLoadingEvents", testWebkitAtkDocumentLoadingEvents);
     g_test_add_func("/webkit/atk/embeddedObjects", testWebkitAtkEmbeddedObjects);
     g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset);
     g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms);

Modified: trunk/Tools/ChangeLog (101950 => 101951)


--- trunk/Tools/ChangeLog	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/Tools/ChangeLog	2011-12-04 09:39:28 UTC (rev 101951)
@@ -1,3 +1,16 @@
+2011-12-03  Mario Sanchez Prada  <msanc...@igalia.com>
+
+        [GTK] Don't log document events in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=73746
+
+        Reviewed by Martin Robinson.
+
+        Stop connecting globally to document-related events.
+
+        * DumpRenderTree/gtk/AccessibilityCallbacks.cpp:
+        (connectAccessibilityCallbacks): Removed connections.
+        (disconnectAccessibilityCallbacks): Removed disconnections.
+
 2011-12-03  Dan Bernstein  <m...@apple.com>
 
         Added a test for <rdar://problem/10523721> Crash at WebCore::SubresourceLoader::releaseResources

Modified: trunk/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp (101950 => 101951)


--- trunk/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp	2011-12-04 08:55:57 UTC (rev 101950)
+++ trunk/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp	2011-12-04 09:39:28 UTC (rev 101951)
@@ -43,10 +43,6 @@
 static guint propertyChangedListenerId = 0;
 static guint visibleDataChangedListenerId = 0;
 
-static guint loadCompleteListenerId = 0;
-static guint loadStoppedListenerId = 0;
-static guint reloadListenerId = 0;
-
 static void printAccessibilityEvent(AtkObject* accessible, const gchar* signalName)
 {
     // Sanity check.
@@ -103,27 +99,6 @@
     return TRUE;
 }
 
-static gboolean axDocumentEventListener(GSignalInvocationHint *signalHint,
-                                        guint numParamValues,
-                                        const GValue *paramValues,
-                                        gpointer data)
-{
-    // At least we should receive the instance emitting the signal.
-    if (numParamValues < 1)
-        return TRUE;
-
-    AtkObject* accessible = ATK_OBJECT(g_value_get_object(&paramValues[0]));
-    if (!accessible || !ATK_IS_DOCUMENT(accessible))
-        return TRUE;
-
-    GSignalQuery signal_query;
-    g_signal_query(signalHint->signal_id, &signal_query);
-
-    printAccessibilityEvent(accessible, signal_query.signal_name);
-
-    return TRUE;
-}
-
 void connectAccessibilityCallbacks()
 {
     // Ensure no callbacks are connected before.
@@ -147,11 +122,6 @@
     AtkObject* dummyNoOpAxObject = atk_no_op_object_new(dummyAxObject);
     g_object_unref(G_OBJECT(dummyNoOpAxObject));
     g_object_unref(dummyAxObject);
-
-    // Add global listeners for AtkDocument's signals.
-    loadCompleteListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:load-complete");
-    loadStoppedListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:load-stopped");
-    reloadListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:reload");
 }
 
 void disconnectAccessibilityCallbacks()
@@ -181,19 +151,5 @@
         atk_remove_global_event_listener(visibleDataChangedListenerId);
         visibleDataChangedListenerId = 0;
     }
-
-    // AtkDocument signals.
-    if (loadCompleteListenerId) {
-        atk_remove_global_event_listener(loadCompleteListenerId);
-        loadCompleteListenerId = 0;
-    }
-    if (loadStoppedListenerId) {
-        atk_remove_global_event_listener(loadStoppedListenerId);
-        loadStoppedListenerId = 0;
-    }
-    if (reloadListenerId) {
-        atk_remove_global_event_listener(reloadListenerId);
-        reloadListenerId = 0;
-    }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to