Closed Bug 838542 Opened 7 years ago Closed 4 years ago

Testing automatically generated xpidl event instance types using instanceof operator with B2G marionette throws exceptions

Categories

(Testing :: Marionette, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vicamo, Unassigned)

Details

See also bug 835148 and bug 813596.

Testing:

  (new ProgressEvent()) instanceof ProgressEvent.constructor

throws:

  invalid 'instanceof' operand ProgressEvent.constructor

Testing:

  (new ProgressEvent()) instanceof ProgressEvent

throws:

  'prototype' property of ProgressEvent is not an object

All these tests pass in web console of the desktop build.  Tests on other event types like Event, UIEvent, ProgressEvent, or non-event types like Audio fail with exactly the same exceptions. But XMLHttpRequest or non-autogened event types is ok.
Is this resolved by using instanceof window.wrappedJSObject.ProgressEvent.constructor?
(In reply to Jonathan Griffin (:jgriffin) from comment #1)
> Is this resolved by using instanceof
> window.wrappedJSObject.ProgressEvent.constructor?

No.  I have:

> let event = new ProgressEvent("hello");
> ok(event instanceof window.wrappedJSObject.ProgressEvent.constructor,
> "ProgressEvent is instanceof " + event.constructor);

And got:

> MARIONETTE TEST RESULT:TEST-UNEXPECTED-FAIL | test_outgoing.js | ProgressEvent
> is instanceof [object XrayWrapper function ProgressEvent() {
>     [native code]
> }] - false was false, expected true
Do you have a test snippet I could play around with?
(In reply to Jonathan Griffin (:jgriffin) from comment #3)
> Do you have a test snippet I could play around with?

This was first found in |dom/mobilemessage/tests/marionette/test_outgoing.js|[1].

[1]: https://mxr.mozilla.org/mozilla-central/source/dom/mobilemessage/tests/marionette/test_outgoing.js#109
closing as b2g related
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.