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

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

Issue 1190343004: Process ordered list items as a single WebText (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Created 5 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 d248e6f8b7cf38b97e8de8847947d8a59116fd09..af89d826837a859fdc83d79e3ba0e5105bdff235 100644
--- a/javatests/org/chromium/distiller/ContentExtractorTest.java
+++ b/javatests/org/chromium/distiller/ContentExtractorTest.java
@@ -139,6 +139,26 @@ public class ContentExtractorTest extends DomDistillerJsTestCase {
TestUtil.removeAllDirAttributes(extractedContent));
}
+ public void testPreserveOrderedList() {
+ Element outerListTag = Document.get().createElement("OL");
+ mBody.appendChild(outerListTag);
+
+ outerListTag.appendChild(TestUtil.createListItem(CONTENT_TEXT));
+ outerListTag.appendChild(TestUtil.createListItem(CONTENT_TEXT));
+ outerListTag.appendChild(TestUtil.createListItem(CONTENT_TEXT));
+ outerListTag.appendChild(TestUtil.createListItem(CONTENT_TEXT));
+
+ ContentExtractor extractor = new ContentExtractor(mRoot);
+ String extractedContent = extractor.extractContent();
+ assertEquals("<ol>" +
+ "<li>" + CONTENT_TEXT + "</li>" +
+ "<li>" + CONTENT_TEXT + "</li>" +
+ "<li>" + CONTENT_TEXT + "</li>" +
+ "<li>" + CONTENT_TEXT + "</li>" +
+ "</ol>",
+ TestUtil.removeAllDirAttributes(extractedContent));
+ }
+
private void assertExtractor(String expected, String html) {
mBody.setInnerHTML("");
Element div = TestUtil.createDiv(0);
« no previous file with comments | « java/org/chromium/distiller/webdocument/ElementAction.java ('k') | javatests/org/chromium/distiller/TestUtil.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698