1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/tests/testCheck.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +package org.mozilla.gecko.tests; 1.5 + 1.6 + 1.7 +public class testCheck extends PixelTest { 1.8 + private void pause(int length) { 1.9 + try { 1.10 + Thread.sleep(length); 1.11 + } catch (InterruptedException e) { 1.12 + e.printStackTrace(); 1.13 + } 1.14 + } 1.15 + 1.16 + @Override 1.17 + protected Type getTestType() { 1.18 + return Type.TALOS; 1.19 + } 1.20 + 1.21 + public void testCheck() { 1.22 + String url = getAbsoluteUrl("/startup_test/fennecmark/timecube.html"); 1.23 + 1.24 + blockForGeckoReady(); 1.25 + 1.26 + loadAndPaint(url); 1.27 + 1.28 + mDriver.setupScrollHandling(); 1.29 + 1.30 + // Setup scrolling coordinates. 1.31 + MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop()); 1.32 + int midX = mDriver.getGeckoWidth() / 2; 1.33 + int height = mDriver.getGeckoHeight(); 1.34 + int topY = height / 8; 1.35 + 1.36 + mDriver.startCheckerboardRecording(); 1.37 + 1.38 + // Scroll repeatedly downwards, then upwards. On each iteration of i, 1.39 + // increase the scroll distance to test different scroll amounts. 1.40 + for (int i = 2; i < 7; i++) { 1.41 + int botY = (height * i / 8); 1.42 + for (int j = 0; j < 3; j++) { 1.43 + meh.dragSync(midX, botY, midX, topY, 200); 1.44 + pause(1000); 1.45 + } 1.46 + for (int j = 0; j < 3; j++) { 1.47 + meh.dragSync(midX, topY, midX, botY, 200); 1.48 + pause(1000); 1.49 + } 1.50 + } 1.51 + 1.52 + float completeness = mDriver.stopCheckerboardRecording(); 1.53 + mAsserter.dumpLog("__start_report" + completeness + "__end_report"); 1.54 + long msecs = System.currentTimeMillis(); 1.55 + mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp"); 1.56 + } 1.57 +}