Closed Bug 451678 Opened 11 years ago Closed 11 years ago

TM: mochi chrome tests fail under TM

Categories

(Core :: JavaScript Engine, defect, major)

x86
All
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: sayrer, Assigned: brendan)

References

Details

(Keywords: testcase)

Attachments

(4 files)

Looks like the harness overlay isn't working correctly.

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "srvScope.makeTags is not a function" {file: "chrome://mochikit/content/harness-overlay.xul" line: 46}]' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "<unknown>"  data: yes]
************************************************************
Blocks: landtm
Reproduce:

python runtests.py --chrome
Severity: normal → major
OS: Mac OS X → All
Version: unspecified → Trunk
As a note, this is probably happening on all platforms - Linux and Mac buildbots show it properly in tinderbox waterfall summaries but we're just not as good with reporting it on Windows. I just logged into the SeaMonkey Windows unit test box and it sits there with having the mochichrome test framework open, no tests executed, and the error console shows the error from comment #0.
Just to test, I added the for in around:
var srvScope = {};
scriptLoader.loadSubScript("chrome://mochikit/content/server.js",
                                 srvScope);
      
for (var name in srvScope)
  dump(name + " " + srvScope[name] + "\n");

Output:
SERVER_PORT 8888
server undefined
tags undefined
makeTagFunc ... (the right thing)
makeTags A,ABBR,ACRONYM,ADDRESS... (contents of what should be tags)
...
Attached file simplified test.html
Simplified testcase, requires the JS file I'll attach next. Also, it needs an absolute file:// URI in there to feed the subscript loader, so modify as appropriate. :-/
Much easier to use, just apply the patch and "make libs check" in js/src/xpconnect/test.
here's ted's test as a single file. this creates a file in /tmp to load the subscript from.
IIRC, we just had problems with files created in /tmp - if you create a file, could you do it somewhere under the objdir, please?
I don't think his attachment is a replacement for mine, just an easier way to run the test for debugging purposes. My patch should be just fine for checkin as a regression test.
Works in tracemonkey revision 18304, and fails in revision 18311.

This points to upvars breaking this.
Assignee: general → brendan
Fixed on tracemonkey:

http://hg.mozilla.org/tracemonkey/index.cgi/rev/cb7a52881bd0

And on mozilla-central, r=shaver:

http://hg.mozilla.org/mozilla-central/index.cgi/rev/a81c9fa9a583

/be
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attachment #335082 - Flags: review?(brendan)
Comment on attachment 335082 [details] [diff] [review]
as an xpcshell unit test

Looks good, thanks.

/be
Attachment #335082 - Flags: review?(brendan) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla1.9.1
You need to log in before you can comment on or make changes to this bug.