Closed Bug 1158219 Opened 6 years ago Closed 6 years ago

Python client sends field "id" with value null to switchToFrame when switching to default browser context

Categories

(Testing :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ato, Assigned: ato)

Details

(Keywords: pi-marionette-client)

Attachments

(1 file, 1 obsolete file)

The Python client sends a packet with the field "id" set to null when switching to the default browser context.  To make this switch, "id" should not be defined at all.

The reason this currently works is because we're using the == operator when comparing cmd.parameter.id.
Assignee: nobody → ato
Status: NEW → ASSIGNED
Discovered this when working on bug 1157258.
Attached file MozReview Request: bz://1158219/ato (obsolete) —
/r/7623 - Bug 1158219: Don't set `id' field if undefined when switching frame

Pull down this commit:

hg pull -r cd490db0c8c18f68d4a91803daa833bc2f08631e https://reviewboard-hg.mozilla.org/gecko/
Attachment #8597351 - Flags: review?(jgriffin)
Attachment #8597351 - Flags: review?(jgriffin) → review+
https://hg.mozilla.org/mozilla-central/rev/7602f3f4944f
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Attachment #8597351 - Attachment is obsolete: true
Attachment #8620155 - Flags: review+
I guess this comment and part of the check can be removed then too:
http://mxr.mozilla.org/mozilla-central/source/testing/marionette/driver.js#1645
1645     // Bug 1158219: Python client sends id when it shouldn't,
1646     // but we know that if it's null it wants us to switch to default
1647     if (cmd.parameters.id == null && !cmd.parameters.hasOwnProperty("element")) {
(In reply to Martijn Wargers [:mwargers] (QA) from comment #9)
> I guess this comment and part of the check can be removed then too:
> http://mxr.mozilla.org/mozilla-central/source/testing/marionette/driver.
> js#1645
> 1645     // Bug 1158219: Python client sends id when it shouldn't,
> 1646     // but we know that if it's null it wants us to switch to default
> 1647     if (cmd.parameters.id == null &&
> !cmd.parameters.hasOwnProperty("element")) {

Filed bug 1202381 about this.
You need to log in before you can comment on or make changes to this bug.