Skip to content

Commit

Permalink
fix test for now cleaner m3u player tag insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBab committed Nov 27, 2022
1 parent 35f72b8 commit 5dcc512
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/freenet/client/filter/ContentFilterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,36 +214,36 @@ public void testHTMLFilter() throws Exception {
public void testMetaRefresh() throws Exception {
HTMLFilter.metaRefreshSamePageMinInterval = 5;
HTMLFilter.metaRefreshRedirectMinInterval = 30;
assertEquals(META_TIME_ONLY + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY));
assertEquals(META_TIME_ONLY + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_WRONG_CASE));
assertEquals(META_TIME_ONLY + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_TOO_SHORT));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_NEGATIVE));
assertEquals(META_TIME_ONLY_BADNUM_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_BADNUM1));
assertEquals(META_TIME_ONLY_BADNUM_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_BADNUM2));
assertEquals(META_VALID_REDIRECT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_VALID_REDIRECT));
assertEquals(META_VALID_REDIRECT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_VALID_REDIRECT_NOSPACE));
assertEquals(META_BOGUS_REDIRECT1_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT1));
assertEquals(META_BOGUS_REDIRECT1_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT2));
assertEquals(META_BOGUS_REDIRECT3_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT3));
assertEquals(META_BOGUS_REDIRECT4_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT4));
assertEquals(META_BOGUS_REDIRECT1_OUT + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT5));
assertEquals(META_BOGUS_REDIRECT_NO_URL + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT6));
assertEquals(META_TIME_ONLY, headFilter(META_TIME_ONLY));
assertEquals(META_TIME_ONLY, headFilter(META_TIME_ONLY_WRONG_CASE));
assertEquals(META_TIME_ONLY, headFilter(META_TIME_ONLY_TOO_SHORT));
assertEquals("", headFilter(META_TIME_ONLY_NEGATIVE));
assertEquals(META_TIME_ONLY_BADNUM_OUT, headFilter(META_TIME_ONLY_BADNUM1));
assertEquals(META_TIME_ONLY_BADNUM_OUT, headFilter(META_TIME_ONLY_BADNUM2));
assertEquals(META_VALID_REDIRECT, headFilter(META_VALID_REDIRECT));
assertEquals(META_VALID_REDIRECT, headFilter(META_VALID_REDIRECT_NOSPACE));
assertEquals(META_BOGUS_REDIRECT1_OUT, headFilter(META_BOGUS_REDIRECT1));
assertEquals(META_BOGUS_REDIRECT1_OUT, headFilter(META_BOGUS_REDIRECT2));
assertEquals(META_BOGUS_REDIRECT3_OUT, headFilter(META_BOGUS_REDIRECT3));
assertEquals(META_BOGUS_REDIRECT4_OUT, headFilter(META_BOGUS_REDIRECT4));
assertEquals(META_BOGUS_REDIRECT1_OUT, headFilter(META_BOGUS_REDIRECT5));
assertEquals(META_BOGUS_REDIRECT_NO_URL, headFilter(META_BOGUS_REDIRECT6));
HTMLFilter.metaRefreshSamePageMinInterval = -1;
HTMLFilter.metaRefreshRedirectMinInterval = -1;
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_WRONG_CASE));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_TOO_SHORT));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_NEGATIVE));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_BADNUM1));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_TIME_ONLY_BADNUM2));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_VALID_REDIRECT));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_VALID_REDIRECT_NOSPACE));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT1));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT2));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT3));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT4));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT5));
assertEquals("" + HTMLFilter.m3uPlayerScriptTagContent(), headFilter(META_BOGUS_REDIRECT6));
assertEquals("", headFilter(META_TIME_ONLY));
assertEquals("", headFilter(META_TIME_ONLY_WRONG_CASE));
assertEquals("", headFilter(META_TIME_ONLY_TOO_SHORT));
assertEquals("", headFilter(META_TIME_ONLY_NEGATIVE));
assertEquals("", headFilter(META_TIME_ONLY_BADNUM1));
assertEquals("", headFilter(META_TIME_ONLY_BADNUM2));
assertEquals("", headFilter(META_VALID_REDIRECT));
assertEquals("", headFilter(META_VALID_REDIRECT_NOSPACE));
assertEquals("", headFilter(META_BOGUS_REDIRECT1));
assertEquals("", headFilter(META_BOGUS_REDIRECT2));
assertEquals("", headFilter(META_BOGUS_REDIRECT3));
assertEquals("", headFilter(META_BOGUS_REDIRECT4));
assertEquals("", headFilter(META_BOGUS_REDIRECT5));
assertEquals("", headFilter(META_BOGUS_REDIRECT6));
}

private String headFilter(String data) throws Exception {
Expand Down

0 comments on commit 5dcc512

Please sign in to comment.