Closed Bug 938021 Opened 11 years ago Closed 7 years ago

[marionette-orientation] Implement plugin so we can use setOrientation

Categories

(Testing Graveyard :: JSMarionette, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: jlal, Unassigned)

Details

Attachments

(1 file)

1. use this https://github.com/mozilla-b2g/marionette-content-script so we can hack into all pages. 2. Expose (via plugin) client.setOrientation('landscape') (see .screen) which will update .screen properties and screen.mozOrientation. 3. fire resize event See if webdriver has some specific rules to how this is implemented so hack can go away once we land proper platform support. The goal here is to provide something quickly to unblock some system app testing for alive.
We have bug 804515; how do these two relate?
Hi Stephen, It looks like that bug 804515 blocks bug 938021. We also would like the marionette-orientation module could rotate the screen of b2g, not just change the value of .screen properties and screen.mozOrientation. How do you guys think?
Depends on: 804515
No longer depends on: 804515
@Stephen This is a hack... jgriffin and I spoke today and we can get a real fix soonish (> 1 week) this is to address alive's needs now. @Evan I will see what I can do.
Assignee: nobody → jlal
Cool! Cannot wait to see.
There is a bunch of code to handle this in the simulator: https://github.com/mozilla/r2d2b2g/blob/65b9a605c8f98f18c9114e933a5e10dce07085a4/prosthesis/modules/GlobalSimulatorScreen.jsm I personally don't have time to get all these details working for this hack (the initial version will only work in one app at a time and won't do much magic) I am not sure what the best long term solution is... Ideally 804515 is fixed in some sane way and this plugin can go away.
Attachment #832106 - Flags: review?(evanxd)
Attachment #832106 - Flags: review?(alive)
Comment on attachment 832106 [details] [review] https://github.com/mozilla-b2g/marionette-orientation/pull/1 Need to change allowed orientation, I have no comments on other stuff.
Attachment #832106 - Flags: review?(alive)
Hi James, I have comments for screen state things. Thanks.
@Alive sorry can you clarify allowed orientation? What hacks do you need? There is some much better hacks here: https://github.com/mozilla/r2d2b2g/blob/master/prosthesis/modules/GlobalSimulatorScreen.jsm but I would like to fix the problem in marionette. @Evan I don't have too much time to implement every feature the current version _will_ change the values of innerWidth and innerHeight so it should be suitable for cases where we use those values to detect orientation. My hope is we can iterate on this until we have something more concrete in the platform (marionette) which works across all devices well.
Flags: needinfo?(evanxd)
Flags: needinfo?(alive)
Comment on attachment 832106 [details] [review] https://github.com/mozilla-b2g/marionette-orientation/pull/1 Hi James, Sorry, got it. The patch is good for me.
Attachment #832106 - Flags: review?(evanxd) → review+
Flags: needinfo?(evanxd)
We could follow up the complete orientation mode things in Bug 940871.
(In reply to James Lal [:lightsofapollo] from comment #9) > @Alive sorry can you clarify allowed orientation? What hacks do you need? > > There is some much better hacks here: > https://github.com/mozilla/r2d2b2g/blob/master/prosthesis/modules/ > GlobalSimulatorScreen.jsm but I would like to fix the problem in marionette. > > @Evan > > I don't have too much time to implement every feature the current version > _will_ change the values of innerWidth and innerHeight so it should be > suitable for cases where we use those values to detect orientation. My hope > is we can iterate on this until we have something more concrete in the > platform (marionette) which works across all devices well. For screen.mozOrientation: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary. For screen.mozLockOrientation: default, portrait-primary, portrait-secondary, landscape-primary, landscape-secondary. After doing screen.mozLockOrientation('default'), screen.mozOrientation should tell me the correct default orientation but it's only portrait-primary or landscape-primary.
Flags: needinfo?(alive)
Ran out of time to do this better- If we need entire mocking we should integrate https://github.com/mozilla/r2d2b2g/blob/master/prosthesis/modules/GlobalSimulatorScreen.jsm into the testing environment (or better b2g as a whole)
Assignee: jlal → nobody
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: