michael@0: package org.mozilla.gecko.tests; michael@0: michael@0: michael@0: public class testCheck extends PixelTest { michael@0: private void pause(int length) { michael@0: try { michael@0: Thread.sleep(length); michael@0: } catch (InterruptedException e) { michael@0: e.printStackTrace(); michael@0: } michael@0: } michael@0: michael@0: @Override michael@0: protected Type getTestType() { michael@0: return Type.TALOS; michael@0: } michael@0: michael@0: public void testCheck() { michael@0: String url = getAbsoluteUrl("/startup_test/fennecmark/timecube.html"); michael@0: michael@0: blockForGeckoReady(); michael@0: michael@0: loadAndPaint(url); michael@0: michael@0: mDriver.setupScrollHandling(); michael@0: michael@0: // Setup scrolling coordinates. michael@0: MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop()); michael@0: int midX = mDriver.getGeckoWidth() / 2; michael@0: int height = mDriver.getGeckoHeight(); michael@0: int topY = height / 8; michael@0: michael@0: mDriver.startCheckerboardRecording(); michael@0: michael@0: // Scroll repeatedly downwards, then upwards. On each iteration of i, michael@0: // increase the scroll distance to test different scroll amounts. michael@0: for (int i = 2; i < 7; i++) { michael@0: int botY = (height * i / 8); michael@0: for (int j = 0; j < 3; j++) { michael@0: meh.dragSync(midX, botY, midX, topY, 200); michael@0: pause(1000); michael@0: } michael@0: for (int j = 0; j < 3; j++) { michael@0: meh.dragSync(midX, topY, midX, botY, 200); michael@0: pause(1000); michael@0: } michael@0: } michael@0: michael@0: float completeness = mDriver.stopCheckerboardRecording(); michael@0: mAsserter.dumpLog("__start_report" + completeness + "__end_report"); michael@0: long msecs = System.currentTimeMillis(); michael@0: mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp"); michael@0: } michael@0: }