summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2017-05-04 03:00:31 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-04 03:00:31 +0000
commit12b334ea91ceb149d89132f5f4aed298d7c4cddc (patch)
treea6edb7ba47c6dcf0f90adb436711186806ef9aec
parentedd58e7747ddb4ccaada60627d591b0f77cd5381 (diff)
parent2ecf42f96c9d9ee0d1c849cc8961d703dc037e10 (diff)
Merge "Added TaskSnapshotCacheTest back to presubmit" into oc-dev
am: 2ecf42f96c Change-Id: Ia90b5875ccf5baea70b6d7ae844cf07b8b9dd67c
-rw-r--r--services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java4
-rw-r--r--services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java6
2 files changed, 7 insertions, 3 deletions
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
index a23a6b22d9e8..649de4a783fa 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotCacheTest.java
@@ -20,6 +20,7 @@ import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
+import android.platform.test.annotations.Presubmit;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
@@ -33,8 +34,7 @@ import org.junit.runner.RunWith;
* runtest frameworks-services -c com.android.server.wm.TaskSnapshotCacheTest
*/
@SmallTest
-// TODO(b/35196891): Add back to presubmit once the bug is fixed.
-//@Presubmit
+@Presubmit
@RunWith(AndroidJUnit4.class)
public class TaskSnapshotCacheTest extends TaskSnapshotPersisterTestBase {
diff --git a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
index 18d0c321d181..8146763ae871 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
@@ -68,7 +68,11 @@ class TaskSnapshotPersisterTestBase extends WindowTestsBase {
}
private void cleanDirectory() {
- for (File file : new File(sFilesDir, "snapshots").listFiles()) {
+ final File[] files = new File(sFilesDir, "snapshots").listFiles();
+ if (files == null) {
+ return;
+ }
+ for (File file : files) {
if (!file.isDirectory()) {
file.delete();
}