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

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: wychen's comments addressed Created 5 years, 1 month 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 0b03d6a9dd95b2177f5233aaa61e93beb6229ef7..478c7bc5f837a5eebb1456d31afe5b9d9fe60058 100644
--- a/javatests/org/chromium/distiller/ContentExtractorTest.java
+++ b/javatests/org/chromium/distiller/ContentExtractorTest.java
@@ -495,89 +495,4 @@ public class ContentExtractorTest extends DomDistillerJsTestCase {
String extractedContent = extractor.extractContent();
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);
- }
}

Powered by Google App Engine
This is Rietveld 408576698