blob: a8ace162c4d0095dbdf06cdc77ab3a56e9be0cb8 [file] [log] [blame]
Yury Khmel4f26c042015-09-02 17:39:14 +09001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.windowanimationjank;
18
Yury Khmel4f26c042015-09-02 17:39:14 +090019import android.support.test.uiautomator.UiDevice;
20
Brett Chabot502ec7a2019-03-01 14:43:20 -080021import androidx.test.jank.JankTestBase;
22
Yury Khmel4f26c042015-09-02 17:39:14 +090023/**
24 * This adds additional system level jank monitor and its result is merged with primary monitor
25 * used in test.
26 */
27public abstract class WindowAnimationJankTestBase extends JankTestBase {
28 private static final String TAG = "WindowAnimationJankTestBase";
29
30 protected WindowAnimationJankTestBase() {
31 }
32
33 @Override
34 protected void setUp() throws Exception {
35 super.setUp();
36
37 // fix device orientation
38 getUiDevice().setOrientationNatural();
39
40 // Start from the home screen
41 getUiDevice().pressHome();
42 getUiDevice().waitForIdle();
43 }
44
45 @Override
46 protected void tearDown() throws Exception {
47 getUiDevice().unfreezeRotation();
48 super.tearDown();
49 }
50
51 protected UiDevice getUiDevice() {
52 return UiDevice.getInstance(getInstrumentation());
53 }
54}