Closed
Bug 811185
Opened 12 years ago
Closed 12 years ago
Implement Emulator class for screen orientation for Marionette
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(firefox18 fixed, firefox19 fixed)
RESOLVED
FIXED
mozilla19
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
jgriffin
:
review+
|
Details | Diff | Splinter Review |
For Marionette WebAPI Python tests which interact with the emulator we should have a class which helps to create tests for this WebAPI. Orientation can be read and written like:
self.marionette.emulator.screen.orientation = self.marionette.emulator.screen.SO_PORTRAIT_SECONDARY
current = self.marionette.emulator.screen.orientation
Also it has to initialize the sensor correctly given that the emulator isn't doing that.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #680922 -
Flags: review?(jgriffin)
Assignee | ||
Comment 2•12 years ago
|
||
Missed last qref before.
Attachment #680922 -
Attachment is obsolete: true
Attachment #680922 -
Flags: review?(jgriffin)
Attachment #680923 -
Flags: review?(jgriffin)
Comment 3•12 years ago
|
||
Comment on attachment 680923 [details] [diff] [review]
Patch v1.1
Review of attachment 680923 [details] [diff] [review]:
-----------------------------------------------------------------
The test file should either have an MPL license header or a public domain header.
::: testing/marionette/client/marionette/emulator_screen.py
@@ +1,5 @@
> +# This Source Code Form is subject to the terms of the Mozilla Public
> +# License, v. 2.0. If a copy of the MPL was not distributed with this
> +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
> +
> +import re
unused import
Attachment #680923 -
Flags: review?(jgriffin) → review+
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Jonathan Griffin (:jgriffin) from comment #3)
> The test file should either have an MPL license header or a public domain
> header.
I have copied the test_emulator.py which didn't contain the license. So I will add it to both test files.
> > +import re
>
> unused import
Missed to remove it after the refactoring.
I will upload an updated version of the patch and get it landed.
Assignee | ||
Comment 5•12 years ago
|
||
Updated patch.
Attachment #680923 -
Attachment is obsolete: true
Attachment #681381 -
Flags: review+
Assignee | ||
Comment 6•12 years ago
|
||
Whiteboard: [automation-needed-in-aurora]
Comment 7•12 years ago
|
||
Backed out for breaking all emulator tests:
https://hg.mozilla.org/integration/mozilla-inbound/rev/83d175cb799d
Whiteboard: [automation-needed-in-aurora]
Assignee | ||
Comment 8•12 years ago
|
||
Ed, are you sure? Where do I see that? I can't recognize anything of that:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=992f2748681f
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
{
00:21:40 INFO - Traceback (most recent call last):
00:21:40 INFO - File "runreftestb2g.py", line 563, in <module>
00:21:40 INFO - sys.exit(main())
00:21:40 INFO - File "runreftestb2g.py", line 483, in main
00:21:40 INFO - marionette = Marionette(**kwargs)
00:21:40 INFO - File "/home/cltbld/talos-slave/test/build/venv/lib/python2.6/site-packages/marionette/marionette.py", line 132, in __init__
00:21:40 INFO - self.emulator.start()
00:21:40 INFO - File "/home/cltbld/talos-slave/test/build/venv/lib/python2.6/site-packages/marionette/emulator.py", line 364, in start
00:21:40 INFO - self.screen.initialize()
00:21:40 INFO - File "/home/cltbld/talos-slave/test/build/venv/lib/python2.6/site-packages/marionette/emulator_screen.py", line 17, in initialize
00:21:40 INFO - self.orientation = self.SO_PORTRAIT_PRIMARY
00:21:40 INFO - File "/home/cltbld/talos-slave/test/build/venv/lib/python2.6/site-packages/marionette/emulator_screen.py", line 65, in set_orientation
00:21:40 INFO - if orientation == SO_PORTRAIT_PRIMARY:
00:21:40 INFO - NameError: global name 'SO_PORTRAIT_PRIMARY' is not defined
00:21:41 ERROR - Return code: 1
}
Assignee | ||
Comment 11•12 years ago
|
||
Not sure what happened here and why 'self' is missing for each constant in the set_orientation() method.
Just for safety I have triggered a try server run:
https://tbpl.mozilla.org/?tree=Try&rev=66d942ceec26
Attachment #681381 -
Attachment is obsolete: true
Attachment #681418 -
Flags: review?(jgriffin)
Comment 12•12 years ago
|
||
Comment on attachment 681418 [details] [diff] [review]
Patch v2.1
This patch is missing the emulator_screen.py file.
Attachment #681418 -
Flags: review?(jgriffin) → review-
Assignee | ||
Comment 13•12 years ago
|
||
Hopefully all fixed now. As discussed on IRC I moved the screen orientation tests into the existing emulator test file.
Pushed to get tested by try server:
https://tbpl.mozilla.org/?tree=Try&rev=c52a06caa143
Attachment #681418 -
Attachment is obsolete: true
Attachment #681563 -
Flags: review?(jgriffin)
Comment 14•12 years ago
|
||
Comment on attachment 681563 [details] [diff] [review]
Patch v3
Review of attachment 681563 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with the problem below fixed.
::: testing/marionette/client/marionette/tests/unit/test_emulator.py
@@ +46,5 @@
> + self.assertEqual(self.screen.orientation, self.screen.SO_PORTRAIT_PRIMARY,
> + 'Orientation has been correctly initialized.')
> +
> + self.sensor.orientation = self.sensor.SO_PORTRAIT_SECONDARY
> + self.assertEqual(self.sensor.orientation, self.sensor.SO_PORTRAIT_SECONDARY,
You should be using self.screen here rather than self.sensor, I believe.
Attachment #681563 -
Flags: review?(jgriffin) → review+
Assignee | ||
Comment 15•12 years ago
|
||
Replaced sensor with screen, and as discussed on IRC also added defaults to the unit-test manifest file, so that it can be run on its own.
Attachment #681563 -
Attachment is obsolete: true
Attachment #681648 -
Flags: review?(jgriffin)
Comment 16•12 years ago
|
||
Comment on attachment 681648 [details] [diff] [review]
Patch v4
Review of attachment 681648 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
Attachment #681648 -
Flags: review?(jgriffin) → review+
Assignee | ||
Comment 17•12 years ago
|
||
Relanded updated patch:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9992b91433a3
Whiteboard: [automation-needed-in-aurora]
Comment 18•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 19•12 years ago
|
||
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Whiteboard: [automation-needed-in-aurora]
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•