Closed Bug 874914 Opened 11 years ago Closed 8 years ago

moveByOffset and move don't behave as expected

Categories

(Remote Protocol :: Marionette, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mdas, Unassigned)

Details

(Keywords: pi-marionette-userinput, Whiteboard: [affects=gaia webqa])

Attachments

(4 files)

moveByOffset and move can break proper scrolling behaviour.

I first saw this problem when unit testing moveByOffset. If you call it twice on testAction.html using test_single_finger.py, it will stop you from being able to scroll on the page, ie: test_gesture.py will fail when you run it after test_single_finger.py. It prevents scrolling on any page. If you go to say, google.com or any other webpage, you'll now be unable to scroll. This happens whether or not you use moveByOffset to change the viewport. This only happens if you use moveByOffset with touch events. If you use mouse events only, I can't reproduce the problem. I'll attach the tests in a followup comment.

This problem shows up outside of unit testing as well. If you call 'moveByOffset' or 'move' on the homescreen to swipe to another panel (ie: to change the viewport), then physically try to swipe on the homescreen after that completes, the screen won't swipe the way you expect and will instead go into a weird state. You can recover to normal state by swiping a few more times. This problem only happens on the homescreen/in apps if you change the viewport. I've attached a test to create the problem called "test_break_screen.py". Run it, then swipe your finger about 1 centimeter to get to the left panel. It will only partially change the viewport.
Attached file unit-test: test page
(In reply to Malini Das [:mdas] from comment #0)
> I first saw this problem when unit testing moveByOffset. If you call it
> twice on testAction.html using test_single_finger.py, it will stop you from
> being able to scroll on the page,

I forgot to mention that if you call it once on the test page like so: action.press(ele).move_by_offset(0,300).release().perform(), then scroll behaviour is unaffected. The problem only happens if you chain move_by_offset calls.

This attachment is the test page you'll need to put in testing/marionette/client/marionette/www/ for the following attachments to run against
This is the test that calls moveByOffset twice, and breaks scrolling.
This is the test that breaks if you call it after you call the moveByOffset test. 

The strange thing is that this test uses moveByOffset multiple times as well. If you call this test multiple times, it can scroll happily. But if you call the moveByOffset test first, then this one, then it fails.

I did some debugging on this, and I can confirm that both tests send the right touch events. I've inspected the events, they're being sent with the right changedTouches at the right coordinates. I can confirm that touchend is called on each touch event dispatched, and that the global state of marionette-listener.js is clean on each test run. 

When debugging the test page, the only difference is that once you run the moveByOffset test, this test's window.scrollX/window.scrollY values can never change since the viewport is locked some how. The touch events we're dispatching remain the same.
(In reply to Malini Das [:mdas] from comment #3)
>  I can confirm that touchend is called on each touch event dispatched

to avoid confusion, this should be: 

I can confirm that touchend is called on each *touch* dispatched. touchend is called on a specific Touch object.
Severity: normal → major
Yep using the marionette-js-client's flick [1], I definitely only get the first moveByOffset in the chain.

[1] https://github.com/mozilla-b2g/marionette-js-client/blob/master/lib/marionette/actions.js#L188-209
(In reply to Etienne Segonzac (:etienne) from comment #5)
> Yep using the marionette-js-client's flick [1], I definitely only get the
> first moveByOffset in the chain.
> 
> [1]
> https://github.com/mozilla-b2g/marionette-js-client/blob/master/lib/
> marionette/actions.js#L188-209

I can't reproduce this error using my previous STR, can you give me some details on how I can reproduce the errors using the marionette-js-client?
and did you see this in device or in b2g desktop?
(In reply to Malini Das [:mdas] from comment #7)
> and did you see this in device or in b2g desktop?

b2g desktop, the test is part of the wip [1] for bug 958584, using a single press.moveByOffset.release call for now but this used to be a flick()

[1] https://github.com/mozilla-b2g/gaia/pull/15207/files#diff-44930773b108c3e352f1c6705b4ea6daR37
Whiteboard: [u=marionette-user c=marionette-server p=2]
Whiteboard: [u=marionette-user c=marionette-server p=2] → [u=marionette-user c=marionette-server p=2][touch]
Priority: -- → P3
Whiteboard: [u=marionette-user c=marionette-server p=2][touch] → [u=marionette-user c=marionette-server p=2][touch][affects=gaia webqa]
Whiteboard: [u=marionette-user c=marionette-server p=2][touch][affects=gaia webqa] → [affects=gaia webqa]
closing b2g related
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
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: