Bug 1411654 - Pre: Clear icon disk storage in test. r=mcomella draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 07 Nov 2017 20:24:04 -0800
changeset 749687 4d6bb4916cde61f198004661bed58025e91ffa9c
parent 749686 f1726d37fa285de1042fed76a722f941380cbf63
child 749688 0bf39a7d8daddc9a5c74182cf266f5d01d17acc8
push id97470
push usernalexander@mozilla.com
push dateWed, 31 Jan 2018 21:14:34 +0000
reviewersmcomella
bugs1411654
milestone60.0a1
Bug 1411654 - Pre: Clear icon disk storage in test. r=mcomella Newer versions of Robolectric seem to have different semantics about clearing disk caches, so this is necessary. But for older versions, it shouldn't hurt, and is slightly more clear than relying on an implicit clear. MozReview-Commit-ID: LRcaEPasXj8
mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestLookupIconUrl.java
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestLookupIconUrl.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/icons/preparation/TestLookupIconUrl.java
@@ -23,16 +23,17 @@ public class TestLookupIconUrl {
     private static final String TEST_ICON_URL_2 = "http://example.org/favicon.ico";
     private static final String TEST_ICON_URL_3 = "http://example.com/favicon.ico";
     private static final String TEST_ICON_URL_4 = "http://example.net/favicon.ico";
 
 
     @Before
     public void setUp() {
         MemoryStorage.get().evictAll();
+        DiskStorage.get(RuntimeEnvironment.application).evictAll();
     }
 
     @Test
     public void testNoIconUrlIsAddedByDefault() {
         final IconRequest request = Icons.with(RuntimeEnvironment.application)
                 .pageUrl(TEST_PAGE_URL)
                 .build();