Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | package org.mozilla.gecko.tests; |
michael@0 | 2 | |
michael@0 | 3 | import org.mozilla.gecko.Actions; |
michael@0 | 4 | import org.mozilla.gecko.PaintedSurface; |
michael@0 | 5 | |
michael@0 | 6 | /** |
michael@0 | 7 | * A basic panning correctness test. |
michael@0 | 8 | * - Loads a page and verifies it draws |
michael@0 | 9 | * - drags page upwards by 100 pixels and verifies it draws |
michael@0 | 10 | * - drags page leftwards by 100 pixels and verifies it draws |
michael@0 | 11 | */ |
michael@0 | 12 | public class testPanCorrectness extends PixelTest { |
michael@0 | 13 | public void testPanCorrectness() { |
michael@0 | 14 | String url = getAbsoluteUrl("/robocop/robocop_boxes.html"); |
michael@0 | 15 | |
michael@0 | 16 | MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop()); |
michael@0 | 17 | |
michael@0 | 18 | blockForGeckoReady(); |
michael@0 | 19 | |
michael@0 | 20 | // load page and check we're at 0,0 |
michael@0 | 21 | loadAndVerifyBoxes(url); |
michael@0 | 22 | |
michael@0 | 23 | // drag page upwards by 100 pixels |
michael@0 | 24 | Actions.RepeatedEventExpecter paintExpecter = mActions.expectPaint(); |
michael@0 | 25 | meh.dragSync(10, 150, 10, 50); |
michael@0 | 26 | PaintedSurface painted = waitForPaint(paintExpecter); |
michael@0 | 27 | paintExpecter.unregisterListener(); |
michael@0 | 28 | try { |
michael@0 | 29 | checkScrollWithBoxes(painted, 0, 100); |
michael@0 | 30 | } finally { |
michael@0 | 31 | painted.close(); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | // drag page leftwards by 100 pixels |
michael@0 | 35 | paintExpecter = mActions.expectPaint(); |
michael@0 | 36 | meh.dragSync(150, 10, 50, 10); |
michael@0 | 37 | painted = waitForPaint(paintExpecter); |
michael@0 | 38 | paintExpecter.unregisterListener(); |
michael@0 | 39 | try { |
michael@0 | 40 | checkScrollWithBoxes(painted, 100, 100); |
michael@0 | 41 | } finally { |
michael@0 | 42 | painted.close(); |
michael@0 | 43 | } |
michael@0 | 44 | } |
michael@0 | 45 | } |