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

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

Issue 2020403002: Add support for figure element (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: comments addressed 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/DomUtilTest.java
diff --git a/javatests/org/chromium/distiller/DomUtilTest.java b/javatests/org/chromium/distiller/DomUtilTest.java
index 2336b36e53689841d37b0fb6b6d956a2be6f20e8..989a5106e6e10edf2de16d3dc7c69d8227161752 100644
--- a/javatests/org/chromium/distiller/DomUtilTest.java
+++ b/javatests/org/chromium/distiller/DomUtilTest.java
@@ -401,4 +401,11 @@ public class DomUtilTest extends DomDistillerJsTestCase {
element = element.getFirstChildElement();
assertEquals(400*100, DomUtil.getArea(element));
}
+
+ public void testEscapeHTML() {
+ String html = "<a onmouseover=\"alert('1');\" href=\"http://site.com/a&b=1\">link</a>";
+ String expected = "&lt;a onmouseover=&quot;alert(&#039;1&#039;);&quot; " +
+ "href=&quot;http:&#x2F;&#x2F;site.com&#x2F;a&amp;b=1&quot;&gt;link&lt;&#x2F;a&gt;";
+ assertEquals(expected, DomUtil.escapeHTML(html));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698