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

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

Issue 2203563002: Extract image URLs in srcset as well (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: format Created 4 years, 4 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
« no previous file with comments | « javatests/org/chromium/distiller/DomUtilTest.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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.distiller.webdocument;
6
7 import org.chromium.distiller.DomDistillerJsTestCase;
8
9 import java.util.List;
10
11 import com.google.gwt.dom.client.Document;
12 import com.google.gwt.dom.client.ImageElement;
13
14 public class WebImageTest extends DomDistillerJsTestCase {
15 public void testGetSrcList() {
16 ImageElement img = Document.get().createImageElement();
17 img.setSrc("http://example.com/image");
18 img.setAttribute("srcset",
19 "http://example.com/image200 200w, http://example.com/image400 4 00w");
20 WebImage wi = new WebImage(img, 1, 1, img.getSrc());
21 List<String> urls = wi.getUrlList();
22 assertEquals(3, urls.size());
23 assertEquals("http://example.com/image", urls.get(0));
24 assertEquals("http://example.com/image200", urls.get(1));
25 assertEquals("http://example.com/image400", urls.get(2));
26 }
27 }
OLDNEW
« no previous file with comments | « javatests/org/chromium/distiller/DomUtilTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698