mobile/android/base/tests/testCheck.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

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
michael@0 4 public class testCheck extends PixelTest {
michael@0 5 private void pause(int length) {
michael@0 6 try {
michael@0 7 Thread.sleep(length);
michael@0 8 } catch (InterruptedException e) {
michael@0 9 e.printStackTrace();
michael@0 10 }
michael@0 11 }
michael@0 12
michael@0 13 @Override
michael@0 14 protected Type getTestType() {
michael@0 15 return Type.TALOS;
michael@0 16 }
michael@0 17
michael@0 18 public void testCheck() {
michael@0 19 String url = getAbsoluteUrl("/startup_test/fennecmark/timecube.html");
michael@0 20
michael@0 21 blockForGeckoReady();
michael@0 22
michael@0 23 loadAndPaint(url);
michael@0 24
michael@0 25 mDriver.setupScrollHandling();
michael@0 26
michael@0 27 // Setup scrolling coordinates.
michael@0 28 MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
michael@0 29 int midX = mDriver.getGeckoWidth() / 2;
michael@0 30 int height = mDriver.getGeckoHeight();
michael@0 31 int topY = height / 8;
michael@0 32
michael@0 33 mDriver.startCheckerboardRecording();
michael@0 34
michael@0 35 // Scroll repeatedly downwards, then upwards. On each iteration of i,
michael@0 36 // increase the scroll distance to test different scroll amounts.
michael@0 37 for (int i = 2; i < 7; i++) {
michael@0 38 int botY = (height * i / 8);
michael@0 39 for (int j = 0; j < 3; j++) {
michael@0 40 meh.dragSync(midX, botY, midX, topY, 200);
michael@0 41 pause(1000);
michael@0 42 }
michael@0 43 for (int j = 0; j < 3; j++) {
michael@0 44 meh.dragSync(midX, topY, midX, botY, 200);
michael@0 45 pause(1000);
michael@0 46 }
michael@0 47 }
michael@0 48
michael@0 49 float completeness = mDriver.stopCheckerboardRecording();
michael@0 50 mAsserter.dumpLog("__start_report" + completeness + "__end_report");
michael@0 51 long msecs = System.currentTimeMillis();
michael@0 52 mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp");
michael@0 53 }
michael@0 54 }

mercurial