Disable caches for perf tests

Bug: 140788621
Test: atest PackageManagerPerfTest
Change-Id: Idba8ea4c53ceacd9e07a06717c44d5411aef45d8
This commit is contained in:
Patrick Baumann
2020-02-21 13:16:19 -08:00
parent 23c81a156e
commit d3990130cb

View File

@@ -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() {