Changeset 101951 in webkit


Ignore:
Timestamp:
Dec 4, 2011 1:39:28 AM (12 years ago)
Author:
mario@webkit.org
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.
Location:
trunk
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101950 r101951  
     12011-12-03  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        [GTK] Don't log document events in DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=73746
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unskip passing test, remove other transformed into a unit test and
     9        rebaseline expectations now we stopped logging document events.
     10
     11        * platform/gtk/Skipped: Removed two skipped tests.
     12        * platform/gtk/accessibility/aria-slider-required-attributes-expected.txt: Rebaselined
     13        * platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt: Ditto.
     14        * platform/gtk/accessibility/document-reload-events-expected.txt: Removed.
     15        * platform/gtk/accessibility/document-reload-events.html: Removed.
     16
    1172011-12-04  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/LayoutTests/platform/gtk/Skipped

    r101927 r101951  
    13601360# Need layoutTestController.setShouldStayOnPageAfterHandlingBeforeUnload
    13611361fast/loader/form-submission-after-beforeunload-cancel.html
    1362 
    1363 # https://bugs.webkit.org/show_bug.cgi?id=67398
    1364 platform/gtk/accessibility/combo-box-collapsed-selection-changed.html
    1365 platform/gtk/accessibility/document-reload-events.html
    13661362
    13671363# https://bugs.webkit.org/show_bug.cgi?id=67713
  • trunk/LayoutTests/platform/gtk/accessibility/aria-slider-required-attributes-expected.txt

    r82095 r101951  
    11Accessibility object emitted "focus-event = 1" / Name: "(No name)" / Role: 50
    22Accessibility object emitted "state-change:focused = 1" / Name: "(No name)" / Role: 50
    3 Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
    43Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
    54Accessibility object emitted "property-change:accessible-value" / Name: "(No name)" / Role: 50
  • trunk/LayoutTests/platform/gtk/accessibility/combo-box-collapsed-selection-changed-expected.txt

    r80214 r101951  
    2727Accessibility object emitted "focus-event = 1" / Name: "foo" / Role: 34
    2828Accessibility object emitted "state-change:focused = 1" / Name: "foo" / Role: 34
    29 Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
    30 Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
    3129
    3230This tests that the 'state-changed:selected' signal is emitted when arrowing through the options of a combobox while collapsed.
  • trunk/Source/WebKit/gtk/ChangeLog

    r101933 r101951  
     12011-12-03  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Removing document related events from DRT
     4
     5        [GTK] Don't log document events in DRT
     6        https://bugs.webkit.org/show_bug.cgi?id=73746
     7
     8        Reviewed by Martin Robinson.
     9
     10        New unit test to check events when reloading a document. This
     11        replaces the former document-reload-events.html layout test.
     12
     13        * tests/testatk.c:
     14        (updateLoadingEventsResult): New, updates a global variable to
     15        allow checking later on that the right signals were emmitted.
     16        (documentLoadingEventCallback): New, global listener for load-complete
     17        and reload signals over the document object (the web area).
     18        (testWebkitAtkDocumentLoadingEvents): New unit test, globally
     19        connects to document-related signals and check they are properly
     20        emitted when reloading the web view.
     21        (main): Added new test.
     22
    1232011-12-03  Xan Lopez  <xlopez@igalia.com>
    224
  • trunk/Source/WebKit/gtk/tests/testatk.c

    r101349 r101951  
    488488}
    489489
     490static gchar* loadingEventsResult = 0;
     491
     492static void updateLoadingEventsResult(const gchar* signalName)
     493{
     494    g_assert(signalName);
     495
     496    gchar* previousResult = loadingEventsResult;
     497    loadingEventsResult = g_strdup_printf("%s|%s", previousResult, signalName);
     498    g_free(previousResult);
     499}
     500
     501static gboolean documentLoadingEventCallback(GSignalInvocationHint *signalHint, guint numParamValues, const GValue *paramValues, gpointer data)
     502{
     503    // At least we should receive the instance emitting the signal.
     504    if (numParamValues < 1)
     505        return TRUE;
     506
     507    GSignalQuery signal_query;
     508    g_signal_query(signalHint->signal_id, &signal_query);
     509
     510    updateLoadingEventsResult(signal_query.signal_name);
     511    return TRUE;
     512}
     513
     514static void testWebkitAtkDocumentLoadingEvents()
     515{
     516    WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
     517    g_object_ref_sink(webView);
     518    GtkAllocation allocation = { 0, 0, 800, 600 };
     519    gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation);
     520    webkit_web_view_load_string(webView, contents, 0, 0, 0);
     521
     522    /* Trigger the creation of the full accessibility hierarchy by
     523       asking for the webArea object, so we can listen to events. */
     524    getWebAreaObject(webView);
     525
     526    /* Connect globally to see those events during a reload, since the
     527       document after that will be different than what we have now. */
     528    guint loadCompleteListenerId = atk_add_global_event_listener(documentLoadingEventCallback, "ATK:AtkDocument:load-complete");
     529    guint reloadListenerId = atk_add_global_event_listener(documentLoadingEventCallback, "ATK:AtkDocument:reload");
     530
     531    /* Reload, so we can see those load events happening. */
     532    loadingEventsResult = g_strdup("");
     533    webkit_web_view_reload(webView);
     534
     535    atk_remove_global_event_listener(loadCompleteListenerId);
     536    atk_remove_global_event_listener(reloadListenerId);
     537
     538    g_assert_cmpstr(loadingEventsResult, ==, "|reload|load-complete");
     539
     540    g_free(loadingEventsResult);
     541    g_object_unref(webView);
     542}
     543
    490544static void testWebkitAtkEmbeddedObjects()
    491545{
     
    17201774    g_test_add_func("/webkit/atk/caretOffsetsAndExtranousWhiteSpaces", testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces);
    17211775    g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox);
     1776    g_test_add_func("/webkit/atk/documentLoadingEvents", testWebkitAtkDocumentLoadingEvents);
    17221777    g_test_add_func("/webkit/atk/embeddedObjects", testWebkitAtkEmbeddedObjects);
    17231778    g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset);
  • trunk/Tools/ChangeLog

    r101939 r101951  
     12011-12-03  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        [GTK] Don't log document events in DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=73746
     5
     6        Reviewed by Martin Robinson.
     7
     8        Stop connecting globally to document-related events.
     9
     10        * DumpRenderTree/gtk/AccessibilityCallbacks.cpp:
     11        (connectAccessibilityCallbacks): Removed connections.
     12        (disconnectAccessibilityCallbacks): Removed disconnections.
     13
    1142011-12-03  Dan Bernstein  <mitz@apple.com>
    215
  • trunk/Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp

    r81810 r101951  
    4343static guint propertyChangedListenerId = 0;
    4444static guint visibleDataChangedListenerId = 0;
    45 
    46 static guint loadCompleteListenerId = 0;
    47 static guint loadStoppedListenerId = 0;
    48 static guint reloadListenerId = 0;
    4945
    5046static void printAccessibilityEvent(AtkObject* accessible, const gchar* signalName)
     
    104100}
    105101
    106 static gboolean axDocumentEventListener(GSignalInvocationHint *signalHint,
    107                                         guint numParamValues,
    108                                         const GValue *paramValues,
    109                                         gpointer data)
    110 {
    111     // At least we should receive the instance emitting the signal.
    112     if (numParamValues < 1)
    113         return TRUE;
    114 
    115     AtkObject* accessible = ATK_OBJECT(g_value_get_object(&paramValues[0]));
    116     if (!accessible || !ATK_IS_DOCUMENT(accessible))
    117         return TRUE;
    118 
    119     GSignalQuery signal_query;
    120     g_signal_query(signalHint->signal_id, &signal_query);
    121 
    122     printAccessibilityEvent(accessible, signal_query.signal_name);
    123 
    124     return TRUE;
    125 }
    126 
    127102void connectAccessibilityCallbacks()
    128103{
     
    148123    g_object_unref(G_OBJECT(dummyNoOpAxObject));
    149124    g_object_unref(dummyAxObject);
    150 
    151     // Add global listeners for AtkDocument's signals.
    152     loadCompleteListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:load-complete");
    153     loadStoppedListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:load-stopped");
    154     reloadListenerId = atk_add_global_event_listener(axDocumentEventListener, "Gtk:AtkDocument:reload");
    155125}
    156126
     
    182152        visibleDataChangedListenerId = 0;
    183153    }
    184 
    185     // AtkDocument signals.
    186     if (loadCompleteListenerId) {
    187         atk_remove_global_event_listener(loadCompleteListenerId);
    188         loadCompleteListenerId = 0;
    189     }
    190     if (loadStoppedListenerId) {
    191         atk_remove_global_event_listener(loadStoppedListenerId);
    192         loadStoppedListenerId = 0;
    193     }
    194     if (reloadListenerId) {
    195         atk_remove_global_event_listener(reloadListenerId);
    196         reloadListenerId = 0;
    197     }
    198154}
    199155
Note: See TracChangeset for help on using the changeset viewer.