Closed Bug 813777 Opened 12 years ago Closed 9 years ago

[WebAPI] ScreenOrientation: Develop tests to verify screen orientation modes

Categories

(Core :: DOM: Device Interfaces, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: rwood, Assigned: rwood)

References

Details

Attachments

(1 file, 3 obsolete files)

Develop marionette tests (to run on the device emulator) to verify orientation modes via the Screen Orientation API.

Include the following test cases from QA's test plan (https://wiki.mozilla.org/B2G/QA/WebAPI_Test_Plan/Screen_Orientation):

- Rotate virtual device around Z axis. Verify no orientation change or event 

- Rotate virtual device around X axis. Verify mozOrientation changes as expected and onmozorientationchange fires 

- Rotate virtual device around Y axis. Verify mozOrientation changes as expected and onmozorientationchange fires
Blocks: 805005
Assignee: nobody → rwood
Hi Whimboo,

Can you please have a look at the attached test? When I run it, I am getting inconsistent results - it often fails but seems random. As far as I know I am writing the test correctly (this is the first Python Marionette test I have written). I don't really want to log an issue against the API since the failure seems inconsistent. I would prefer to write the entire test in JS but want to use your emulator orientation class which is currently only available in Python (correct?).

Thanks!
Attachment #690522 - Flags: feedback?(hskupin)
Attachment #690522 - Flags: feedback?(jgriffin)
Comment on attachment 690522 [details]
WIP: Python Marionette test for Screen Orientation Modes

Hi Rob, sorry for the delay. I hope in the future it will be faster. Just a note ahead, I love patches instead of simple attachments. That way I would be able to use splinter review. :)

>class TestScreenOrientation(MarionetteTestCase):
>    def setUp(self):
[..]
>        self.marionette.emulator.screen.initialize()

Is that code executed for every test in this class? Then it's fine. Otherwise the sensor gets initialized already by Marionette.

>        screen = self.marionette.emulator.screen

You can exchange those lines for simplicity. :)

>        # Ensure the orientation didn't lock (home screen will lock it)
>        self.marionette.log("Unlocking screen orientation.")
>        self.marionette.execute_script("window.screen.mozUnlockOrientation();")

So we can run against the lockscreen by just disabling orientation locking?

>    def test_defaultOrientation(self):
>        # Verify default emulator orientation
>        screen = self.marionette.emulator.screen

I think this line can be put as a top-level class attribute for the test class, or?

>    def test_portraitSecondary(self):
>        # Verify changing orientation to SO_PORTRAIT_SECONDARY
>        self.doTest(self.marionette.emulator.screen.SO_PORTRAIT_SECONDARY)
[..]
>        # Reset orientation to where it was as the start
>        self.marionette.log("Resetting emulator orientation.")
>        self.marionette.emulator.screen.initialize()
>        # Last test finished, verify event count
>        self.doVerifyEventCount()

Is there no tearDown for each test method where we could put this into?

>    def doTest(self, orientationToTest):

Python usually doesn't use camel-case notation. Instead name the parameter orientation_to_test.

>        self.marionette.log("Changing emulator orientation to '" + orientationToTest + "'.")

For the final patch I assume you will remove all those log calls?

>        self.assertEqual(screen.orientation, orientationToTest, "correct emulator orientation")
>        # Sleep to let the orientation change actually happen
>        time.sleep(1)

I don't think we have to wait here. Setting the new orientation is a blocking call in Python and gaia should have it already picked up, or not?

>        # Verify window.screen.orientation has same value
>        result = self.marionette.execute_script("""
>        let myScreen = window.screen;
>        return myScreen.mozOrientation;
>        """)

The test for the default orientation has similar code. I think it would make sense to have a helper method here.

>    def doVerifyEventCount(self):
>        # Verify recived 4 'mozorientationchange' events
>        eventCount = self.marionette.execute_script("return window.wrappedJSObject.eventCounter;")
>        self.marionette.log("Verified " + str(eventCount) + " 'mozorientationchange' events were received.")
>        self.assertEqual(eventCount, 4, "number of events")

Why does only test_portraitSecondary make use of it? Each test should check that the event has really been fired. Otherwise we will hide important information and the test will not tell us which orientation change didn't fire the event.


So lockOrientation/unlockOrientation will be covered in another test?

Otherwise looks like the right direction to go.
Attachment #690522 - Flags: feedback?(hskupin) → feedback+
Comment on attachment 690522 [details]
WIP: Python Marionette test for Screen Orientation Modes

I didn't see any problem w.r.t execute_script usage; using event listeners along with window.wrappedJSObject.foo should work fine.  If it doesn't, we may need to add some additional debugging statements so we can see the state of those variables at different points.
Attachment #690522 - Flags: feedback?(jgriffin) → feedback+
Thank you both for the feedback! I will make the changes you suggested Henrik, and will try it out again on a new build and see if it still fails.
Attached patch Screen orientation modes test (obsolete) — Splinter Review
New patch attached. The test is passing consistently when run on my local VM. The sleep time is needed or the test fails. Leaving the log lines in as they really help to debug tests when they fail on TBPL.
Attachment #690522 - Attachment is obsolete: true
Attachment #695511 - Flags: review?(hskupin)
Rob, before I want to review the patch can you please post replies to my previous review comments? I want to know why some parts have been changed and others not. Thanks.
Status: NEW → ASSIGNED
(In reply to Henrik Skupin (:whimboo) from comment #2)

Thanks for your commends Henrik, my comments regarding the new patch are inline.

> Comment on attachment 690522 [details]
> WIP: Python Marionette test for Screen Orientation Modes
> 
> Hi Rob, sorry for the delay. I hope in the future it will be faster. Just a
> note ahead, I love patches instead of simple attachments. That way I would
> be able to use splinter review. :)
> 
> >class TestScreenOrientation(MarionetteTestCase):
> >    def setUp(self):
> [..]
> >        self.marionette.emulator.screen.initialize()
> 
> Is that code executed for every test in this class? Then it's fine.
> Otherwise the sensor gets initialized already by Marionette.

Yes that code is executed for every test method in the class.

> 
> >        screen = self.marionette.emulator.screen
> 
> You can exchange those lines for simplicity. :)

Done.

> 
> >        # Ensure the orientation didn't lock (home screen will lock it)
> >        self.marionette.log("Unlocking screen orientation.")
> >        self.marionette.execute_script("window.screen.mozUnlockOrientation();")
> 
> So we can run against the lockscreen by just disabling orientation locking?

Yes. I noticed the test was failing but realized it was because the home screen was locked, unlocking at the start fixes that.

> 
> >    def test_defaultOrientation(self):
> >        # Verify default emulator orientation
> >        screen = self.marionette.emulator.screen
> 
> I think this line can be put as a top-level class attribute for the test
> class, or?

No, I tried that actually but marionette.emulator.screen doesn't seem to be visible outside of the setUp or test methods (unless I tried it incorrectly).

> 
> >    def test_portraitSecondary(self):
> >        # Verify changing orientation to SO_PORTRAIT_SECONDARY
> >        self.doTest(self.marionette.emulator.screen.SO_PORTRAIT_SECONDARY)
> [..]
> >        # Reset orientation to where it was as the start
> >        self.marionette.log("Resetting emulator orientation.")
> >        self.marionette.emulator.screen.initialize()
> >        # Last test finished, verify event count
> >        self.doVerifyEventCount()
> 
> Is there no tearDown for each test method where we could put this into?

Not every test case expects an event, added a call to the method where expected.

> 
> >    def doTest(self, orientationToTest):
> 
> Python usually doesn't use camel-case notation. Instead name the parameter
> orientation_to_test.

Done.

> 
> >        self.marionette.log("Changing emulator orientation to '" + orientationToTest + "'.")
> 
> For the final patch I assume you will remove all those log calls?

No, the logging is very useful to have when debugging tests on TBPL. Also useful for developers trying to debug failing tests on try or inbound, otherwise they may need to ping the test creator each time.

> 
> >        self.assertEqual(screen.orientation, orientationToTest, "correct emulator orientation")
> >        # Sleep to let the orientation change actually happen
> >        time.sleep(1)
> 
> I don't think we have to wait here. Setting the new orientation is a
> blocking call in Python and gaia should have it already picked up, or not?

It seems to take a second for the emulator to actually change the orientation, without this sleep the tests fail consistently.

> 
> >        # Verify window.screen.orientation has same value
> >        result = self.marionette.execute_script("""
> >        let myScreen = window.screen;
> >        return myScreen.mozOrientation;
> >        """)
> 
> The test for the default orientation has similar code. I think it would make
> sense to have a helper method here.

Done.

> 
> >    def doVerifyEventCount(self):
> >        # Verify recived 4 'mozorientationchange' events
> >        eventCount = self.marionette.execute_script("return window.wrappedJSObject.eventCounter;")
> >        self.marionette.log("Verified " + str(eventCount) + " 'mozorientationchange' events were received.")
> >        self.assertEqual(eventCount, 4, "number of events")
> 
> Why does only test_portraitSecondary make use of it? Each test should check
> that the event has really been fired. Otherwise we will hide important
> information and the test will not tell us which orientation change didn't
> fire the event.

Done, event checking now done in each test case that expects the event.

> 
> 
> So lockOrientation/unlockOrientation will be covered in another test?
> 
> Otherwise looks like the right direction to go.

Yes there is a separate test for lockOrientation (Bug 813774).
Ping whimboo for a review of the latest patch when you have a chance, thanks!
Comment on attachment 695511 [details] [diff] [review]
Screen orientation modes test

Review of attachment 695511 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry that it has been taken so long, Rob. With all the latest stuff it got missed. For the remaining things to update please let this discussed with Dave.

::: dom/base/test/marionette/manifest.ini
@@ +2,5 @@
> +b2g = true
> +browser = false
> +qemu = true
> +
> +[test_orientation_modes.py]

I would rename the file to test_screen_orientation_modes.py to make it clear what it is about.

::: dom/base/test/marionette/test_orientation_modes.py
@@ +5,5 @@
> +    def setUp(self):
> +        # code to execute before any tests are run
> +        MarionetteTestCase.setUp(self)
> +        self.marionette.log("Initializing.")
> +        screen = self.marionette.emulator.screen

Can we make the screen variable a member of the test class? That way the tests can make use of it and you do not have to create it over and over again.

@@ +8,5 @@
> +        self.marionette.log("Initializing.")
> +        screen = self.marionette.emulator.screen
> +        screen.initialize()
> +        self.marionette.log("Emulator orientation is '" +
> +            screen.orientation + "'.")

I think this log entry is not necessary. You already log that we run initialize. So it will always be the primary orientation. if there is a test missing it should be added to the unit test in marionette.

@@ +19,5 @@
> +    def test_default_orientation(self):
> +        # Verify default emulator orientation
> +        screen = self.marionette.emulator.screen
> +        self.marionette.log("Verifying default orientation, expect '" +
> +            screen.SO_PORTRAIT_PRIMARY + "'.")

Right after this line you run assertEqual. So this log is not necessary. Dave agreed on it.

@@ +39,5 @@
> +
> +    def test_portrait_primary(self):
> +        # Verify changing orientation to SO_PORTRAIT_PRIMARY
> +        self.do_test(self.marionette.emulator.screen.SO_PORTRAIT_PRIMARY)
> +        # Note: Do NOT expect 'mozorientationchange' event here

I would expect to also test for an event getting fired here. Otherwise there is missing a piece. Why can't you run all of those tests in a single test method? We actually wouldn't have to run initialize() for each test given that we do not depend on the former state. Putting each orientation checks into separate tests makes it hard to follow.

@@ +62,5 @@
> +        self.marionette.log("Changing emulator orientation to '" +
> +            orientation_to_test + "'.")
> +        screen.orientation = orientation_to_test
> +        self.marionette.log("Emulator orientation is now '" +
> +            screen.orientation + "'.")

Same here. This log is not necessary given that you run assertEqual() right after.

@@ +66,5 @@
> +            screen.orientation + "'.")
> +        self.assertEqual(screen.orientation, orientation_to_test,
> +            "correct emulator orientation")
> +        # Sleep to let the orientation change actually happen
> +        time.sleep(1)

This can cause random orangeness especially when the emulator is working a bit slower on some machines. So I talked with Dave and we might have to find another way in waiting that the event has happened. Most likely the script has to be executed asynchronously and you wait for the return via MarionetteScriptFinished(). Please ask Dave for an additional review once you have updated the other comments.

@@ +73,5 @@
> +    def do_verify_orientation(self, orientation_to_test):
> +        # Verify window.screen.orientation has expected value
> +        result = self.marionette.execute_script("""
> +        let myScreen = window.screen;
> +        return myScreen.mozOrientation;

There is no need to use a new variable here. You cna directly return window.screen.mozOrientation.

@@ +76,5 @@
> +        let myScreen = window.screen;
> +        return myScreen.mozOrientation;
> +        """)
> +        self.marionette.log("window.screen.mozOrientation is now '" +
> +            result + "'.")

Same as above for log.
Attachment #695511 - Flags: review?(hskupin) → review-
(In reply to Henrik Skupin (:whimboo) [away 02/09 - 02/017] from comment #9)
> @@ +19,5 @@
> > +    def test_default_orientation(self):
> > +        # Verify default emulator orientation
> > +        screen = self.marionette.emulator.screen
> > +        self.marionette.log("Verifying default orientation, expect '" +
> > +            screen.SO_PORTRAIT_PRIMARY + "'.")
> 
> Right after this line you run assertEqual. So this log is not necessary.
> Dave agreed on it.

To clarify, the assert should provide the same value as the log statement if it fails as the test will be immediately aborted. In contrast, the JavaScript Marionette tests continue after failures are discovered, and so in that case the logs are more valuable.

> @@ +66,5 @@
> > +            screen.orientation + "'.")
> > +        self.assertEqual(screen.orientation, orientation_to_test,
> > +            "correct emulator orientation")
> > +        # Sleep to let the orientation change actually happen
> > +        time.sleep(1)
> 
> This can cause random orangeness especially when the emulator is working a
> bit slower on some machines. So I talked with Dave and we might have to find
> another way in waiting that the event has happened. Most likely the script
> has to be executed asynchronously and you wait for the return via
> MarionetteScriptFinished(). Please ask Dave for an additional review once
> you have updated the other comments.

If we can avoid the sleep, that would be awesome. Can we wait for the onmozorientationchange event to fire in this case?
(In reply to Henrik Skupin (:whimboo) from comment #9)

Thanks guys, my comments inline.

> Comment on attachment 695511 [details] [diff] [review]
> Screen orientation modes test
> 
> Review of attachment 695511 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Sorry that it has been taken so long, Rob. With all the latest stuff it got
> missed. For the remaining things to update please let this discussed with
> Dave.
> 
> ::: dom/base/test/marionette/manifest.ini
> @@ +2,5 @@
> > +b2g = true
> > +browser = false
> > +qemu = true
> > +
> > +[test_orientation_modes.py]
> 
> I would rename the file to test_screen_orientation_modes.py to make it clear
> what it is about.

Ok will do.

> 
> ::: dom/base/test/marionette/test_orientation_modes.py
> @@ +5,5 @@
> > +    def setUp(self):
> > +        # code to execute before any tests are run
> > +        MarionetteTestCase.setUp(self)
> > +        self.marionette.log("Initializing.")
> > +        screen = self.marionette.emulator.screen
> 
> Can we make the screen variable a member of the test class? That way the
> tests can make use of it and you do not have to create it over and over
> again.
> 

I need to get this test submitted ASAP. There are only two screen orientation tests so I don't see it being worth adding this variable to the class just for two tests.

> @@ +8,5 @@
> > +        self.marionette.log("Initializing.")
> > +        screen = self.marionette.emulator.screen
> > +        screen.initialize()
> > +        self.marionette.log("Emulator orientation is '" +
> > +            screen.orientation + "'.")
> 
> I think this log entry is not necessary. You already log that we run
> initialize. So it will always be the primary orientation. if there is a test
> missing it should be added to the unit test in marionette.

Ok I will remove that line.

> 
> @@ +19,5 @@
> > +    def test_default_orientation(self):
> > +        # Verify default emulator orientation
> > +        screen = self.marionette.emulator.screen
> > +        self.marionette.log("Verifying default orientation, expect '" +
> > +            screen.SO_PORTRAIT_PRIMARY + "'.")
> 
> Right after this line you run assertEqual. So this log is not necessary.
> Dave agreed on it.

Ok I will remove that line.

> 
> @@ +39,5 @@
> > +
> > +    def test_portrait_primary(self):
> > +        # Verify changing orientation to SO_PORTRAIT_PRIMARY
> > +        self.do_test(self.marionette.emulator.screen.SO_PORTRAIT_PRIMARY)
> > +        # Note: Do NOT expect 'mozorientationchange' event here
> 
> I would expect to also test for an event getting fired here. Otherwise there
> is missing a piece. Why can't you run all of those tests in a single test
> method? We actually wouldn't have to run initialize() for each test given
> that we do not depend on the former state. Putting each orientation checks
> into separate tests makes it hard to follow.

No, no event is expected here because the device is already initialized to PORTRAIT_PRIMARY and the mode is not actually changed. I prefer to leave each test case in its own test as is, as I want to test going from PRIMARY to each of the modes, and take advantage of the initialization. Also I need to get this test in ASAP, I don't want to modify the entire test structure at this point (and that wasn't mentioned in the first test review).

> 
> @@ +62,5 @@
> > +        self.marionette.log("Changing emulator orientation to '" +
> > +            orientation_to_test + "'.")
> > +        screen.orientation = orientation_to_test
> > +        self.marionette.log("Emulator orientation is now '" +
> > +            screen.orientation + "'.")
> 
> Same here. This log is not necessary given that you run assertEqual() right
> after.

Ok, I will remove that line.

> 
> @@ +66,5 @@
> > +            screen.orientation + "'.")
> > +        self.assertEqual(screen.orientation, orientation_to_test,
> > +            "correct emulator orientation")
> > +        # Sleep to let the orientation change actually happen
> > +        time.sleep(1)
> 
> This can cause random orangeness especially when the emulator is working a
> bit slower on some machines. So I talked with Dave and we might have to find
> another way in waiting that the event has happened. Most likely the script
> has to be executed asynchronously and you wait for the return via
> MarionetteScriptFinished(). Please ask Dave for an additional review once
> you have updated the other comments.

The wait seems to work, but if you have a better method then please provide some sample code so I can get this test done ASAP, thanks!

> 
> @@ +73,5 @@
> > +    def do_verify_orientation(self, orientation_to_test):
> > +        # Verify window.screen.orientation has expected value
> > +        result = self.marionette.execute_script("""
> > +        let myScreen = window.screen;
> > +        return myScreen.mozOrientation;
> 
> There is no need to use a new variable here. You cna directly return
> window.screen.mozOrientation.

Ah right, I will correct that.

> 
> @@ +76,5 @@
> > +        let myScreen = window.screen;
> > +        return myScreen.mozOrientation;
> > +        """)
> > +        self.marionette.log("window.screen.mozOrientation is now '" +
> > +            result + "'.")
> 
> Same as above for log.

Ok, I will take that line out, thanks.
(In reply to Dave Hunt (:davehunt) from comment #10)
> (In reply to Henrik Skupin (:whimboo) [away 02/09 - 02/017] from comment #9)
> > @@ +19,5 @@
> > > +    def test_default_orientation(self):
> > > +        # Verify default emulator orientation
> > > +        screen = self.marionette.emulator.screen
> > > +        self.marionette.log("Verifying default orientation, expect '" +
> > > +            screen.SO_PORTRAIT_PRIMARY + "'.")
> > 
> > Right after this line you run assertEqual. So this log is not necessary.
> > Dave agreed on it.
> 
> To clarify, the assert should provide the same value as the log statement if
> it fails as the test will be immediately aborted. In contrast, the
> JavaScript Marionette tests continue after failures are discovered, and so
> in that case the logs are more valuable.
> 
> > @@ +66,5 @@
> > > +            screen.orientation + "'.")
> > > +        self.assertEqual(screen.orientation, orientation_to_test,
> > > +            "correct emulator orientation")
> > > +        # Sleep to let the orientation change actually happen
> > > +        time.sleep(1)
> > 
> > This can cause random orangeness especially when the emulator is working a
> > bit slower on some machines. So I talked with Dave and we might have to find
> > another way in waiting that the event has happened. Most likely the script
> > has to be executed asynchronously and you wait for the return via
> > MarionetteScriptFinished(). Please ask Dave for an additional review once
> > you have updated the other comments.
> 
> If we can avoid the sleep, that would be awesome. Can we wait for the
> onmozorientationchange event to fire in this case?

No, we cannot wait for the event because by design the 'onmozorientationevent' is actually fired BEFORE the actual orientation change... that is why the sleep is needed to wait for the actual change to occur after the event.
Thanks for the input guys. I am attaching a new patch with changes as discussed above. I ran the test several times on my VM and it passed each time. Note, I increased the sleep time in case the emulator runs slower on some other machines (I am open to ideas if there is a method to avoid the sleep but since we cannot wait for an event I don't know how else to do this other than sleep).
Attachment #695511 - Attachment is obsolete: true
Attachment #721842 - Flags: review?(dave.hunt)
I misunderstood the review comment re: make the screen variable a part of the class, please disregard the latest attachment - I am going to attach yet another attachment with that change also included.
Attachment #721842 - Flags: review?(dave.hunt)
New patch with post-review changes as mentioned above.
Attachment #721842 - Attachment is obsolete: true
Attachment #721867 - Flags: review?(dave.hunt)
Comment on attachment 721867 [details] [diff] [review]
Newest test and manifests

Review of attachment 721867 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good, mostly nits. It would be great if we could address the sleep before we land this, as I'm concerned that this might cause intermittent failures. That said, I've been unable to get my emulator built/running for the last couple of days so haven't been able to test this patch.

::: dom/base/test/marionette/test_screen_orientation_modes.py
@@ +34,5 @@
> +
> +    def test_portrait_primary(self):
> +        # Verify changing orientation to SO_PORTRAIT_PRIMARY
> +        self.do_test(self.screen.SO_PORTRAIT_PRIMARY)
> +        # Note: Do NOT expect 'mozorientationchange' event here

Should we verify that got_event is false? If we changed do_verify_event to a property that returned a boolean, then we could assert on the value returned.

@@ +52,5 @@
> +            window.wrappedJSObject.event = true;
> +            window.screen.onmozorientationchange = null;
> +        };
> +        """)
> +        self.marionette.log("Changing emulator orientation to '" +

Nit: I would keep this on a single line, and use string formatting: self.marionette.log("Changing emulator orientation to '%s'." % orientation_to_test)

@@ +58,5 @@
> +        self.screen.orientation = orientation_to_test
> +        self.assertEqual(self.screen.orientation, orientation_to_test,
> +            "correct emulator orientation")
> +        # Sleep to let the orientation change actually happen
> +        time.sleep(5)

Rather than a sleep we could use a wait. In WebDriver the support class WebDriverWait is provided. I have opened bug 850881 to get this implemented in Marionette, which should mean we could use something like MarionetteWait(self.marionette, 30).until(lamdba m: m.execute_script('return window.screen.mozOrientation;') == orientation_to_test).

Alternatively, we could use an asynchronous execute script that only returns once window.screen.mozOrientation equals the expected orientation or otherwise times out. We could put this wait in the do_verify_orientation method.

@@ +61,5 @@
> +        # Sleep to let the orientation change actually happen
> +        time.sleep(5)
> +        self.do_verify_orientation(orientation_to_test)
> +
> +    def do_verify_orientation(self, orientation_to_test):

Nit: For this and other methods, I would remove the do_ prefix.

@@ +63,5 @@
> +        self.do_verify_orientation(orientation_to_test)
> +
> +    def do_verify_orientation(self, orientation_to_test):
> +        # Verify window.screen.orientation has expected value
> +        result = self.marionette.execute_script("""

Nit: I would put this all on one line, and just use single quotes.

@@ +70,5 @@
> +        self.assertEqual(result, orientation_to_test, "correct mozOrientation")
> +
> +    def do_verify_event(self):
> +        # Verify recived 'mozorientationchange' event
> +        got_event = self.marionette.execute_script("return " +

Nit: No need to use + to concatenate Python strings when splitting on new line, but I would keep this all on one line.
Attachment #721867 - Flags: review?(dave.hunt) → review-
I have spent lots of time on this, and there doesn't seem to be any way to write this test without using a time sleep (which I agree is not acceptable as it may cause intermittent failures on TBPL). Even if the test is simplified to only check for mozorientation events, there is no actual way to wait for the event before proceeding to the next test. This is because to wait without a sleep we need to use execute_async_script, but since this is a python test (so we can use the orientation emulator class Henrik added) that fails because the callback itself interrupts.

See bug 813774 for more information. In that test it was possible to simplify the test to only check for events because the call to mozLockOrientation returns a value indicating if the lock was successful; and therefore by that time the event has already fired, so the next test can go on without getting ahead of itself/having to wait.

Not going to pursue this test any further as there appears to be no good solution, and in my opinion the amount of time spent on this test (by several people) thus far has already outweighed any possible return value...
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Dave found a solution (see bug 813774 for details) so re-opening this issue.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Status: REOPENED → RESOLVED
Closed: 11 years ago9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: