Disable caches for perf tests
Bug: 140788621 Test: atest PackageManagerPerfTest Change-Id: Idba8ea4c53ceacd9e07a06717c44d5411aef45d8
This commit is contained in:
@@ -31,6 +31,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.filters.LargeTest;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -58,6 +59,12 @@ public class PackageManagerPerfTest {
|
||||
final Context context = InstrumentationRegistry.getInstrumentation().getContext();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
PackageManager.disableApplicationInfoCache();
|
||||
PackageManager.disablePackageInfoCache();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableCompatChanges(PackageManager.FILTER_APPLICATION_QUERY)
|
||||
public void testCheckPermissionExists() {
|
||||
|
||||
Reference in New Issue
Block a user