I need to have a layout test register a callback with DRT, then have that 
callback be called at the appropriate time (in order to test accessibility 
notifications)

I can't figure out the right incantations to do so. 

I'd like to do something like this in the LayoutTest

var addedNotification = liveRegion.addNotificationListener("ariaCallback");

then have a function in the test like

function ariaCallback(notification) {
   // do stuff with notification
}

DRT knows when to call this method, but I'm not sure how.. This is what I have 
so far, which does not work.

// The JavaScript callback we'll use when we get a notification
static JSStringRef AXNotificationFunctionCallback = 0;

static void _accessibilityNotificationCallback(id element, NSString* 
notification)
{
    if (!AXNotificationFunctionCallback)
        return;
    
    JSObjectRef function = JSObjectMakeFunction([mainFrame globalContext], 
NULL, 0, NULL, AXNotificationFunctionCallback, NULL, 1, NULL);
    JSValueRef argument = JSValueMakeString([mainFrame globalContext], 
JSStringCreateWithCFString((CFStringRef)notification));
    
    
    JSObjectCallAsFunction([mainFrame globalContext], function, NULL, 1, 
&argument, NULL);
}
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to