Ejemplo n.º 1
0
 @Test
 public void reset__shouldClearStaticState() throws Exception {
   String src = "source1";
   ShadowDrawable.addCorruptStreamSource(src);
   assertTrue(ShadowDrawable.corruptStreamSources.contains(src));
   ShadowDrawable.reset();
   assertFalse(ShadowDrawable.corruptStreamSources.contains(src));
 }
Ejemplo n.º 2
0
 @Test
 public void
     createFromStream__shouldReturnNullWhenAskedToCreateADrawableFromACorruptedSourceStream()
         throws Exception {
   String corruptedStreamSource = "http://foo.com/image.jpg";
   ShadowDrawable.addCorruptStreamSource(corruptedStreamSource);
   assertNull(
       ShadowDrawable.createFromStream(
           new ByteArrayInputStream(new byte[0]), corruptedStreamSource));
 }