Bug 1318544 - Fix TestDownloadAction unit test bustage. r=ahunt
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 31 Jan 2017 20:43:56 +0100
changeset 469900 e96ce1680238b4e607fafb5c6072f40a8183d434
parent 469899 6dfd1abb7e943267ef499a17037205d109c19122
child 469901 fc0e726a478fcfa49512bb7551f29e1b2c3039b8
push id43881
push userbmo:gps@mozilla.com
push dateThu, 02 Feb 2017 23:49:03 +0000
reviewersahunt
bugs1318544
milestone54.0a1
Bug 1318544 - Fix TestDownloadAction unit test bustage. r=ahunt The return value of isKnownContent() now depends on whether we exclude this type of content or not. This patch updates the test to reflect that. MozReview-Commit-ID: F4KAVdv2l1X
mobile/android/tests/background/junit4/src/org/mozilla/gecko/dlc/TestDownloadAction.java
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/dlc/TestDownloadAction.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/dlc/TestDownloadAction.java
@@ -5,16 +5,17 @@
 
 package org.mozilla.gecko.dlc;
 
 import android.content.Context;
 
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.background.testhelpers.TestRunner;
 import org.mozilla.gecko.dlc.catalog.DownloadContent;
 import org.mozilla.gecko.dlc.catalog.DownloadContentBuilder;
 import org.mozilla.gecko.dlc.catalog.DownloadContentCatalog;
 import org.robolectric.RuntimeEnvironment;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -518,18 +519,19 @@ public class TestDownloadAction {
      */
     @Test
     public void testIsKnownContent() throws Exception {
         DownloadContent fontContent = createFontWithSize(1024L);
         DownloadContent hyphenationContent = createHyphenationDictionaryWithSize(1024L);
         DownloadContent unknownContent = createUnknownContent(1024L);
         DownloadContent contentWithUnknownType = createContentWithoutType(1024L);
 
-        Assert.assertTrue(fontContent.isKnownContent());
-        Assert.assertTrue(hyphenationContent.isKnownContent());
+        Assert.assertEquals(AppConstants.MOZ_ANDROID_EXCLUDE_FONTS, fontContent.isKnownContent());
+        Assert.assertEquals(AppConstants.MOZ_EXCLUDE_HYPHENATION_DICTIONARIES, hyphenationContent.isKnownContent());
+
         Assert.assertFalse(unknownContent.isKnownContent());
         Assert.assertFalse(contentWithUnknownType.isKnownContent());
     }
 
     private DownloadContent createUnknownContent(long size) {
         return new DownloadContentBuilder()
                 .setSize(size)
                 .build();