2012-03-27 13:16:14 -07:00
|
|
|
#filter substitution
|
|
|
|
package @ANDROID_PACKAGE_NAME@.tests;
|
|
|
|
|
|
|
|
import @ANDROID_PACKAGE_NAME@.*;
|
|
|
|
|
|
|
|
public class testCheck2 extends PixelTest {
|
2012-06-27 16:56:49 -07:00
|
|
|
@Override
|
|
|
|
protected int getTestType() {
|
|
|
|
return TEST_TALOS;
|
|
|
|
}
|
|
|
|
|
2012-03-27 13:16:14 -07:00
|
|
|
public void testCheck2() {
|
2012-04-26 11:24:30 -07:00
|
|
|
String url = getAbsoluteUrl("/startup_test/fennecmark/cnn/cnn.com/index.html");
|
2012-03-27 13:16:14 -07:00
|
|
|
|
|
|
|
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
|
|
|
|
loadAndPaint(url);
|
|
|
|
mDriver.setupScrollHandling();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* for this test, we load the timecube page, and replay a recorded sequence of events
|
|
|
|
* that is a user panning/zooming around the page. specific things in the sequence
|
|
|
|
* include:
|
|
|
|
* - scroll on one axis followed by scroll on another axis
|
|
|
|
* - pinch zoom (in and out)
|
|
|
|
* - double-tap zoom (in and out)
|
|
|
|
* - multi-fling panning with different velocities on each fling
|
|
|
|
*
|
|
|
|
* this checkerboarding metric is going to be more of a "functional" style test than
|
|
|
|
* a "unit" style test; i.e. it covers a little bit of a lot of things to measure
|
|
|
|
* overall performance, but doesn't really allow identifying which part is slow.
|
|
|
|
*/
|
|
|
|
|
|
|
|
MotionEventReplayer mer = new MotionEventReplayer(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
|
|
|
|
|
2012-04-12 09:38:20 -07:00
|
|
|
float completeness = 0.0f;
|
2012-03-27 13:16:14 -07:00
|
|
|
mDriver.startCheckerboardRecording();
|
|
|
|
// replay the events
|
|
|
|
try {
|
|
|
|
mer.replayEvents(getAsset("testcheck2-motionevents"));
|
2012-04-12 09:38:20 -07:00
|
|
|
// give it some time to draw any final frames
|
2012-03-27 13:16:14 -07:00
|
|
|
Thread.sleep(1000);
|
2012-04-12 09:38:20 -07:00
|
|
|
completeness = mDriver.stopCheckerboardRecording();
|
|
|
|
} catch (Exception e) {
|
2012-08-23 09:47:55 -07:00
|
|
|
mAsserter.ok(false, "Exception while replaying events", e.toString());
|
2012-03-27 13:16:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
mAsserter.dumpLog("__start_report" + completeness + "__end_report");
|
|
|
|
System.out.println("Completeness score: " + completeness);
|
|
|
|
long msecs = System.currentTimeMillis();
|
|
|
|
mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp");
|
|
|
|
}
|
|
|
|
}
|