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

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

Issue 2000093005: Support extraction of lazily-loaded images (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: fix comments 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
« no previous file with comments | « javatests/org/chromium/distiller/ContentExtractorTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: javatests/org/chromium/distiller/EmbedExtractorTest.java
diff --git a/javatests/org/chromium/distiller/EmbedExtractorTest.java b/javatests/org/chromium/distiller/EmbedExtractorTest.java
index 5c23f0c3f9a6cdc95632d8e29088d1050db5ce32..2b7a2f886cb30bff60a738b98bd8f9f571c9d97c 100644
--- a/javatests/org/chromium/distiller/EmbedExtractorTest.java
+++ b/javatests/org/chromium/distiller/EmbedExtractorTest.java
@@ -380,4 +380,24 @@ public class EmbedExtractorTest extends DomDistillerJsTestCase {
assertEquals(38, result.getHeight());
assertEquals(38, result.getWidth());
}
+
+ private void extractLazilyLoadedImage(String attr) {
+ ImageElement image = TestUtil.createImage();
+ image.setAttribute(attr, "image.png");
+ mBody.appendChild(image);
+
+ mHead.setInnerHTML("<base href=\"http://example.com/\">");
+
+ EmbedExtractor extractor = new ImageExtractor();
+ WebImage result = (WebImage) extractor.extract(image);
+ assertNotNull(result);
+ assertEquals("<img src=\"http://example.com/image.png\">", result.generateOutput(false));
+ }
+
+ public void testImageExtractorLazy() {
+ extractLazilyLoadedImage("data-src");
+ extractLazilyLoadedImage("datasrc");
+ extractLazilyLoadedImage("data-original");
+ extractLazilyLoadedImage("data-url");
+ }
}
« no previous file with comments | « javatests/org/chromium/distiller/ContentExtractorTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698