Bug 99904 - [chromium] introduce a public API for the TestRunner library
Summary: [chromium] introduce a public API for the TestRunner library
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 21:17 PDT by jochen
Modified: 2012-10-21 22:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch (34.93 KB, patch)
2012-10-19 21:19 PDT, jochen
no flags Details | Formatted Diff | Diff
Patch (50.74 KB, patch)
2012-10-21 01:47 PDT, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2012-10-19 21:17:50 PDT
[chromium] introduce a public API for the TestRunner library
Comment 1 jochen 2012-10-19 21:19:46 PDT
Created attachment 169751 [details]
Patch
Comment 2 Adam Barth 2012-10-19 23:03:14 PDT
Comment on attachment 169751 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169751&action=review

> Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h:40
> +class WebAccessibilityController {

How is this going to work in the component build?  I assume we're not going to link this into webkit.dll.  Does that means we're going to link it into content.dll?  Do we need a new TestRunner.dll ?
Comment 3 jochen 2012-10-19 23:16:49 PDT
(In reply to comment #2)
> (From update of attachment 169751 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169751&action=review
> 
> > Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h:40
> > +class WebAccessibilityController {
> 
> How is this going to work in the component build?  I assume we're not going to link this into webkit.dll.  Does that means we're going to link it into content.dll?  Do we need a new TestRunner.dll ?

Since it only depends on symbols exported from webkit.dll, I guess it can be directly linked into the content_shell
Comment 4 Adam Barth 2012-10-19 23:20:57 PDT
> Since it only depends on symbols exported from webkit.dll, I guess it can be directly linked into the content_shell

I wonder if it would be better as a separate DLL.  That will help make sure the dependencies are clean.
Comment 5 Adam Barth 2012-10-19 23:23:42 PDT
Comment on attachment 169751 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169751&action=review

> Tools/DumpRenderTree/chromium/TestRunner/public/WebAccessibilityController.h:36
> +class AccessibilityController;
> +
> +namespace WebKit {

You might want to take this opportunity to introduce a separate namespace for this library.  For example, we could use the namespace TestRunner or WebTestRunner.  Using the WebKit namespace isn't quite right because this is outside webkit.dll.

Do we want to put the implementation and the API into different namespaces?  My gut says that's overkill.
Comment 6 jochen 2012-10-19 23:44:18 PDT
(In reply to comment #4)
> > Since it only depends on symbols exported from webkit.dll, I guess it can be directly linked into the content_shell
> 
> I wonder if it would be better as a separate DLL.  That will help make sure the dependencies are clean.

I think long term that's definitely desirable.

I decided against going there immediately because of Task.h and TestRunner.h that are still directly consumed by DRT.
Comment 7 Adam Barth 2012-10-19 23:55:26 PDT
Makes sense.  However, I think we should set up the API in a way that makes that transition easy.  For the time being, I think that mostly means using a new namespace and deciding which functions can only be called from "inside" the library (e.g., the WebAccessibilityController(AccessibilityController*) constructor).
Comment 8 jochen 2012-10-21 01:47:09 PDT
Created attachment 169789 [details]
Patch
Comment 9 jochen 2012-10-21 01:49:54 PDT
I've moved the public API into the namespace WebTestRunner (but of the implementation only the required pieces yet), added a WEBTESTRUNNER_IMPLEMENTATION define, and removed a WTF header ref (wtf/Vector)

I also verified that this builds with a component build in chromium
Comment 10 Adam Barth 2012-10-21 15:31:17 PDT
Comment on attachment 169789 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169789&action=review

> Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:128
> +    m_internal = new Internal;

We should use WebPrivateOwnPtr here to help us avoid leaking.  We still need to call reset manually, but at least there will be an ASSERT if we screw up.
Comment 11 jochen 2012-10-21 19:57:18 PDT
Comment on attachment 169789 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169789&action=review

>> Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:128
>> +    m_internal = new Internal;
> 
> We should use WebPrivateOwnPtr here to help us avoid leaking.  We still need to call reset manually, but at least there will be an ASSERT if we screw up.

WebPrivateOwnPtr requires WEBKIT_IMPLEMENTATION to be defined in the .cpp file which we don't want.
Comment 12 Adam Barth 2012-10-21 21:30:22 PDT
Good point.  We could generalize it, but it's probably not worth it.
Comment 13 WebKit Review Bot 2012-10-21 22:13:52 PDT
Comment on attachment 169789 [details]
Patch

Clearing flags on attachment: 169789

Committed r132029: <http://trac.webkit.org/changeset/132029>
Comment 14 WebKit Review Bot 2012-10-21 22:13:56 PDT
All reviewed patches have been landed.  Closing bug.