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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.distiller; 5 package org.chromium.distiller;
6 6
7 import org.chromium.distiller.webdocument.WebTable; 7 import org.chromium.distiller.webdocument.WebTable;
8 8
9 import com.google.gwt.core.client.JsArray; 9 import com.google.gwt.core.client.JsArray;
10 import com.google.gwt.dom.client.Document; 10 import com.google.gwt.dom.client.Document;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 element = element.getNextSiblingElement(); 395 element = element.getNextSiblingElement();
396 assertEquals(300*200, DomUtil.getArea(element)); 396 assertEquals(300*200, DomUtil.getArea(element));
397 397
398 element = element.getNextSiblingElement(); 398 element = element.getNextSiblingElement();
399 assertEquals(400*100, DomUtil.getArea(element)); 399 assertEquals(400*100, DomUtil.getArea(element));
400 400
401 element = element.getFirstChildElement(); 401 element = element.getFirstChildElement();
402 assertEquals(400*100, DomUtil.getArea(element)); 402 assertEquals(400*100, DomUtil.getArea(element));
403 } 403 }
404
405 public void testEscapeHTML() {
406 String html = "<a onmouseover=\"alert('1');\" href=\"http://site.com/a&b =1\">link</a>";
407 String expected = "&lt;a onmouseover=&quot;alert(&#039;1&#039;);&quot; " +
408 "href=&quot;http:&#x2F;&#x2F;site.com&#x2F;a&amp;b=1&quot;&gt;li nk&lt;&#x2F;a&gt;";
409 assertEquals(expected, DomUtil.escapeHTML(html));
410 }
404 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698