Closed Bug 1361987 Opened 7 years ago Closed 7 years ago

Make sure generator functions return the correct type

Categories

(Remote Protocol :: Marionette, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: automatedtester, Assigned: automatedtester)

References

Details

Attachments

(2 files)

We have a number of places where we use `return` in generator functions which is not correct syntax.
Assignee: nobody → dburns
Comment on attachment 8864502 [details]
Bug 1361987 - Move maximizeWindow call to not use a return in a generator.

https://reviewboard.mozilla.org/r/136180/#review139624

::: testing/marionette/driver.js:2909
(Diff revision 1)
> -  return {
> +  resp.body.value = {
>      x: win.screenX,
>      y: win.screenY,
>      width: win.outerWidth,
>      height: win.outerHeight,
>    };

This change is backwards incompatible because you change the way the returned object is wrapped.  This will likely cause issues with Firefox UI tests and geckodriver.

It’s also not really necessary to wrap JSON Objects in a value field on the Marionette level since the payloads returned to the clients are always an array (see http://searchfox.org/mozilla-central/rev/6580dd9a4eb0224773897388dba2ddf5ed7f4216/testing/marionette/README#27).

I will give this an r+ with the expectation that this is changed from resp.body.value = {…} to resp.body = {…].
Attachment #8864502 - Flags: review?(ato) → review+
Comment on attachment 8864503 [details]
Bug 1361987 - Move setWindowRect to not return from a generator.

https://reviewboard.mozilla.org/r/136182/#review139626

::: testing/marionette/driver.js:1423
(Diff revision 1)
> -  return {
> +  resp.body.value = {
>      "x": win.screenX,
>      "y": win.screenY,
>      "width": win.outerWidth,
>      "height": win.outerHeight,
>    };

Same situation as in previous patch.  s/resp.body.value/resp.body/
Attachment #8864503 - Flags: review?(ato) → review+
Pushed by dburns@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d330e31dcb23
Move maximizeWindow call to not use a return in a generator. r=ato
https://hg.mozilla.org/integration/autoland/rev/ed74f44b40c1
Move setWindowRect to not return from a generator. r=ato
https://hg.mozilla.org/mozilla-central/rev/d330e31dcb23
https://hg.mozilla.org/mozilla-central/rev/ed74f44b40c1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: