Bug 87935 - [EFL][DRT] Add support for Web Inspector in WebKit-EFL DRT
Summary: [EFL][DRT] Add support for Web Inspector in WebKit-EFL DRT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 83865 91624
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-31 00:43 PDT by Seokju Kwon
Modified: 2012-07-21 03:34 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.59 KB, patch)
2012-05-31 01:30 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (14.18 KB, patch)
2012-05-31 04:23 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (13.30 KB, patch)
2012-07-09 21:54 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (13.30 KB, patch)
2012-07-10 03:31 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (13.25 KB, patch)
2012-07-10 23:41 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (13.38 KB, patch)
2012-07-15 22:07 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff
Patch (14.00 KB, patch)
2012-07-17 22:56 PDT, Seokju Kwon
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Seokju Kwon 2012-05-31 00:43:09 PDT
It is the first step to support for web inspector in WebKit-EFL DRT.
Comment 1 Seokju Kwon 2012-05-31 01:30:05 PDT
Created attachment 145017 [details]
Patch
Comment 2 Gyuyoung Kim 2012-05-31 02:19:18 PDT
Comment on attachment 145017 [details]
Patch

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

> Source/WebKit/efl/ChangeLog:8
> +        It is the first step to support for Web Inspector in WebKit-EFL DRT

Please write patch description for each ChangeLog more detail. In addition, put a period at the end line.

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:150
> +    evas_object_focus_set(inspector, EINA_TRUE);

Use true instead of EINA_TRUE.

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:590
> +    Evas_Object** view = static_cast<Evas_Object **>(eventInfo);

Should you need to use ** pointer in here ?

> LayoutTests/ChangeLog:8
> +        It is the first step to support for Web Inspector in WebKit-EFL DRT

This is not proper description for this change. Re-write description.

> LayoutTests/platform/efl/Skipped:300
> +#inspector

Remove this all instead of comment.
Comment 3 Gyuyoung Kim 2012-05-31 04:06:09 PDT
Comment on attachment 145017 [details]
Patch

Attachment 145017 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/12864187
Comment 4 Seokju Kwon 2012-05-31 04:20:20 PDT
(In reply to comment #3)
> (From update of attachment 145017 [details])
> Attachment 145017 [details] did not pass efl-ews (efl):
> Output: http://queues.webkit.org/results/12864187

ewk_view_web_inspector_show() and ewk_view_web_inspector_close() are implemented in another patch. (See Bug 83865)
This patch depends on it.
Comment 5 Seokju Kwon 2012-05-31 04:21:13 PDT
(In reply to comment #2)
> (From update of attachment 145017 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145017&action=review
> 
> > Source/WebKit/efl/ChangeLog:8
> > +        It is the first step to support for Web Inspector in WebKit-EFL DRT
>
> Please write patch description for each ChangeLog more detail. In addition, put a period at the end line.
Done!
 
> > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:150
> > +    evas_object_focus_set(inspector, EINA_TRUE);
> 
> Use true instead of EINA_TRUE.
Done!

> > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:590
> > +    Evas_Object** view = static_cast<Evas_Object **>(eventInfo);
> 
> Should you need to use ** pointer in here ?
As you know, Evas smart callback can not return a value. And Use ** pointer for returning a pointer from callback function. 

> > LayoutTests/ChangeLog:8
> > +        It is the first step to support for Web Inspector in WebKit-EFL DRT
> 
> This is not proper description for this change. Re-write description.
Done!

> > LayoutTests/platform/efl/Skipped:300
> > +#inspector
> 
> Remove this all instead of comment.
Done!
Comment 6 Seokju Kwon 2012-05-31 04:23:53 PDT
Created attachment 145047 [details]
Patch
Comment 7 Gyuyoung Kim 2012-05-31 06:07:05 PDT
Comment on attachment 145047 [details]
Patch

Attachment 145047 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/12860328
Comment 8 Seokju Kwon 2012-07-09 21:54:44 PDT
Created attachment 151398 [details]
Patch
Comment 9 Gyuyoung Kim 2012-07-10 02:02:48 PDT
Comment on attachment 151398 [details]
Patch

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

> Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp:69
> +    if (newMessage.contains("Localized string") || (newMessage.contains("Protocol Error: the message is for non-existing domain 'Profiler'")))

nit : Why do you use unneeded ( ) in second condition ?

if (newMessage.contains("Localized string") || newMessage.contains("Protocol Error: the message is for non-existing domain 'Profiler'")) ?

> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:770
> +    // Waits until web inspector resources are loaded

In code level, I don't understand what do you need to wait ?

> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:773
> +        ecore_main_loop_begin();

I wonder if this is meaningful? Because ecore_main_loop_begin() is already called at the beginning of layout test.

http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L257
Comment 10 Seokju Kwon 2012-07-10 03:26:48 PDT
(In reply to comment #9)
> (From update of attachment 151398 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151398&action=review
> 
> > Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp:69
> > +    if (newMessage.contains("Localized string") || (newMessage.contains("Protocol Error: the message is for non-existing domain 'Profiler'")))
> 
> nit : Why do you use unneeded ( ) in second condition ?
> 
> if (newMessage.contains("Localized string") || newMessage.contains("Protocol Error: the message is for non-existing domain 'Profiler'")) ?

I will remove it.

> 
> > Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:770
> > +    // Waits until web inspector resources are loaded
> 
> In code level, I don't understand what do you need to wait ?
> 
> > Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:773
> > +        ecore_main_loop_begin();
> 
> I wonder if this is meaningful? Because ecore_main_loop_begin() is already called at the beginning of layout test.
> 
> http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L257

Test files are using 'WebInspector' object. It is implemented in resources of web inspector(frontend). So Dumprendertree should wait until resources are loaded totally('load, finished'). If not, drt fails tests with error message below.
"ReferenceError: Can't find variable: WebInspector"
Comment 11 Seokju Kwon 2012-07-10 03:31:02 PDT
Created attachment 151428 [details]
Patch
Comment 12 Chris Dumez 2012-07-10 12:58:26 PDT
Comment on attachment 151428 [details]
Patch

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

> Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:529
> +#if ENABLE(INSPECTOR)

This should be at the beginning of the function, not in the middle.

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:153
> +    evas_object_focus_set(inspectorView, EINA_TRUE);

I believe you should use "true" here instead of EINA_TRUE, as per guidelines.

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:167
> +    if (inspectorView) {

You already return earlier if inspectorView is NULL so it seems this check is not needed, right?

> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:770
> +    // Waits until web inspector resources are loaded

I don't understand why this is needed, could you explain?
Comment 13 Seokju Kwon 2012-07-10 21:50:48 PDT
(In reply to comment #12)
> (From update of attachment 151428 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151428&action=review
> 
> > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:529
> > +#if ENABLE(INSPECTOR)
> 
> This should be at the beginning of the function, not in the middle.
> 
> > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:153
> > +    evas_object_focus_set(inspectorView, EINA_TRUE);
> 
> I believe you should use "true" here instead of EINA_TRUE, as per guidelines.
> 
> > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:167
> > +    if (inspectorView) {
> 
> You already return earlier if inspectorView is NULL so it seems this check is not needed, right?
>
I will fix all that you mentioned. 
 
> > Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:770
> > +    // Waits until web inspector resources are loaded
> 
> I don't understand why this is needed, could you explain?

Like what I said on comment #10, Drt have to wait until 'inspector.html' called web inspector is loaded totally. Because some objects in web inspector are called in test files (like LayoutTests/http/tests/inspector/inspector-test.js, LayoutTests/http/tests/inspector/console-test.js ...)
Comment 14 Seokju Kwon 2012-07-10 23:41:45 PDT
Created attachment 151612 [details]
Patch
Comment 15 Chris Dumez 2012-07-11 05:36:02 PDT
Comment on attachment 151612 [details]
Patch

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

> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:771
> +    Evas_Object* inspectorView = ewk_view_web_inspector_view_get(browser->mainView());

If we really need those 3 lines, then LGTM. I was just wondering because the Qt port code seems simpler here.
Comment 16 Seokju Kwon 2012-07-12 01:58:37 PDT
(In reply to comment #15)
> (From update of attachment 151612 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151612&action=review
> 
> > Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:771
> > +    Evas_Object* inspectorView = ewk_view_web_inspector_view_get(browser->mainView());
> 
> If we really need those 3 lines, then LGTM. I was just wondering because the Qt port code seems simpler here.

Some tests are not passing without those 3 line.
(Error messgae : "ReferenceError: Can't find variable: WebInspector")
And I got the hint at https://bugs.webkit.org/show_bug.cgi?id=80235.
Thank you for your review.
Comment 17 Gyuyoung Kim 2012-07-13 04:09:07 PDT
Comment on attachment 151398 [details]
Patch

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

>> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:773
>> +        ecore_main_loop_begin();
> 
> I wonder if this is meaningful? Because ecore_main_loop_begin() is already called at the beginning of layout test.
> 
> http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L257

I'm not clear this yet. Does inspector call ecore_main_loop_begin() / _quit() first before calling it from runTest() of DumpRenderTree.cpp ? Could you explain the reason again ?

In addition, I don't like to call ecore_main_loop_begin() / _quit() from different files. If you call this in LayoutTestControllerEfl.cpp, it is good to call ecore_main_loop_quit() in here as well. I think this is good to debug.
Comment 18 Seokju Kwon 2012-07-13 22:22:32 PDT
(In reply to comment #17)
> (From update of attachment 151398 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=151398&action=review
> 
> >> Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp:773
> >> +        ecore_main_loop_begin();
> > 
> > I wonder if this is meaningful? Because ecore_main_loop_begin() is already called at the beginning of layout test.
> > 
> > http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L257
> 
> I'm not clear this yet. Does inspector call ecore_main_loop_begin() / _quit() first before calling it from runTest() of DumpRenderTree.cpp ? Could you explain the reason again ?
> 
It can't test the inspector without page(inspector.html) has finished loading on the view of inspector.
I think that it can't complete loading before it loads testURL on EFL Port. So it should wait until the page has finished loading with ecore_main_loop_begin() / _quit().

> In addition, I don't like to call ecore_main_loop_begin() / _quit() from different files. If you call this in LayoutTestControllerEfl.cpp, it is good to call ecore_main_loop_quit() in here as well. I think this is good to debug.

I agree with you. I will move it.
Comment 19 Gyuyoung Kim 2012-07-15 19:55:24 PDT
(In reply to comment #18)

> > I'm not clear this yet. Does inspector call ecore_main_loop_begin() / _quit() first before calling it from runTest() of DumpRenderTree.cpp ? Could you explain the reason again ?
> > 

> It can't test the inspector without page(inspector.html) has finished loading on the view of inspector.
> I think that it can't complete loading before it loads testURL on EFL Port. So it should wait until the page has finished loading with ecore_main_loop_begin() / _quit().

Do you mean you need to load inspector.html first before loading testURL by page instance ? If so, I can understand this. Please update patch according to comment  #17.
Comment 20 Seokju Kwon 2012-07-15 22:07:25 PDT
Created attachment 152475 [details]
Patch
Comment 21 Seokju Kwon 2012-07-17 04:40:29 PDT
(In reply to comment #19)
> (In reply to comment #18)
> 
> > > I'm not clear this yet. Does inspector call ecore_main_loop_begin() / _quit() first before calling it from runTest() of DumpRenderTree.cpp ? Could you explain the reason again ?
> > > 
> 
> > It can't test the inspector without page(inspector.html) has finished loading on the view of inspector.
> > I think that it can't complete loading before it loads testURL on EFL Port. So it should wait until the page has finished loading with ecore_main_loop_begin() / _quit().
> 
> Do you mean you need to load inspector.html first before loading testURL by page instance ? If so, I can understand this. Please update patch according to comment  #17.

Yes. That's right. Thank you for your understanding.
Comment 22 Gyuyoung Kim 2012-07-17 18:18:34 PDT
Comment on attachment 152475 [details]
Patch

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

Looks better than before.

> Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:173
> +    // Waits until the page has finished loading

Could you write why we need to wait for finishing page loading here ?
Comment 23 Seokju Kwon 2012-07-17 22:56:47 PDT
Created attachment 152934 [details]
Patch
Comment 24 Gyuyoung Kim 2012-07-18 00:43:01 PDT
Comment on attachment 152934 [details]
Patch

Looks good to me now.
Comment 25 WebKit Review Bot 2012-07-18 05:50:27 PDT
Comment on attachment 152934 [details]
Patch

Clearing flags on attachment: 152934

Committed r122952: <http://trac.webkit.org/changeset/122952>
Comment 26 WebKit Review Bot 2012-07-18 05:50:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 27 Dominik Röttsches (drott) 2012-07-19 02:18:13 PDT
Seokju, good to see this enabled. Thank you.

Can you check the failing test cases on the bot? Maybe we need some new baselines here?
http://build.webkit.org/results/EFL%20Linux%2064-bit%20Debug/r122954%20(2963)/results.html

Please run-webkit-tests locally before unskipping a set of tests.
Comment 28 Seokju Kwon 2012-07-19 03:14:46 PDT
(In reply to comment #27)
> Seokju, good to see this enabled. Thank you.
> 
> Can you check the failing test cases on the bot? Maybe we need some new baselines here?
> http://build.webkit.org/results/EFL%20Linux%2064-bit%20Debug/r122954%20(2963)/results.html
> 
> Please run-webkit-tests locally before unskipping a set of tests.

Add them to Skipped list temporarily because of the bot red.
And then I will move it to TestExpectations with bug id.
(https://bugs.webkit.org/show_bug.cgi?id=91624)