> On a related note, I am encountering another issue in trying to write
> a test to cover one of our scenarios and I don't know if it's a FF2
> compatibility issue or if I'm just asking too much of the simulated
> environment provided by crosscheck, or what... but the scenario is
> basically this:
> We have code that creates an iframe and then periodically goes in and
> updates one of the divs in the document in the iframe. I can't post
> the raw code, but the code that does this looks roughly like this:
> updateXXX: function(name)
> {
> var newString = '[Prefix] - ' + name;
> var iframe = this._previouslyStoredReferenceToIFrame;
> if (iframe)
> {
> var doc = iframe.contentWindow || iframe.contentDocument;
> if (doc.document)
> {
> doc = doc.document;
> }
> doc.getElementById('theIdOfTheElementToBeUpdated').innerHTML =
> newString;
> }
> else
> {
> LOG.debug('Could not get iframe.')
> }
> }
> The test I wrote to test this code looks roughly like this:
> testUpdateXXX: function() {
> var scwm = new ObjectUnderTest();
> var expected = '[Prefix] - Example';
> var iframe = document.createElement('iframe');
> iframe.id = 'someSpecificId';
> document.body.appendChild(iframe);
> if (iframe)
> {
> var doc = iframe.contentWindow || iframe.contentDocument;
> assertNotNull(doc);
> if (doc.document)
> {
> doc = doc.document;
> }
> var div = doc.createElement('theIdOfTheElementToBeUpdated');
> assertEquals('Something', div.innerHTML);
> assertNotEquals(expected, div.innerHTML);
> scwm.updateXXX('Example')
> assertEquals(expected, div.innerHTML);
> }
> else
> {
> fail('Could not get iframe')
> }
> }
> And my test class always bombs at the assertNotNull(doc) line --
> presumably because the simulated environment is not doing everything
> the real browser does when I create an iframe element and add it to
> the DOM? Am I wrong in my hypothesis? Is this actually a FF2
> compatibility issue? If not, is there an alternative (ideally
> easier?) way for me to test code that does something like this?
> Thanks,
> -
> John
> On Mar 25, 10:59 pm, "wadswo...@thefrontside.net"
> <jdwadswo...@gmail.com> wrote:
>> John,
>> No, there hasn't been much activity on Crosscheck in a while. I was
>> hoping to put some time into it soon. Specifically, I'd like to
>> change
>> the implementation so that most of the environment code is
>> implemented
>> in JavaScript. It should be possible to get the behavior that we want
>> with the newer JS features in the latest versions of Rhino. This
>> should make it easier for folks to contribute fixes to make the
>> browser environments more accurate to the originals. I suspect
>> grokking the current, parallel-hierarchy Rhino hack might be a bit
>> much to ask of a JavaScript developer.
>> In any case, what Crosscheck really needs, and what FF 2 support
>> requires, are a list of quirks in that environment. If your
>> Crosscheck
>> FF 1.5 tests pass, but they fail in the browser, that's either a bug
>> in the FF 1.5 environment, or a feature for the FF 2 environment.
>> Either way, if you report it as an issue on Trac, it'll be more
>> likely
>> to get fixed. The same goes for every other browser. The
>> infrastructure is there. What we need now to make Crosscheck really
>> cool and really useful is a long list of features and bugs in the
>> DOM/
>> JS implementations of the various browsers.
>> Maybe submitting tickets on Trac isn't the best way to do that.
>> Should
>> there be a public wiki somewhere? A group focused on cataloging the
>> differences in the JS implementations of the browsers? Does that
>> already exist?
>> Maybe this is a good week to start making plans. Any and all
>> resources, ideas, complaints or thoughts would be much appreciated.
>> Thanks,
>> Jason
>> On Mar 25, 10:49 pm, John <lgast...@gmail.com> wrote:
>>> Is Firefox 2 support in the works?
>>> If not, can someone give me some pointers as to where to look to add
>>> it myself?
>>> Surely I'm not the first/only person that wants to be able to easily
>>> test JS in a FF2 environment?
>>> Thanks.