2013-11-07 08:18:51 -08:00
|
|
|
package org.mozilla.gecko.tests;
|
2012-03-27 13:16:14 -07:00
|
|
|
|
|
|
|
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
|
|
|
|
2012-10-25 12:37:39 -07:00
|
|
|
blockForGeckoReady();
|
2012-03-27 13:16:14 -07:00
|
|
|
loadAndPaint(url);
|
2013-08-27 08:38:23 -07:00
|
|
|
|
2012-03-27 13:16:14 -07:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2013-01-21 13:17:06 -08:00
|
|
|
MotionEventReplayer mer = new MotionEventReplayer(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop(),
|
|
|
|
mDriver.getGeckoWidth(), mDriver.getGeckoHeight());
|
2012-03-27 13:16:14 -07:00
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|