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

Side by Side Diff: javatests/org/chromium/distiller/webdocument/WebTagTest.java

Issue 1513143006: Add <pre> to nesting tags (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: add test Created 5 years 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 unified diff | Download patch
« no previous file with comments | « javatests/org/chromium/distiller/ContentExtractorTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package org.chromium.distiller.webdocument; 1 package org.chromium.distiller.webdocument;
2 2
3 import org.chromium.distiller.DomDistillerJsTestCase; 3 import org.chromium.distiller.DomDistillerJsTestCase;
4 4
5 public class WebTagTest extends DomDistillerJsTestCase { 5 public class WebTagTest extends DomDistillerJsTestCase {
6 6
7 public void testOLGenerateOutput() { 7 public void testOLGenerateOutput() {
8 WebTag olStartWebTag = new WebTag("ol", WebTag.TagType.START); 8 WebTag olStartWebTag = new WebTag("ol", WebTag.TagType.START);
9 WebTag olEndWebTag = new WebTag("ol", WebTag.TagType.END); 9 WebTag olEndWebTag = new WebTag("ol", WebTag.TagType.END);
10 String startResult = olStartWebTag.generateOutput(false); 10 String startResult = olStartWebTag.generateOutput(false);
11 String endResult = olEndWebTag.generateOutput(false); 11 String endResult = olEndWebTag.generateOutput(false);
12 assertEquals(startResult, "<ol>"); 12 assertEquals(startResult, "<ol>");
13 assertEquals(endResult, "</ol>"); 13 assertEquals(endResult, "</ol>");
14 } 14 }
15 15
16 public void testULGenerateOutput() { 16 public void testGenerateOutput() {
17 WebTag ulStartWebTag = new WebTag("ul", WebTag.TagType.START); 17 WebTag startWebTag = new WebTag("anytext", WebTag.TagType.START);
18 WebTag ulEndWebTag = new WebTag("ul", WebTag.TagType.END); 18 WebTag endWebTag = new WebTag("anytext", WebTag.TagType.END);
19 String startResult = ulStartWebTag.generateOutput(false); 19 String startResult = startWebTag.generateOutput(false);
20 String endResult = ulEndWebTag.generateOutput(false); 20 String endResult = endWebTag.generateOutput(false);
21 assertEquals(startResult, "<ul>"); 21 assertEquals(startResult, "<anytext>");
22 assertEquals(endResult, "</ul>"); 22 assertEquals(endResult, "</anytext>");
23 }
24
25 public void testLIGenerateOutput() {
26 WebTag liStartWebTag = new WebTag("li", WebTag.TagType.START);
27 WebTag liEndWebTag = new WebTag("li", WebTag.TagType.END);
28 String startResult = liStartWebTag.generateOutput(false);
29 String endResult = liEndWebTag.generateOutput(false);
30 assertEquals(startResult, "<li>");
31 assertEquals(endResult, "</li>");
32 }
33
34 public void testBlockquoteGenerateOutput() {
35 WebTag blockquoteStartWebTag = new WebTag("blockquote",
36 WebTag.TagType.START);
37 WebTag blockquoteEndWebTag = new WebTag("blockquote",
38 WebTag.TagType.END);
39 String startResult = blockquoteStartWebTag.generateOutput(false);
40 String endResult = blockquoteEndWebTag.generateOutput(false);
41 assertEquals(startResult, "<blockquote>");
42 assertEquals(endResult, "</blockquote>");
43 } 23 }
44 24
45 public void testCanBeNested() { 25 public void testCanBeNested() {
46 assertTrue(WebTag.canBeNested("LI")); 26 assertTrue(WebTag.canBeNested("LI"));
47 assertTrue(WebTag.canBeNested("UL")); 27 assertTrue(WebTag.canBeNested("UL"));
48 assertTrue(WebTag.canBeNested("OL")); 28 assertTrue(WebTag.canBeNested("OL"));
49 assertTrue(WebTag.canBeNested("BLOCKQUOTE")); 29 assertTrue(WebTag.canBeNested("BLOCKQUOTE"));
30 assertTrue(WebTag.canBeNested("PRE"));
50 assertFalse(WebTag.canBeNested("SPAN")); 31 assertFalse(WebTag.canBeNested("SPAN"));
51 } 32 }
52 } 33 }
OLDNEW
« no previous file with comments | « javatests/org/chromium/distiller/ContentExtractorTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698