WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolatedWorld
<rdar://problem/8193636>
Created attachment 79574 [details] Patch
Attachment 79574 [details] did not build on qt: Build output: http://queues.webkit.org/results/7617214
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.
(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.
Committed r76259: <http://trac.webkit.org/changeset/76259>