Chris Jerdonek | 1 Jan 2010 04:25
Picon
Gravatar

Re: test scripts

On Wed, Dec 30, 2009 at 2:33 PM, Sam Weinig <sam.weinig <at> gmail.com> wrote:
> I would prefer we stick with the run prefix.
> I am also not sure why we would have separate testing scripts based by
> language.

Thanks, Sam.

The language-specific scripts are more an artifact of the fact that
the Perl test harness is written in Perl and the Python test harness
is written in Python.  They can be viewed as intermediate
implementation steps.

With the exception of a script for testing interpreted code (as Adam
suggested in an earlier e-mail), I do agree with you that contributors
shouldn't have to call or know about the language-specific scripts.  I
submitted a patch to that effect here:

https://bugs.webkit.org/show_bug.cgi?id=33045

>From an implementation perspective though, I do think they can provide
a useful layer of encapsulation when calling from other code.  As I
mentioned in an earlier e-mail, over time we can move the
language-specific scripts to a sub-folder so they won't be as visible
to the end user.

> If the number of these scripts got
> out of hand, we could always add a run-all-tests scripts which ran them all.

I think the intention is not to expose at the top level a separate
script for every component, but to provide only higher-level commands.
(Continue reading)

Chris Fleizach | 2 Jan 2010 04:13
Picon
Favicon

Calling JavaScript function from within DumpRenderTree

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
webkit-dev <at> lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Sam Weinig | 2 Jan 2010 06:25
Picon

Re: Calling JavaScript function from within DumpRenderTree

On Fri, Jan 1, 2010 at 7:13 PM, Chris Fleizach <cfleizach <at> apple.com> wrote:

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);
}

What you need to do is lookup the function object on the global object. Your function would look more like:

static void _accessibilityNotificationCallback(id element, NSString* notification)
{
    if (!AXNotificationFunctionCallback)
        return;
    
    JSValueRef functionValue = JSObjectGetProperty([mainFrame globalContext], JSContextGetGlobalObject([mainFrame globalContext]), AXNotificationFunctionCallback, NULL);
    if (!JSValueIsObject(functionValue))
        return;

    JSObjectRef functionObject = static_cast<JSObjectRef>(functionValue);
    JSValueRef argument = JSValueMakeString([mainFrame globalContext], JSStringCreateWithCFString((CFStringRef)notification));
    JSObjectCallAsFunction([mainFrame globalContext], function, NULL, 1, &argument, NULL);
}

(You probably would want to add some more exception checks).

That said, a more javascripty way to do this would be to pass the function object to liveRegion.addNotificationListener itself.  That way, in the test file, you would have,

liveRegion.addNotificationListener(function(notification) {
   // do stuff with notification
});

In the implementation of addNotificationListener, you would save the function object off instead of saving off the string, and then call it in _accessibilityNotificationCallback.

-Sam

_______________________________________________
webkit-dev mailing list
webkit-dev <at> lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Maciej Stachowiak | 2 Jan 2010 10:34
Picon
Favicon

Re: Calling JavaScript function from within DumpRenderTree


On Jan 1, 2010, at 9:25 PM, Sam Weinig wrote:

>
> That said, a more javascripty way to do this would be to pass the  
> function object to liveRegion.addNotificationListener itself.  That  
> way, in the test file, you would have,
>
> liveRegion.addNotificationListener(function(notification) {
>    // do stuff with notification
> });
>
> In the implementation of addNotificationListener, you would save the  
> function object off instead of saving off the string, and then call  
> it in _accessibilityNotificationCallback.

I would recommend doing it this second way. Note that with this  
approach you can still declare the function up front, and just pass  
the name, but you wouldn't pass it with a string.

  - Maciej
Chris Fleizach | 3 Jan 2010 04:32
Picon
Favicon

Re: Calling JavaScript function from within DumpRenderTree


On Jan 2, 2010, at 1:34 AM, Maciej Stachowiak wrote:


On Jan 1, 2010, at 9:25 PM, Sam Weinig wrote:


That said, a more javascripty way to do this would be to pass the function object to liveRegion.addNotificationListener itself.  That way, in the test file, you would have,

liveRegion.addNotificationListener(function(notification) {
  // do stuff with notification
});

In the implementation of addNotificationListener, you would save the function object off instead of saving off the string, and then call it in _accessibilityNotificationCallback.

I would recommend doing it this second way. Note that with this approach you can still declare the function up front, and just pass the name, but you wouldn't pass it with a string.


I agree. I have it working with this method now. 

Thx


_______________________________________________
webkit-dev mailing list
webkit-dev <at> lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Dominik Roettsches | 4 Jan 2010 11:08

Re: Question about Heap::markConservatively.

Hi Pattin,

> b. Cound somebody tell me the crash reason about?  I think maybe program access non-align(4bytes) memory address?

Did you implement JSC::currentThreadStackBase correctly? It needs to return the base address of the
stack (bottom or top, depending on platform) as the starting point for GC. Could be a cause.

Dominik

________________________________________

Access Systems Germany GmbH
Essener Strasse 5  |  D-46047 Oberhausen
HRB 13548 Amtsgericht Duisburg
Geschaeftsfuehrer: Michel Piquemal, Tomonori Watanabe, Yusuke Kanda

www.access-company.com

CONFIDENTIALITY NOTICE
This e-mail and any attachments hereto may contain information that is privileged or confidential, and is
intended for use only by the
individual or entity to which it is addressed. Any disclosure, copying or distribution of the information
by anyone else is strictly prohibited.
If you have received this document in error, please notify us promptly by responding to this e-mail. Thank you.
Tor Arne Vestbø | 4 Jan 2010 12:48
Picon
Gravatar

Re: Patch status display on bugs.webkit.org

Adam Barth wrote:
> As we bring more bots online, this user interface should scale better
> than posting lots of "pass" comments.  If folks like this display, we
> can incorporate it into bugs.webkit.org directly.

+1 for including this in the site directly! Cool stuff!

Tor Arne
Mario Bensi | 4 Jan 2010 18:40

LayoutTests new-window-opener

Hello,

Just an question on this expected : LayoutTests/fast/dom/Window/new-window-
opener-expected.txt

In test you have this text : 

On success, you will see a series of "PASS" messages, followed by "TEST 
COMPLETE".

But in expected you have : 

Toolbar
FAIL newWin.toolbar.visible should be true. Was false.
PASS newWin.toolbar.visible is false
FAIL newWin.toolbar.visible should be true. Was false.
PASS newWin.toolbar.visible is false

Statusbar
FAIL newWin.statusbar.visible should be true. Was false.
PASS newWin.statusbar.visible is false
FAIL newWin.statusbar.visible should be true. Was false.
PASS newWin.statusbar.visible is false

Locationbar
FAIL newWin.locationbar.visible should be true. Was false.
PASS newWin.locationbar.visible is false
FAIL newWin.locationbar.visible should be true. Was false.
PASS newWin.locationbar.visible is false
PASS window.successfullyParsed is true

Normaly here I should see only "PASS" messages and it's not the case.

Is it an error or the message is not correct ?

Regards
Mario Bensi
Darin Adler | 4 Jan 2010 18:57
Picon
Favicon

Re: Extra privileges for local javascripts with WebkitGtk

WebKit contributors have developed a feature called “isolated worlds” to handle requirements like this.

But I don’t know where we are in the implementation of that feature. Perhaps one of the people working on
isolated worlds could comment on its current status.

    -- Darin
Adam Barth | 4 Jan 2010 19:18
Favicon

Re: Extra privileges for local javascripts with WebkitGtk

Yes.  This is exactly the problem that isolated worlds is trying to
solve.  The implementation in the bindings to the V8 JavaScript engine
is complete.  I believe the implementation in the JavaScriptCore
bindings is complete as well.  You should look for some APIs with the
words "isolated" and "world" in their name.

If you'd like a high-level explanation of what this feature does, see
Section 4.3 of http://www.adambarth.com/papers/2010/barth-felt-saxena-boodman.pdf
(particularly the paragraph named "isolated worlds").

Enjoy!

Adam

On Mon, Jan 4, 2010 at 9:57 AM, Darin Adler <darin <at> apple.com> wrote:
> WebKit contributors have developed a feature called “isolated worlds” to handle requirements like this.
>
> But I don’t know where we are in the implementation of that feature. Perhaps one of the people working on
isolated worlds could comment on its current status.
>
>    -- Darin
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev <at> lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>

Gmane