Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: javatests/org/chromium/distiller/ContentExtractorTest.java

Issue 1411603004: Discard hidden articles when using fast path (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: nitpick 3 fixed Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: javatests/org/chromium/distiller/ContentExtractorTest.java
diff --git a/javatests/org/chromium/distiller/ContentExtractorTest.java b/javatests/org/chromium/distiller/ContentExtractorTest.java
index ddc97e36b9072a38ca28aa014991bd2041888f3d..f3af7e5c6840dd6e4d84dad3ce9bcb4c129d5438 100644
--- a/javatests/org/chromium/distiller/ContentExtractorTest.java
+++ b/javatests/org/chromium/distiller/ContentExtractorTest.java
@@ -556,91 +556,6 @@ public class ContentExtractorTest extends DomDistillerJsTestCase {
assertEquals(expected, TestUtil.removeAllDirAttributes(extractedContent));
}
- public void testOnlyProcessArticleElement() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String html = "<h1>" + CONTENT_TEXT + "</h1><div>" + article + "</div>";
- final String expected = "<h1>" + CONTENT_TEXT + "</h1>" + article;
-
- // Make sure everything is there before using the fast path.
- assertExtractor(expected, html);
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<article>" + article + "</article>";
-
- assertExtractor(article, htmlArticle);
- }
-
- public void testOnlyProcessArticleElementMultiple() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<article>" + article + "</article>" +
- "<article>" + article + "</article>";
- final String expected = "<h1>" + CONTENT_TEXT + "</h1>" + article + article;
-
- // The existence of multiple articles disables the fast path.
- assertExtractor(expected, htmlArticle);
- }
-
- public void testOnlyProcessOGArticle() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<div itemscope itemtype=\"http://schema.org/Article\">" + article + "</div>";
-
- assertExtractor(article, htmlArticle);
- }
-
- public void testOnlyProcessOGArticleNews() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<div itemscope itemtype=\"http://schema.org/NewsArticle\">" + article + "</div>";
-
- assertExtractor(article, htmlArticle);
- }
-
- public void testOnlyProcessOGArticleBlog() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<div itemscope itemtype=\"http://schema.org/BlogPosting\">" + article + "</div>";
-
- assertExtractor(article, htmlArticle);
- }
-
- public void testOnlyProcessOGArticleNested() {
- final String paragraph = "<p>" + CONTENT_TEXT + "</p>";
- final String article = paragraph + paragraph;
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<div itemscope itemtype=\"http://schema.org/Article\">" +
- paragraph +
- "<div itemscope itemtype=\"http://schema.org/Article\">" + paragraph + "</div>" +
- "</div>";
-
- assertExtractor(article, htmlArticle);
- }
-
- public void testOnlyProcessOGNonArticleMovie() {
- final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
-
- final String htmlArticle =
- "<h1>" + CONTENT_TEXT + "</h1>" +
- "<div itemscope itemtype=\"http://schema.org/Movie\">" + article + "</div>";
- final String expected = "<h1>" + CONTENT_TEXT + "</h1>" + article;
-
- // Non-article schema.org types should not use the fast path.
- assertExtractor(expected, htmlArticle);
- }
-
public void testDropCap() {
String html =
"<h1>" +

Powered by Google App Engine
This is Rietveld 408576698