• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 
17 package android.server.wm;
18 
19 import static android.server.wm.ShellCommandHelper.executeShellCommand;
20 
21 import android.platform.test.annotations.Presubmit;
22 
23 import androidx.test.runner.AndroidJUnit4;
24 
25 import org.junit.After;
26 import org.junit.Before;
27 import org.junit.runner.RunWith;
28 
29 @Presubmit
30 @RunWith(AndroidJUnit4.class)
31 public class DragDropCompatTest extends DragDropTest {
32     static final String TAG = "DragDropCompatTest";
33     static final String PACKAGE_NAME = "android.server.wm.cts";
34 
35     @Before
setUp()36     public void setUp() throws InterruptedException {
37         executeShellCommand("am compat enable --no-kill DOWNSCALED" + " " + PACKAGE_NAME);
38         executeShellCommand("am compat enable --no-kill DOWNSCALE_50" + " " + PACKAGE_NAME);
39         mInvCompatScale = 1 / 0.5f;
40         super.setUp();
41     }
42 
43     @After
tearDown()44     public void tearDown() throws Exception {
45         super.tearDown();
46         mInvCompatScale = 1.0f;
47         executeShellCommand("am compat disable --no-kill DOWNSCALED " + PACKAGE_NAME);
48         executeShellCommand("am compat disable --no-kill DOWNSCALE_50" + " " + PACKAGE_NAME);
49     }
50 }
51