Index: test/com/dom_distiller/client/PagingLinksFinderTest.java |
diff --git a/test/com/dom_distiller/client/PagingLinksFinderTest.java b/test/com/dom_distiller/client/PagingLinksFinderTest.java |
index b98c40e049a12714c596edb500577da734a1516e..79f0dfcec2f0b3424d53078c646a6b91f0472a80 100644 |
--- a/test/com/dom_distiller/client/PagingLinksFinderTest.java |
+++ b/test/com/dom_distiller/client/PagingLinksFinderTest.java |
@@ -11,8 +11,8 @@ import com.google.gwt.user.client.Window; |
public class PagingLinksFinderTest extends DomDistillerTestCase { |
public void testNoLink() { |
Element root = TestUtil.createDiv(0); |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
- assertEquals(null, PagingLinksFinder.findPrevious(root)); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
+ assertEquals(null, PagingLinksFinder.findPrevious(root, "")); |
} |
public void test1NextLink() { |
@@ -20,8 +20,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
AnchorElement anchor = TestUtil.createAnchor("next", "next page"); |
root.appendChild(anchor); |
- assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root)); |
- assertEquals(null, PagingLinksFinder.findPrevious(root)); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root, "")); |
+ assertEquals(null, PagingLinksFinder.findPrevious(root, "")); |
} |
public void test1NextLinkWithDifferentDomain() { |
@@ -29,8 +29,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
AnchorElement anchor = TestUtil.createAnchor("http://testing.com/next", "next page"); |
root.appendChild(anchor); |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
- assertEquals(null, PagingLinksFinder.findPrevious(root)); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
+ assertEquals(null, PagingLinksFinder.findPrevious(root, "")); |
} |
public void test1PageNumberedLink() { |
@@ -43,8 +43,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
// The word "page" in the link text increases its score confidently enough to be considered |
// as a paging link. |
- assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root)); |
- assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root)); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root, "")); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root, "")); |
} |
public void test3NumberedLinks() { |
@@ -63,8 +63,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
// Because link text contains only digits with no paging-related words, no link has a score |
// high enough to be confidently considered paging link. |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
- assertEquals(null, PagingLinksFinder.findPrevious(root)); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
+ assertEquals(null, PagingLinksFinder.findPrevious(root, "")); |
} |
public void test2NextLinksWithSameHref() { |
@@ -80,8 +80,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
// anchor1 by itself is not a confident next page link, but anchor2's link text helps bump |
// up the score for the shared href, so anchor1 is now a confident next page link. |
- assertEquals(anchor1.getHref(), PagingLinksFinder.findNext(root)); |
- assertEquals(null, PagingLinksFinder.findPrevious(root)); |
+ assertEquals(anchor1.getHref(), PagingLinksFinder.findNext(root, "")); |
+ assertEquals(null, PagingLinksFinder.findPrevious(root, "")); |
} |
public void testPagingParent() { |
@@ -98,16 +98,16 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
// While it may seem strange that both previous and next links are the same, this test is |
// testing that the anchor's parents will affect its paging score even if it has a |
// meaningless link text like "dummy link". |
- assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root)); |
- assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root)); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root, "")); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findNext(root, "")); |
} |
public void test1PrevLink() { |
Element root = TestUtil.createDiv(0); |
AnchorElement anchor = TestUtil.createAnchor("prev", "prev page"); |
root.appendChild(anchor); |
- assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root)); |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root, "")); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
} |
public void test1PrevAnd1NextLinks() { |
@@ -117,8 +117,8 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
root.appendChild(prevAnchor); |
root.appendChild(nextAnchor); |
- assertEquals(prevAnchor.getHref(), PagingLinksFinder.findPrevious(root)); |
- assertEquals(nextAnchor.getHref(), PagingLinksFinder.findNext(root)); |
+ assertEquals(prevAnchor.getHref(), PagingLinksFinder.findPrevious(root, "")); |
+ assertEquals(nextAnchor.getHref(), PagingLinksFinder.findNext(root, "")); |
} |
public void testFirstPageLinkAsBaseUrl() { |
@@ -138,7 +138,7 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
AnchorElement anchor = TestUtil.createAnchor(href, "PREV"); |
root.appendChild(anchor); |
- assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root)); |
+ assertEquals(anchor.getHref(), PagingLinksFinder.findPrevious(root, "")); |
} |
public void testNonHttpOrHttpsLink() { |
@@ -146,10 +146,10 @@ public class PagingLinksFinderTest extends DomDistillerTestCase { |
AnchorElement anchor = TestUtil.createAnchor("javascript:void(0)", |
"NEXT"); |
root.appendChild(anchor); |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
anchor.setHref("file://test.html"); |
- assertEquals(null, PagingLinksFinder.findNext(root)); |
+ assertEquals(null, PagingLinksFinder.findNext(root, "")); |
} |
cjhopman
2014/10/24 22:13:47
Can we add a simple test that uses a non-empty ori
kuan
2014/10/24 23:07:11
Done. i forgot :(
|
} |