Set mServiceCreated to false when onDestroy().

If tests call shutdownService() themselves, we should not call onDestroy()
again from tearDown(). Set mServiceCreated to false when we call onDestroy
to prevent this.

Change-Id: I618cb770cb43072273abdd2fdffd3390911203a1
This commit is contained in:
Mathew Inwood
2013-10-22 17:39:37 +01:00
parent e9293c1a1f
commit 1804e258fa

View File

@@ -263,6 +263,7 @@ public abstract class ServiceTestCase<T extends Service> extends AndroidTestCase
}
if (mServiceCreated) {
mService.onDestroy();
mServiceCreated = false;
}
}