WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
42327
WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolatedWorld
https://bugs.webkit.org/show_bug.cgi?id=42327
Summary
WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolat...
Maciej Stachowiak
Reported
2010-07-14 20:53:03 PDT
WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolatedWorld
Attachments
Patch
(14.79 KB, patch)
2011-01-20 03:37 PST
,
Maciej Stachowiak
aroben
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Maciej Stachowiak
Comment 1
2010-07-14 20:58:45 PDT
<
rdar://problem/8193636
>
Maciej Stachowiak
Comment 2
2011-01-20 03:37:51 PST
Created
attachment 79574
[details]
Patch
Early Warning System Bot
Comment 3
2011-01-20 04:54:04 PST
Attachment 79574
[details]
did not build on qt: Build output:
http://queues.webkit.org/results/7617214
Adam Roben (:aroben)
Comment 4
2011-01-20 08:22:30 PST
Comment on
attachment 79574
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=79574&action=review
You could try to touch some file in JSC in this patch to make the Qt bots rebuild. (It will help real people, too, not just the bots!)
> Source/WebKit2/WebProcess/WebPage/WebFrame.cpp:463 > + if (!strcmp(globalObjectObj->classInfo()->className, "JSDOMWindowShell")) {
An early-return here would be nicer, I think.
> Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:533 > + JSObjectSetProperty(context, window, JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("__worldID")).get(), JSValueMakeNumber(context, LayoutTestController::worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0);
I think you can use the toJS helper function instead of calling JSStringCreateWithUTF8CString.
> Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:328 > +unsigned LayoutTestController::worldIDForWorld(WKBundleScriptWorldRef world) > +{ > + WorldMap::const_iterator end = worldMap().end(); > + for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { > + if (it->second == world) > + return it->first; > + } > + > + return 0; > +}
Maybe someday we'll add a HashMap::findValue function that would do this for you.
> Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:336 > + WKBundleScriptWorldRef world; > + if (!worldID) > + world = WKBundleScriptWorldCreateWorld();
Looks like you're leaking this newly-created world.
> Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:346 > + WKBundleFrameRef frame = WKBundleFrameForJavaScriptContext(context); > + if (!frame) > + frame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
DumpRenderTree only ever evaluates the script in the main frame. I guess this is an improvement, though it could lead to confusing differences in tests that try to evaluate script in a subframe.
Andras Becsi
Comment 5
2011-01-20 08:31:42 PST
(In reply to
comment #3
)
>
Attachment 79574
[details]
did not build on qt: > Build output:
http://queues.webkit.org/results/7617214
It builds for me with a clean build, on the EWS the symbol seems to get stripped away somehow. Adam's suggestion to touch some file would probably work, but I can force a clean build on the bot after the patch was landed.
Maciej Stachowiak
Comment 6
2011-01-20 09:16:17 PST
Committed
r76259
: <
http://trac.webkit.org/changeset/76259
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug