It would be possible to do something like this, but we would have to find a
sneaky way to get this implemented such that it goes away entirely when
*not* testing. All of the style methods currently get inlined out of
existence by design, and we definitely couldn't afford to lose that for
production apps.
Side note: Most of the methods in the old DOM interface just pass through to
their equivalent Element methods, so it would still only be necessary to
change them in one place.

On Wed, Sep 24, 2008 at 2:59 PM, Paul Hammant <[EMAIL PROTECTED]> wrote:

> The idea would be for me to be able to assert that a change has occured.
>  Imagine the simplest implementation of this would be a string buffer.
>
>  assertFalse(recorder.toString().contains("\nStyle changed");
>  myWidget.doSomething();
>  assertTrue(recorder.toString().contains("\nStyle changed");
>  assertJournalledStylesExistInCSSResource(recorder.toString(),
> cssResource);
>
> If you can journal changes for more than styles, all the better.  If you
> can bake-in (partial) xpath then that'd be great too.
>
> - Paul
>
>
> On Sep 24, 2008, at 11:36 AM, Ray Ryan wrote:
>
>
>> [+ Google-Web-Toolkit-Contributors, and Scott and Joel in particular]
>>
>> So the idea here is to add a hook that allows an observer to keep a
>> log of CSS operations? Why just CSS and not DOM operations in general?
>>
>> The DOM class itself is probably the wrong place, as I believe it's
>> all but deprecated by the com.google.gwt.dom.client package. It would
>> also be good if a facility like this were in a spot that is accessible
>> to testing code only.
>>
>> Perhaps Scott or Joel could offer guidance on what hooks to establish
>> where?
>>
>> rjrjr
>>
>> On Wed, Sep 24, 2008 at 10:03 AM, Paul Hammant <[EMAIL PROTECTED]>
>> wrote:
>>
>>> It would be nice in a test, to do
>>>
>>> DOM.journalCSSChanges(myCSSRecorder);
>>>
>>> // my GWTTestCase logic
>>>
>>> CSSChanges ccsc = myCSSRecorder.getCSSChanges();
>>>
>>> // validate against a CSS file resource
>>>
>>> // assert the right transitions happened during the test.
>>>
>>> ---
>>>
>>> Why?  Well because we're increasingly testing functionality in GWT tests,
>>> and not validating any modifications of the DOM in any way.  It would be
>>> too
>>> brittle to go deep here, but would be nice to assert things line "one and
>>> only one style changes happened". "all styles used have matching entries
>>> in
>>> a given resource"
>>>
>>> Thoughts?
>>>
>>> - Paul
>>>
>>>
>>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to