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

Unified Diff: javatests/org/chromium/distiller/webdocument/WebTagTest.java

Issue 1230583006: Fix for keeping lists structure (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: canBeNested move out of the switch. Created 5 years, 4 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/webdocument/WebTagTest.java
diff --git a/javatests/org/chromium/distiller/webdocument/WebTagTest.java b/javatests/org/chromium/distiller/webdocument/WebTagTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..9f1a959700bc769788c0ed75cc6b66688000df7d
--- /dev/null
+++ b/javatests/org/chromium/distiller/webdocument/WebTagTest.java
@@ -0,0 +1,40 @@
+package org.chromium.distiller.webdocument;
+
+import org.chromium.distiller.DomDistillerJsTestCase;
+
+public class WebTagTest extends DomDistillerJsTestCase {
+
+ public void testOLGenerateOutput() {
+ WebTag olStartWebTag = new WebTag("ol", WebTag.TagType.START);
+ WebTag olEndWebTag = new WebTag("ol", WebTag.TagType.END);
+ String startResult = olStartWebTag.generateOutput(false);
+ String endResult = olEndWebTag.generateOutput(false);
+ assertEquals(startResult, "<ol>");
+ assertEquals(endResult, "</ol>");
+ }
+
+ public void testULGenerateOutput() {
+ WebTag ulStartWebTag = new WebTag("ul", WebTag.TagType.START);
+ WebTag u = new WebTag("ul", WebTag.TagType.END);
+ String startResult = ulStartWebTag.generateOutput(false);
+ String endResult = u.generateOutput(false);
+ assertEquals(startResult, "<ul>");
+ assertEquals(endResult, "</ul>");
+ }
+
+ public void testLIGenerateOutput() {
+ WebTag liStartWebTag = new WebTag("li", WebTag.TagType.START);
+ WebTag liEndWebTag = new WebTag("li", WebTag.TagType.END);
+ String startResult = liStartWebTag.generateOutput(false);
+ String endResult = liEndWebTag.generateOutput(false);
+ assertEquals(startResult, "<li>");
+ assertEquals(endResult, "</li>");
+ }
+
+ public void testShouldGetInnerHTML() {
+ assertTrue(WebTag.canBeNested("LI"));
+ assertTrue(WebTag.canBeNested("UL"));
+ assertTrue(WebTag.canBeNested("OL"));
+ assertFalse(WebTag.canBeNested("SPAN"));
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698