OLD | NEW |
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 Loading... |
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 = "<a onmouseover="alert('1');" "
+ |
| 408 "href="http://site.com/a&b=1">li
nk</a>"; |
| 409 assertEquals(expected, DomUtil.escapeHTML(html)); |
| 410 } |
404 } | 411 } |
OLD | NEW |