These tests can be run in a browser by loading

features/src/test/javascript/features/opensocial-templates/index.html

The problem is that on very many occasions, htmlunit is more strict
than real-world browsers, but very difficult to debug. In the past, my
attempts to fix the tests have been limited to trying various changes
I guessed might help and then running the build to see if they do.

One thing I can think of in this instance is that htmlunit may
translate the "className" attribute into a property, so checking for
dst['className'] instead of dst.getAttribute('className') may help.

On Thu, Apr 30, 2009 at 3:44 PM, Paul Lindner <[email protected]> wrote:
> Hi,
>
> Looks like upgrading htmlunit to 2.5 broke one of the unit tests for
> opensocial templates.
>
> I tracked this down to the copy attribute test here:
>
> function testCopyAttributes() {
>  var src = document.createElement('div');
>  var dst = document.createElement('div');
>  src.setAttribute('attr', 'test');
>  src.setAttribute('class', 'foo');
>  os.copyAttributes_(src, dst);
>  assertEquals('test', dst.getAttribute('attr'));
>  assertEquals('foo', dst.getAttribute('className'));
>  assertEquals('foo', dst.className, "testCopyAttributes");
> }
>
> The failing test is the second one.  In this case
> dst.getAttribute('className') is returning null instead of 'foo'
>
> Any ideas here?  Also if you know of a way to run this test in a debugger it
> would be most useful..
>
>
>
>

Reply via email to