Digital Me

Random contributions to digital noise

Make JSUnit work in Firefox 3.0

Sunday June 22, 2008 @ 03:42 PM (PDT)
I lost hours figuring out this one. I was getting an error: Permission denied to get property Window.xbDEBUG, and eventually getting timeout on running my test page. The first error was happening on different lines of code while I was debugging in Firebug. At the end it was probably some concurrency issue, timeout was happening due to JSUnit test runner not being able to load my test file.
Now, of course I checked if the file exists, and it did exist. I figured out that it cannot load file since it is stuck in function: isPageLoaded in testContainerController.html. Why? At the end I found an answer in an unlikely place: Why doesn't my test suite run under JSCoverage in Firefox 3?
The problem is in the tightened Firefox security regarding local files, and security.fileuri.origin_policy parameter is not the correct one as suggested by the FAQ, it is new configuration parameter that superseded it:
Security.fileuri.strict_origin_policy, it should be set to false so JSUnit will run correctly. The article is mumbling something about suggesting to keep it true for the improved security sake, but I'm too tired of banging my head of the wall to really pay attention.

*** UPDATE ***
I just realised that the version of JSUnit I'm using ( 2.2alpha11 ) is not working correctly when you brows for the test page. I am getting an error:
Reading Test Page file:///someTest.html timed out.
Make sure that the file exists and is a Test Page.
The page does not exist since I browsed to a different file - file:///c:\temp\someTest.html. So there is a bug with loading page.
However it works if I supply the test page through testPage url parameter like this:
file:///.../testRunner.html?testpage=c:/temp/someTest.html
If the tests were not working after fixing the configuration then this might be the next thing to try out.

Comments

Thanks for the post. I was facing the xbDEBUG and load time out issues until I saw this.
Gravatar icon
Thursday July 31, 2008 @ 12:16 AM (PDT)
Thanks!
Gravatar icon
Wednesday August 27, 2008 @ 05:43 AM (PDT)
https://sourceforge.net/tracker/index.php?func=detail&aid=2230999&group_id=28041&atid=391976 should help with the remaining issue.
Gravatar icon
Friday February 20, 2009 @ 04:08 AM (PST)
Thanks!!!
Gravatar icon
Sunday May 24, 2009 @ 05:30 AM (PDT)
New comment

required, won't be displayed

optional

Don't type anything here unless you're an evil robot:


And especially don't type anything here:

Basic XHTML (including links) is allowed, just don't try anything fishy. Your comment will be auto-formatted unless you use your own <p> tags for formatting. You're also welcome to use Textile.

Copyright © 2012 Mihailo Lalevic. All rights reserved.
Powered by Thoth.