[ATK] Deprecate usage of logAccessibilityEvents() in layout tests
authormario.prada@samsung.com <mario.prada@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 May 2014 16:47:06 +0000 (16:47 +0000)
committermario.prada@samsung.com <mario.prada@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 May 2014 16:47:06 +0000 (16:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132280

Reviewed by Chris Fleizach.

Tools:
Remove implementation of logAccessibilityEvents() for ATK based
ports, as this has proved to be a flaky method of checking that
ATK events are being properly emitted. Instead, it's better to use
the addNotificationListener() functions and provide a JS callback
to check that the right events are being emmitted from the tests.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
(WTR::AccessibilityController::logAccessibilityEvents): Replaced
with dummy implementation.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::logAccessibilityEvents): Removed

LayoutTests:
Removed 36 flaky expectations from TestExpectations for tests that
were ocassionally showing the output of logAccessibilityEvents()
even if they did not make use of that feature (thus the flakiness).

* platform/gtk/TestExpectations: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169487 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.h

index 52fc82d..efd2ea2 100644 (file)
@@ -1,3 +1,16 @@
+2014-05-30  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        [ATK] Deprecate usage of logAccessibilityEvents() in layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=132280
+
+        Reviewed by Chris Fleizach.
+
+        Removed 36 flaky expectations from TestExpectations for tests that
+        were ocassionally showing the output of logAccessibilityEvents()
+        even if they did not make use of that feature (thus the flakiness).
+
+        * platform/gtk/TestExpectations: Updated.
+
 2014-05-30  Jarek Czekalski  <jarekczek@poczta.onet.pl>
 
         [ATK] Convert caret offset tests from testatk.c.
index 5bd534f..cabb8ae 100644 (file)
@@ -823,44 +823,6 @@ webkit.org/b/132277 fast/images/image-map-zoom.html [ Failure Pass ]
 webkit.org/b/132277 fast/images/imagemap-case.html [ Failure Pass ]
 webkit.org/b/132277 fast/images/imagemap-dynamic-area-updates.html [ Failure Pass ]
 
-#Accessibility
-webkit.org/b/132280 platform/gtk/accessibility/aria-table-hierarchy.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/aria-toggle-button-role.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/button-accessible-name.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/caret-browsing-select-focus.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/caret-browsing-text-focus.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/entry-and-password.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/input-slider.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/list-items-always-exposed.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/media-controls-panel-title.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/media-emits-object-replacement.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/name-from-label.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/object-with-title.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/remapped-aria-crash.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/spans-paragraphs-and-divs.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/spans.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/table-hierarchy.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-embedded-objects.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-newlines.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-preformatted.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-simple.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-special-chars.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-textarea.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-textinput.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-at-offset-wrapped-lines.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-combo-box.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-embedded-objects.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-entry-and-password.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-extraneous-whitespace.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-formatted.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-heading.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-list-items.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-simple.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-table-cells.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-range-with-link.html [ Failure Pass ]
-webkit.org/b/132280 platform/gtk/accessibility/text-for-table.html [ Failure Pass ]
-
 webkit.org/b/132425 fast/multicol/scrolling-overflow.html [ Failure Pass ]
 webkit.org/b/132425 fast/multicol/span/span-as-immediate-child-generated-content.html [ Failure Pass ]
 
index 54cf439..6a836c8 100644 (file)
@@ -3,6 +3,25 @@
         [ATK] Deprecate usage of logAccessibilityEvents() in layout tests
         https://bugs.webkit.org/show_bug.cgi?id=132280
 
+        Reviewed by Chris Fleizach.
+
+        Remove implementation of logAccessibilityEvents() for ATK based
+        ports, as this has proved to be a flaky method of checking that
+        ATK events are being properly emitted. Instead, it's better to use
+        the addNotificationListener() functions and provide a JS callback
+        to check that the right events are being emmitted from the tests.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
+        (WTR::AccessibilityController::logAccessibilityEvents): Replaced
+        with dummy implementation.
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        (WTR::AccessibilityNotificationHandler::logAccessibilityEvents): Removed
+
+2014-05-30  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        [ATK] Deprecate usage of logAccessibilityEvents() in layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=132280
+
         Rubber stamped by Carlos Garcia Campos.
 
         Fix two small issues with previous patch (r169483), that caused some tests to break.
index ea0f4ea..9352772 100644 (file)
@@ -43,23 +43,8 @@ namespace WTR {
 
 void AccessibilityController::logAccessibilityEvents()
 {
-    // Ensure no callbacks are connected before.
-    resetToConsistentState();
-
-    // Ensure that accessibility is initialized for the WebView by querying for
-    // the root accessible object, which will create the full hierarchy.
-    rootElement();
-
-    if (!m_globalNotificationHandler)
-        m_globalNotificationHandler = AccessibilityNotificationHandler::create();
-    m_globalNotificationHandler->logAccessibilityEvents();
-
-    // Ensure the Atk interface types are registered, otherwise
-    // the AtkDocument signal handlers below won't get registered.
-    GObject* dummyAxObject = G_OBJECT(g_object_new(ATK_TYPE_OBJECT, nullptr));
-    AtkObject* dummyNoOpAxObject = atk_no_op_object_new(dummyAxObject);
-    g_object_unref(G_OBJECT(dummyNoOpAxObject));
-    g_object_unref(dummyAxObject);
+    // No longer implemented for ATK. Use addNotificationListener() instead to
+    // check that relevant ATK signals are being emmitted in response to events.
 }
 
 void AccessibilityController::resetToConsistentState()
index e0b1c96..bcab6e7 100644 (file)
@@ -43,29 +43,6 @@ typedef HashMap<AtkObject*, AccessibilityNotificationHandler*> NotificationHandl
 WTF::Vector<unsigned> listenerIds;
 NotificationHandlersMap notificationHandlers;
 AccessibilityNotificationHandler* globalNotificationHandler = nullptr;
-bool loggingAccessibilityEvents = false;
-
-void printAccessibilityEvent(AtkObject* accessible, const char* signalName, const char* signalValue)
-{
-    // Do not handle state-change:defunct signals, as the AtkObject
-    // associated to them will not be valid at this point already.
-    if (!signalName || !g_strcmp0(signalName, "state-change:defunct"))
-        return;
-
-    if (!accessible || !ATK_IS_OBJECT(accessible))
-        return;
-
-    const char* objectName = atk_object_get_name(accessible);
-    AtkRole objectRole = atk_object_get_role(accessible);
-
-    // Try to always provide a name to be logged for the object.
-    if (!objectName || *objectName == '\0')
-        objectName = "(No name)";
-
-    GUniquePtr<char> signalNameAndValue(signalValue ? g_strdup_printf("%s = %s", signalName, signalValue) : g_strdup(signalName));
-    GUniquePtr<char> accessibilityEventString(g_strdup_printf("Accessibility object emitted \"%s\" / Name: \"%s\" / Role: %d\n", signalNameAndValue.get(), objectName, objectRole));
-    InjectedBundle::shared().outputText(String::fromUTF8(accessibilityEventString.get()));
-}
 
 gboolean axObjectEventListener(GSignalInvocationHint* signalHint, unsigned numParamValues, const GValue* paramValues, gpointer data)
 {
@@ -125,9 +102,6 @@ gboolean axObjectEventListener(GSignalInvocationHint* signalHint, unsigned numPa
     } else
         signalName.reset(g_strdup(signalQuery.signal_name));
 
-    if (loggingAccessibilityEvents)
-        printAccessibilityEvent(accessible, signalName.get(), signalValue.get());
-
     if (!jsContext)
         return true;
 
@@ -174,12 +148,6 @@ AccessibilityNotificationHandler::~AccessibilityNotificationHandler()
     disconnectAccessibilityCallbacks();
 }
 
-void AccessibilityNotificationHandler::logAccessibilityEvents()
-{
-    connectAccessibilityCallbacks();
-    loggingAccessibilityEvents = true;
-}
-
 void AccessibilityNotificationHandler::setNotificationFunctionCallback(JSValueRef notificationFunctionCallback)
 {
     if (!notificationFunctionCallback) {
index 3443bce..c84e4dc 100644 (file)
@@ -42,7 +42,6 @@ public:
     GRefPtr<AtkObject> platformElement() const { return m_platformElement; }
     void setNotificationFunctionCallback(JSValueRef);
     JSValueRef notificationFunctionCallback() const { return m_notificationFunctionCallback; }
-    void logAccessibilityEvents();
 
 private:
     AccessibilityNotificationHandler();