Bug 84406

Summary: [DRT] LTC:: counterValueForElementById() could be moved to Internals
Product: WebKit Reporter: Hajime Morrita <morrita>
Component: Tools / TestsAssignee: Hajime Morrita <morrita>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, cmarcelo, darin, dglazkov, fishd, gustavo, gyuyoung.kim, jamesr, kaustubh.ra, pnormand, rakuco, tkent, tkent+wkapi, vivekgalatage, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 87284, 88851    
Attachments:
Description Flags
Patch
none
Patch
none
Updated patch
none
Updated patch
none
Updated patch
none
cr_linux_build_brk patch
none
Updated patch morrita: review+

Description Hajime Morrita 2012-04-19 16:58:19 PDT
This one looks a test specific API and can be moved to Internals.
Comment 1 Kaustubh Atrawalkar 2012-04-23 14:18:52 PDT
Hi Morrita, I was working on this for sometime. Can I upload the patch for same?
Comment 2 Hajime Morrita 2012-04-23 15:49:37 PDT
(In reply to comment #1)
> Hi Morrita, I was working on this for sometime. Can I upload the patch for same?
Sure!
Comment 3 Kaustubh Atrawalkar 2012-04-23 16:49:26 PDT
Created attachment 138458 [details]
Patch
Comment 4 WebKit Review Bot 2012-04-23 16:53:58 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 5 Philippe Normand 2012-04-23 17:01:11 PDT
Comment on attachment 138458 [details]
Patch

Attachment 138458 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12526077
Comment 6 Build Bot 2012-04-23 17:13:43 PDT
Comment on attachment 138458 [details]
Patch

Attachment 138458 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12528078
Comment 7 Kent Tamura 2012-04-23 17:40:29 PDT
Comment on attachment 138458 [details]
Patch

Chromium WebKit API change looks ok.
Comment 8 Raphael Kubo da Costa (:rakuco) 2012-04-23 18:30:39 PDT
Comment on attachment 138458 [details]
Patch

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

> Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:-88
> -String DumpRenderTreeSupportEfl::counterValueByElementId(const Evas_Object* ewkFrame, const char* elementId)

Please remove the method declaration from the header as well.
Comment 9 WebKit Review Bot 2012-04-24 06:19:03 PDT
Comment on attachment 138458 [details]
Patch

Attachment 138458 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12530221
Comment 10 Kaustubh Atrawalkar 2012-05-07 06:34:05 PDT
Created attachment 140520 [details]
Patch
Comment 11 Build Bot 2012-05-07 07:07:13 PDT
Comment on attachment 140520 [details]
Patch

Attachment 140520 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12648035
Comment 12 WebKit Review Bot 2012-05-07 07:07:47 PDT
Comment on attachment 140520 [details]
Patch

Attachment 140520 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12634990
Comment 13 Kaustubh Atrawalkar 2012-05-07 07:14:42 PDT
Does anyone know where i need to add symbols for win & cr-linux port? I did added in symbols.filter for gtk port and it fixed the gtk build break issue.
Comment 14 Darin Adler 2012-05-07 10:33:36 PDT
Comment on attachment 140520 [details]
Patch

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

Thanks for taking this on!

> Source/WebCore/testing/Internals.cpp:1011
> +String Internals::counterValueForElementById(String elementId)

This is not what we should do. Instead we should make an internals function named counterValue that takes an element.

The only reason the old version worked with an ID was that it was easier to do it that in DumpRenderTree at the time it was done.
Comment 15 Kaustubh Atrawalkar 2012-05-08 02:16:53 PDT
Thanks Darin for the review. So, as per your suggestion, we should be using API counterValueForElement in the layout test cases as well? correct me if wrong.
Comment 16 Darin Adler 2012-05-08 13:14:07 PDT
(In reply to comment #15)
> Thanks Darin for the review. So, as per your suggestion, we should be using API counterValueForElement in the layout test cases as well? correct me if wrong.

Here’s how I suggest it work in JavaScript:

    var counterValue = internals.counterValue(element);

No need for “ForElement” in the function name, nor to involve IDs at all. For existing tests where it’s done by ID we can clean up the test or just do a mechanical change like this:

    var counterValue = internals.counterValue(document.getElementById(elementId));

Does that make sense?
Comment 17 Kaustubh Atrawalkar 2012-06-08 06:11:27 PDT
Created attachment 146548 [details]
Updated patch

After long time finally corrected the patch as per review comments. Uploading for review. Darin, can you review? Thanks.
Comment 18 WebKit Review Bot 2012-06-08 06:33:46 PDT
Comment on attachment 146548 [details]
Updated patch

Attachment 146548 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12919502
Comment 19 Build Bot 2012-06-08 07:43:57 PDT
Comment on attachment 146548 [details]
Updated patch

Attachment 146548 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12910644
Comment 20 Gyuyoung Kim 2012-06-09 04:04:19 PDT
(In reply to comment #19)
> (From update of attachment 146548 [details])
> Attachment 146548 [details] did not pass win-ews (win):
> Output: http://queues.webkit.org/results/12910644

To avoid build break on win port, you have to add a symbol to Source/WebKit2/win/WebKit2.def.
Comment 21 Kaustubh Atrawalkar 2012-06-11 01:00:02 PDT
Created attachment 146804 [details]
Updated patch

Fixed build break for chromium & win
Comment 22 Build Bot 2012-06-11 01:30:28 PDT
Comment on attachment 146804 [details]
Updated patch

Attachment 146804 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12944166
Comment 23 Hajime Morrita 2012-06-11 02:17:33 PDT
The code itself looks good.
I'd r+ once bots become green and if you cannot catch Darin.
Comment 24 WebKit Review Bot 2012-06-11 03:29:14 PDT
Comment on attachment 146804 [details]
Updated patch

Attachment 146804 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12944190
Comment 25 Kaustubh Atrawalkar 2012-06-11 04:21:36 PDT
Created attachment 146828 [details]
Updated patch

Fixed build break for win
Comment 26 Kaustubh Atrawalkar 2012-06-11 04:30:52 PDT
Created attachment 146831 [details]
cr_linux_build_brk patch

Chromium - Webkit glue patch for cr-linux build break
Comment 27 WebKit Review Bot 2012-06-11 05:20:48 PDT
Comment on attachment 146828 [details]
Updated patch

Attachment 146828 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12940306
Comment 28 Kaustubh Atrawalkar 2012-06-11 20:27:30 PDT
Corresponding chromium issue - 
https://chromiumcodereview.appspot.com/10546100/
Comment 29 Kaustubh Atrawalkar 2012-06-11 21:09:50 PDT
Created attachment 147005 [details]
Updated patch

Removed Chromium API for now. Will be removed once cr patch is checked in.
Comment 30 Hajime Morrita 2012-06-11 22:31:06 PDT
Comment on attachment 147005 [details]
Updated patch

r=me. Please wait until all bots become green.
Comment 31 Kaustubh Atrawalkar 2012-06-12 03:53:45 PDT
Committed r120054: <http://trac.webkit.org/changeset/120054>