Bug 72732 - [GTK] Accessibility API tests not loading Gtk's accessibility implementation
Summary: [GTK] Accessibility API tests not loading Gtk's accessibility implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2011-11-18 08:27 PST by Mario Sanchez Prada
Modified: 2011-11-18 09:05 PST (History)
1 user (show)

See Also:


Attachments
Patch proposal (7.71 KB, patch)
2011-11-18 08:44 PST, Mario Sanchez Prada
pnormand: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2011-11-18 08:27:19 PST
After some investigation because of the issues temporarily fixed along with bug 72708, I found the root reason behind of AtkObject's for non-WebKit GtkWidgets non being loaded through gtk_widget_get_accessible(), in testatk.c:

The problem is that, as the other API tests for WebKitGTK+, the testing framework is being initialized through the gtk_test_init() function, and if we read across the documentation of that function: 

   "It will in turn call g_test_init() and gtk_init() to properly initialize the testing framework and
    graphical toolkit. It'll also set the program's locale to "C" and prevent loading of rc files  and
    Gtk+ modules. This is done to make tets program environments as deterministic as possible."

As you can see, calling that function "prevents loading Gtk+ modules", so that's why GtkWidgets were not returning the proper AtkObjects for them, even after running the test with GTK_MODULES=gail. Actually, we find clear proof of this in gtk_test_init() source code:

   void gtk_test_init (int *argcp,  char ***argvp,  ...)
   {
     g_test_init (argcp, argvp, NULL);

     g_setenv ("GTK_MODULES", "", TRUE);   // SEE THIS?
     gtk_disable_setlocale();
     setlocale (LC_ALL, "C");
     g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id=%s");

     gdk_disable_multidevice ();

     gtk_init (argcp, argvp);
   }

Fortunately, this should stop being a problem after updating the bots to Gtk+ 3.2, since GAIL (Gtk+ Accessibility Implementation Library) won't longer be a separate module but part of Gtk+. However, until that happens we'll need to handle this in some way, and my proposal at this point would be to replace usage of gtk_test_init() in testatk.c with a helper function that basically copies the code from gtk_test_init(), modifying it to load the "gail" module only, instead of ensuring that no module is loaded.

Will attach a patch soon implementing that idea, and properly commenting the situation in the code.
Comment 1 Mario Sanchez Prada 2011-11-18 08:44:26 PST
Created attachment 115819 [details]
Patch proposal
Comment 2 Philippe Normand 2011-11-18 08:49:48 PST
Comment on attachment 115819 [details]
Patch proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=115819&action=review

Ok let's do this for now :)

> Source/WebKit/gtk/tests/testatk.c:1679
> +/* Please remove this function and replace its usage by
> +   gtk_test_init() when upgrading to GTK 3.2 or greater. */

Can you open a bug about this and mention it in a FIXME in the patch to land? So we don't forget about it.
Comment 3 Mario Sanchez Prada 2011-11-18 09:01:38 PST
(In reply to comment #2)
> [...]
> > Source/WebKit/gtk/tests/testatk.c:1679
> > +/* Please remove this function and replace its usage by
> > +   gtk_test_init() when upgrading to GTK 3.2 or greater. */
>
> Can you open a bug about this

Done: bug 72735

> and mention it in a FIXME in the patch to land? So we don't forget about it.

I'll do.

Thanks!
Comment 4 Mario Sanchez Prada 2011-11-18 09:05:32 PST
Committed r100783: <http://trac.webkit.org/changeset/100783>