Index: javatests/org/chromium/distiller/DomUtilTest.java |
diff --git a/javatests/org/chromium/distiller/DomUtilTest.java b/javatests/org/chromium/distiller/DomUtilTest.java |
index 85e61cf4e9b055646dd7d0e8aefed26230481181..295e2fe64092e4c5d9a660955807454fe9bdd3e0 100644 |
--- a/javatests/org/chromium/distiller/DomUtilTest.java |
+++ b/javatests/org/chromium/distiller/DomUtilTest.java |
@@ -9,6 +9,7 @@ import org.chromium.distiller.webdocument.WebTable; |
import com.google.gwt.core.client.JsArray; |
import com.google.gwt.dom.client.Document; |
import com.google.gwt.dom.client.Element; |
+import com.google.gwt.dom.client.ImageElement; |
import com.google.gwt.dom.client.Node; |
import com.google.gwt.dom.client.NodeList; |
@@ -273,6 +274,18 @@ public class DomUtilTest extends DomDistillerJsTestCase { |
assertEquals(expected, mBody.getInnerHTML()); |
} |
+ public void testGetSrcSetUrls() { |
+ String html = |
+ "<img src=\"http://example.com/image\" " + |
+ "srcset=\"http://example.com/image200 200w, http://example.com/image400 400w\">"; |
+ |
+ mBody.setInnerHTML(html); |
+ List<String> list = DomUtil.getSrcSetUrls((ImageElement) mBody.getChild(0)); |
+ assertEquals(2, list.size()); |
+ assertEquals("http://example.com/image200", list.get(0)); |
+ assertEquals("http://example.com/image400", list.get(1)); |
+ } |
+ |
public void testStripTableBackgroundColorAttributes() { |
String tableWithBGColorHTML = |
"<table bgcolor=\"red\">" + |