Closed Bug 487385 Opened 15 years ago Closed 15 years ago

test_module[i] is null trying to run MozMill in Thunderbird

Categories

(Testing Graveyard :: Mozmill, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: standard8, Unassigned)

References

Details

(Whiteboard: [mozmill-1.2])

(Note this is already mentioned in the mozmill developers list, filing for tracking purposes).

Install the extension from trunk, start up Thunderbird, followed by
Mozmill, then select to run a test by open file or in the editor, the
following error appears on the error console:

Error: test_module[i] is null
Source File:
file:///Users/moztest/Library/Thunderbird/Profiles/z3hfsvpf.default/extensions/mozm...@mozilla.com/resource/modules/frame.js
Line: 282

If I comment out lines 281 to 284 inclusive of
extensions/resources/modules/frame.js (version r432) then it works correctly.
Blocks: 458352
Yeah, typeof(null) == "object" which the code doesn't deal with correctly

@@ -256,74 +256,77 @@ Collector.prototype.addHttpResource = fu
   lp.initWithPath(os.abspath(directory, this.current_file));
   this.httpd.registerDirectory('/'+ns+'/', lp);
   return 'http://localhost:'+this.httpd._port+'/'+ns+'/'
 }
 Collector.prototype.initTestModule = function (filename) {
   var test_module = loadFile(filename, this);
   test_module.__tests__ = [];
   for (i in test_module) {
-    if (typeof(test_module[i]) == "function") {
+    if (test_module[i] == null) {
+      // do nothing, eat the flow control
+    }
+    else if (typeof(test_module[i]) == "function") {
This is classed as a blocker for Thunderbird - can't do anything without it being fixed.
Severity: critical → blocker
Priority: -- → P1
Mark, this happens with all tests you run? Even with one from the new file from template? I haven't use Mozmill with Thunderbird so far.
(In reply to comment #3)
> Mark, this happens with all tests you run? Even with one from the new file from
> template? I haven't use Mozmill with Thunderbird so far.

I can reproduce with one line in a template:

var foo = null;

Now I've just found that with:

var foo = 1;

this doesn't work.

The fix in comment 1 does resolve this issue.

So maybe we can work around this (hence not quite blocking), but it really is a pita for those people who hit it as they will have no idea what is going on, and considering the patch suggestion is in comment 1...
Severity: blocker → critical
Whiteboard: [mozmill-1.2]
Fixed in r422.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.