WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
Bug 88183
Implement layoutTestController using IDL in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=88183
Summary
Implement layoutTestController using IDL in DumpRenderTree
Ryosuke Niwa
Reported
2012-06-02 23:13:04 PDT
Right now, layoutTestController directly adds itself to window object using JSC/V8 code. It'll be nice if it were done via IDL files like internals object.
Attachments
work in progress
(31.10 KB, patch)
2012-06-03 04:11 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
work in progress 2
(70.49 KB, patch)
2012-06-04 13:40 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2012-06-02 23:17:17 PDT
The challenge here is that layoutTestController is defined in DumpRenderTree instead of WebCore so we can't use Source/WebCore/DerivedSources.make. One thing we can do is to add layoutTestController as an abstract class in WebCore/testing/ along with an IDL file, and let DumpRenderTree implement it with a concrete class. That might be cleaner than introducing a derived source in DumpRenderTree since the latter involves modifying all build systems we have.
Adam Barth
Comment 2
2012-06-02 23:41:16 PDT
That sounds like a reasonable solution. Adding a method would then involve editing the IDL file, the ABC, and the concrete LayoutTestController object. That still seems like an improvement over the current situation.
Ryosuke Niwa
Comment 3
2012-06-02 23:46:01 PDT
(In reply to
comment #2
)
> That sounds like a reasonable solution. Adding a method would then involve editing the IDL file, the ABC, and the concrete LayoutTestController object. That still seems like an improvement over the current situation.
Yeah, we'll at least eliminate the need to modify both JSC and V8 versions of layoutTestController.cpp files.
Adam Barth
Comment 4
2012-06-02 23:55:26 PDT
I haven't looked at the details in a while, but I seem to remember that DRT and LayoutTestController don't share that much code across ports. Having an ABC might be a good way to share more code. For example, you could have an intermediate class that's shared by all the ports and then a further port-specific leaf class. We'll have to look at the details to see what makes the most sense.
Ryosuke Niwa
Comment 5
2012-06-03 04:11:19 PDT
Created
attachment 145480
[details]
work in progress The test passes on Mac WebKit1. Will finish it up tomorrow.
Adam Barth
Comment 6
2012-06-03 08:38:02 PDT
Comment on
attachment 145480
[details]
work in progress View in context:
https://bugs.webkit.org/attachment.cgi?id=145480&action=review
> Tools/DumpRenderTree/LayoutTestController.h:445 > +class TestRunner : public WebCore::TestRunnerBase {
I was expecting LayoutTestController to inherit from TestRunnerBase. As written, you're going to need to forward every call to m_controller...
Ryosuke Niwa
Comment 7
2012-06-03 11:15:22 PDT
(In reply to
comment #6
)
> (From update of
attachment 145480
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=145480&action=review
> > > Tools/DumpRenderTree/LayoutTestController.h:445 > > +class TestRunner : public WebCore::TestRunnerBase { > > I was expecting LayoutTestController to inherit from TestRunnerBase. As written, you're going to need to forward every call to m_controller...
It turns out LayoutTestController doesn't implement methods like dumpAsText or waitUntilDone. Instead, static callback functions implement those. So my current plan is to implement TestRunner class as a proxy for LayoutTestController, transition to use IDL, and then merge the existing LayoutTestController into TestRunner. I mean... I could attempt to do all of them at once but the patch is going to be huge then.
Adam Barth
Comment 8
2012-06-03 11:17:08 PDT
Ah, ok. That makes sense.
Ryosuke Niwa
Comment 9
2012-06-03 11:50:30 PDT
(In reply to
comment #8
)
> Ah, ok. That makes sense.
But now I realize that WebKit2 already has layoutTestController.idl and CodeGeneratorTestRunner.pm. And it's a bit tricky to share the code there because of extensions like "PassContext".
Ryosuke Niwa
Comment 10
2012-06-03 12:02:58 PDT
I guess doing the rename in this patch is too aggressive given the separate IDL & code generator in WebKit2. We probably need to add IDL support in DumpRenderTree first, and somehow share IDL files between WebKitTestRunner and DumpRenderTree.
Ryosuke Niwa
Comment 11
2012-06-03 12:04:38 PDT
+Sam, +Maciej since they implemented WebKitTestRunner's IDL & code generator.
Adam Barth
Comment 12
2012-06-03 12:25:34 PDT
You're being drawn into the bigger problem, which is to unify DumpRenderTree and WebKitTestRunner. Sharing the IDL file seems valuable given that we expect tests to run both in WebKit1 and WebKit2.
Ryosuke Niwa
Comment 13
2012-06-03 13:01:51 PDT
(In reply to
comment #12
)
> You're being drawn into the bigger problem, which is to unify DumpRenderTree and WebKitTestRunner. Sharing the IDL file seems valuable given that we expect tests to run both in WebKit1 and WebKit2.
Yeah, we should probably do it in a separate patch though. This patch has already gotten quite massive.
Adam Barth
Comment 14
2012-06-03 13:03:53 PDT
Doing it in a separate patch is fine. I'd just recommending having a plan in mind for how to share the IDL file.
Ryosuke Niwa
Comment 15
2012-06-04 13:40:44 PDT
Created
attachment 145622
[details]
work in progress 2
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