mobile/android/base/tests/testCheck.java

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

mercurial