| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.windowanimationjank; |
| 18 |
|
| 19 |
import android.os.Bundle; |
| 20 |
|
| 21 |
import androidx.test.jank.GfxMonitor; |
| 22 |
import androidx.test.jank.JankTest; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public class FullscreenRotationTest extends WindowAnimationJankTestBase { |
| 30 |
private final static int STEP_CNT = 3; |
| 31 |
|
| 32 |
@Override |
| 33 |
public void beforeTest() throws Exception { |
| 34 |
getUiDevice().setOrientationLeft(); |
| 35 |
Utils.startElementLayout(getInstrumentation(), 100); |
| 36 |
super.beforeTest(); |
| 37 |
} |
| 38 |
|
| 39 |
@Override |
| 40 |
public void afterTest(Bundle metrics) { |
| 41 |
Utils.rotateDevice(getInstrumentation(), Utils.ROTATION_MODE_NATURAL); |
| 42 |
super.afterTest(metrics); |
| 43 |
} |
| 44 |
|
| 45 |
@JankTest(expectedFrames=100, defaultIterationCount=2) |
| 46 |
@GfxMonitor(processName=Utils.PACKAGE) |
| 47 |
public void testRotation() throws Exception { |
| 48 |
for (int i = 0; i < STEP_CNT; ++i) { |
| 49 |
Utils.rotateDevice(getInstrumentation(), |
| 50 |
Utils.getDeviceRotation(getInstrumentation()) == Utils.ROTATION_MODE_LEFT ? |
| 51 |
Utils.ROTATION_MODE_RIGHT : Utils.ROTATION_MODE_LEFT); |
| 52 |
} |
| 53 |
} |
| 54 |
} |