You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2006/06/01 15:29:12 UTC

Re: [testing] Re: AWT, Java2D and SWING contribution

On 1 June 2006 at 14:19, Chris Gray <ch...@kiffer.be> wrote:
> I believe that Classpath uses the VisualTestEngine we developed at Acunia. 
> Requires manual operation, but it has facilities for explanatory texts, pass/
> fail indications, etc.. It will even run applets if you ask it nicely. You 
> can find it in the SVN repository at www.wonka-vm.org (which is down at the 
> moment I write this, I'll ping Luminis to ask why).
> 
> I don't think it's that difficult to hack X to write to normal RAM
> instead of a framebuffer, but the real problem is that there's no hard
> spec of which pixels should change to what colour when you create e.g.
> a button. You could instrument an X server in other ways though, for
> example to see that [J]Frame actually opens a new window and sets its
> title.

I don't think you even need to hack X.

Simplest way to do a perfect comparison that springs to mind is:

1) Start an X virtual framebuffer on display :1, with:

  Xvfb :1 &

2) run RI test, using DISPLAY=:1, periodically taking snapshots[0] with:

  xwd -display :1 -root -out NN.xwd

3) repeat the tests with harmony

4) compare the resulting *.xwd files

The hard part would be to elaborate on step 4 to support minor
variations in the comparison process.

If you were comparing manual/visually, ImageMagick does quite a good job
with:

  compare ri.xwd hy.xwd :x

If I recall correctly difference tend to be shown in bright red.

Regards,
 Mark

[0] I mean instrument the tests with calls to do this.



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [testing] Re: AWT, Java2D and SWING contribution

Posted by David Tanzer <st...@guglhupf.net>.
I just tried out the process you described using JEdit (2x on RI).
I made a dump with XWD, then moved the split of the horizontal
split pane 1 pixel to the right and did the dump again.

The result when you call "compare" is a picture with lots of bright
red (differences), and it's hard to see what's the cause of the problem.

But this is still better than comparing the two screen shots without any
tool support, so IMHO what you described can be a great help when
manually comparing the results of RI and HY.

Regards, David.

On 01.06.2006, at 15:29, Mark Hindess wrote:

>
> On 1 June 2006 at 14:19, Chris Gray <ch...@kiffer.be> wrote:
>> I believe that Classpath uses the VisualTestEngine we developed at  
>> Acunia.
>> Requires manual operation, but it has facilities for explanatory  
>> texts, pass/
>> fail indications, etc.. It will even run applets if you ask it  
>> nicely. You
>> can find it in the SVN repository at www.wonka-vm.org (which is  
>> down at the
>> moment I write this, I'll ping Luminis to ask why).
>>
>> I don't think it's that difficult to hack X to write to normal RAM
>> instead of a framebuffer, but the real problem is that there's no  
>> hard
>> spec of which pixels should change to what colour when you create  
>> e.g.
>> a button. You could instrument an X server in other ways though, for
>> example to see that [J]Frame actually opens a new window and sets its
>> title.
>
> I don't think you even need to hack X.
>
> Simplest way to do a perfect comparison that springs to mind is:
>
> 1) Start an X virtual framebuffer on display :1, with:
>
>   Xvfb :1 &
>
> 2) run RI test, using DISPLAY=:1, periodically taking snapshots[0]  
> with:
>
>   xwd -display :1 -root -out NN.xwd
>
> 3) repeat the tests with harmony
>
> 4) compare the resulting *.xwd files
>
> The hard part would be to elaborate on step 4 to support minor
> variations in the comparison process.
>
> If you were comparing manual/visually, ImageMagick does quite a  
> good job
> with:
>
>   compare ri.xwd hy.xwd :x
>
> If I recall correctly difference tend to be shown in bright red.
>
> Regards,
>  Mark
>
> [0] I mean instrument the tests with calls to do this.
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>


Re: [testing] Re: AWT, Java2D and SWING contribution

Posted by Anton Avtamonov <an...@gmail.com>.
On 6/1/06, Mark Hindess <ma...@googlemail.com> wrote:
>
> On 1 June 2006 at 17:36, "Alexey Petrenko" <al...@gmail.com>
> wrote:
> >
> > Which thing will this tool compare? Created windows or displays pixel
> > by pixel?
>
> The syntax I listed for xwd dumps the whole virtual display.  You can
> also instruct it to dump single windows.  But either way, it's a pixel
> by pixel dump which is why I said that doing something meaningful in
> step 4 - the comparison - would be the hard part.

Very hard part. Colors used in Harmony are not equivalent to RI.
Therefore I expect that "as is" comparison will show that everything
is different :-). The entire component Look is not 100% copied, i.e.
position of the focus frame, look of the borders, etc. differ.
Besides, colors are theme-dependent and may differ for MetalTheme and
OceanTheme, for instance.
That's why I suppose that using of some heuristical rules will be
required. Like "button is in pressed state if its color became
darker".

Wishes,
-- 
Anton Avtamonov,
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [testing] Re: AWT, Java2D and SWING contribution

Posted by Alexey Petrenko <al...@gmail.com>.
Which thing will this tool compare? Created windows or displays pixel by pixel?

2006/6/1, Mark Hindess <ma...@googlemail.com>:
>
> On 1 June 2006 at 14:19, Chris Gray <ch...@kiffer.be> wrote:
> > I believe that Classpath uses the VisualTestEngine we developed at Acunia.
> > Requires manual operation, but it has facilities for explanatory texts, pass/
> > fail indications, etc.. It will even run applets if you ask it nicely. You
> > can find it in the SVN repository at www.wonka-vm.org (which is down at the
> > moment I write this, I'll ping Luminis to ask why).
> >
> > I don't think it's that difficult to hack X to write to normal RAM
> > instead of a framebuffer, but the real problem is that there's no hard
> > spec of which pixels should change to what colour when you create e.g.
> > a button. You could instrument an X server in other ways though, for
> > example to see that [J]Frame actually opens a new window and sets its
> > title.
>
> I don't think you even need to hack X.
>
> Simplest way to do a perfect comparison that springs to mind is:
>
> 1) Start an X virtual framebuffer on display :1, with:
>
>  Xvfb :1 &
>
> 2) run RI test, using DISPLAY=:1, periodically taking snapshots[0] with:
>
>  xwd -display :1 -root -out NN.xwd
>
> 3) repeat the tests with harmony
>
> 4) compare the resulting *.xwd files
>
> The hard part would be to elaborate on step 4 to support minor
> variations in the comparison process.
>
> If you were comparing manual/visually, ImageMagick does quite a good job
> with:
>
>  compare ri.xwd hy.xwd :x
>
> If I recall correctly difference tend to be shown in bright red.
>
> Regards,
>  Mark
>
> [0] I mean instrument the tests with calls to do this.
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Alexey A. Petrenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org