mirror of
https://github.com/androidx/media.git
synced 2025-05-11 17:49:52 +08:00
Automated g4 rollback of changelist 191128111.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191834511
This commit is contained in:
parent
26cb32ab6a
commit
8a74acbe6f
@ -93,6 +93,10 @@ public final class SimpleCache implements Cache {
|
||||
* @param index The CachedContentIndex to be used.
|
||||
*/
|
||||
/*package*/ SimpleCache(File cacheDir, CacheEvictor evictor, CachedContentIndex index) {
|
||||
if (!lockFolder(cacheDir)) {
|
||||
throw new IllegalStateException("Another SimpleCache instance uses the folder: " + cacheDir);
|
||||
}
|
||||
|
||||
this.cacheDir = cacheDir;
|
||||
this.evictor = evictor;
|
||||
this.index = index;
|
||||
|
@ -296,17 +296,17 @@ public class SimpleCacheTest {
|
||||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception {
|
||||
// new SimpleCache(cacheDir, new NoOpCacheEvictor());
|
||||
//
|
||||
// try {
|
||||
// new SimpleCache(cacheDir, new NoOpCacheEvictor());
|
||||
// assertWithMessage("Exception was expected").fail();
|
||||
// } catch (IllegalStateException e) {
|
||||
// // Expected. Do nothing.
|
||||
// }
|
||||
// }
|
||||
@Test
|
||||
public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception {
|
||||
new SimpleCache(cacheDir, new NoOpCacheEvictor());
|
||||
|
||||
try {
|
||||
new SimpleCache(cacheDir, new NoOpCacheEvictor());
|
||||
assertWithMessage("Exception was expected").fail();
|
||||
} catch (IllegalStateException e) {
|
||||
// Expected. Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease()
|
||||
|
Loading…
x
Reference in New Issue
Block a user