Closed Bug 807548 Opened 12 years ago Closed 12 years ago

error: addon-sdk: TEST FAILED: test-content-proxy.testCollections2 (failure)

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: KWierso, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

error: addon-sdk: TEST FAILED: test-content-proxy.testCollections2 (failure)
error: addon-sdk: fail: body.childNodes is iterable
info: addon-sdk: Traceback (most recent call last):
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/timers.js", line 31, in notify
    callback.apply(null, args);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/content/worker.js", line 109, in null
    self._emit.apply(self, JSON.parse(args));
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 123, in _emit
    return this._emitOnObject.apply(this, args);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 153, in _emitOnObject
    listener.apply(targetObj, params);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/content/worker.js", line 228, in portEmit
    self._addonWorker._onContentScriptEvent.apply(self._addonWorker, arguments);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/content/worker.js", line 560, in _onContentScriptEvent
    this._port._emit.apply(this._port, arguments);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 123, in _emit
    return this._emitOnObject.apply(this, args);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 153, in _emitOnObject
    listener.apply(targetObj, params);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/tests/test-content-proxy.js", line 84, in null
    test.assert(data.assertion, data.msg);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 137, in assert
    this.fail(message);
  File "resource://39cb27c8-733d-4235-8881-144f986da8a6-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 75, in fail
    this.console.trace();


This test is failing on Mozilla Central for all of the runs that have completed so far in the Jetpack tree.
Okay, I added some logging to testCollections2, and the "count" variable has different values on various branches.

On release, count == 3
On beta, aurora, and nightlies before a few days ago, count == 6
On recent nightlies, count == 7

The test only knows about 3 and 6.


On recent nightlies, the for() loop that goes through body.childNodes contains:
0, 1, 2, constructor, item, iterator, length

On beta, aurora, and older nightlies, the loop contains:
0, 1, 2, length, iterator, item


So constructor is now included in body.childNodes, while it wasn't previously.


Not sure what this means for us, but there it is...
Hmm, that doesn't seem right. Constructor shouldn't be enumerable :-/.
Status: NEW → ASSIGNED
QA Contact: peterv
Is this just for xrays?  I certainly can't reproduce this with a basic testcase in a web page....

Can someone link me to the testcase source, please?  It doesn't seem to be in m-c.
(In reply to Boris Zbarsky (:bz) from comment #5)
> Is this just for xrays?  I certainly can't reproduce this with a basic
> testcase in a web page....
> 
> Can someone link me to the testcase source, please?  It doesn't seem to be
> in m-c.

Here's the test: https://github.com/mozilla/addon-sdk/blob/master/test/test-content-proxy.js#L567-597

createProxyTest() is defined here: https://github.com/mozilla/addon-sdk/blob/master/test/test-content-proxy.js#L13-57
Yeah, that seems to be going through Xrays...  Let me see if I can reproduce.
So XrayEnumerateNativeProperties does this:

  if (type == eInterfacePrototype &&
      nativePropertyHooks->mConstructorID != constructors::id::_ID_Count &&
      !AddStringToIDVector(cx, props, "constructor")) {
    return false;
  }

The only caller is DOMXrayTraits::enumerateNames.

The problem is that we don't pass in the enumeration flags, so can't tell what we should be doing here.  Fix coming up.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Component: General → DOM
Product: Add-on SDK → Core
Attachment #677977 - Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/af47a345a5be
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla19
https://hg.mozilla.org/mozilla-central/rev/af47a345a5be
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: