[Webkit-unassigned] [Bug 90675] Web Inspector: implement testing harness for pure protocol tests.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 19 00:25:26 PDT 2012


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





--- Comment #11 from Pavel Feldman <pfeldman at chromium.org>  2012-07-19 00:25:25 PST ---
(In reply to comment #10)
> (In reply to comment #9)
> > Capturing the IRC discussion here:
> > 
> > So the (ideal) plan would be:
> > 
> > 1) Implement window.internals.openInspectorTestFrontend
> > 
> > This method will create a Page, install the InspectorFrontendClientLocal-based harness on it (a-la Qt or GTK port). This should require almost no code.
> > 
> 
> Will this be a raw page from Page.h? If yes, then should we pass all the clients via PageClients as null(0) to this new page?
> 

Yes, ideally, we should be able to instantiate a page. But passing 0 clients will not work. Sometimes you will get away with 0, sometimes you need to instantiate the ones from EmptyClients, but in some cases you might need stub implementation. Instantiating a page was a major risk in this approach, but I think we should take it.

> I have the following pseudo code in my mind about this:
> 
> Internals.cpp
> =============
> class InspectorFrontendClientDummy : public InspectorFrontendClientLocal
> {
> public:
>     // Most of the methods go notImplemented() here
> };
> 
> class InspectorFrontendChannelDummy : public InspectorFrontendChannel
> {
> public:
>     virtual bool sendMessageToFrontend(const String& message) {
>         // We can eval script here.
>         // WebInspector.dispatchMessageFromBackend(message)
>     }
> };
> 
> boolean Internals::openDummyInspectorFrontend() {
>     Page::PageClients pageClients;
>     pageClients.chromeClient = 0;
>     pageClients.contextMenuClient = 0;
>     pageClients.editorClient = 0;
>     pageClients.dragClient = 0;
>     pageClients.inspectorClient = 0;
>     m_page = new Page(pageClients); 
> 
>     m_frontendClient = new InspectorFrontendClientDummy(...); 
> 
>     m_page->inspectorController()->setInspectorFrontendClient(m_frontendClient);
> 
>     m_frontendChannel = new InspectorFrontendChannelDummy(...);

You should not need to do this as long as you instantiate InspectorFrontendClientLocal with the right Page* frontendPage instance that you create. Then you just pass its instance into the connectFrontend.

> 
>     m_page->inspectorController()->connectFrontend(m_frontendChannel);
> }
> 
> 
> Now my questions are:
> 1. Can the internals object hold these members: m_frontendClient, m_page, m_frontendChannel?

I don't see why not as long as it maintains proper ownership / lifetime for the objects.

> 2. If yes, when should these be destroyed?(in Internals object desctrutor?)

You should create everything upon window.internals.showBlankInspectorFrontend and destroy everything upon window.internals.closeBlankInspectorFrontend.

> 3. Other possibility is we can make the m_frontendChannel member of InspectorFrontendClientDummy and destroy it as soon as closeWindow() is called.

I am not sure you will need this dummy guy.

> 4. How to handle the remote frontend? (or do we need to handle the remote case as I am not aware whether these tests can be run on remote devices?)
> 

There is no such thing, you should not worry about it here.

> Please let me know your thoughts on the same. Thank you.

This all sounds reasonable!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list