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

Unified Diff: javatests/org/chromium/distiller/webdocument/DomConverterTest.java

Issue 1411603004: Discard hidden articles when using fast path (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: isVisibleByOffset() method improved. 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
Index: javatests/org/chromium/distiller/webdocument/DomConverterTest.java
diff --git a/javatests/org/chromium/distiller/webdocument/DomConverterTest.java b/javatests/org/chromium/distiller/webdocument/DomConverterTest.java
index 6d813cc87734f5d0e3b622a711a2c9fb72869e42..315a4de98a76631309322fd7b33df6723c37cb2f 100644
--- a/javatests/org/chromium/distiller/webdocument/DomConverterTest.java
+++ b/javatests/org/chromium/distiller/webdocument/DomConverterTest.java
@@ -38,10 +38,6 @@ public class DomConverterTest extends DomDistillerJsTestCase {
runTest("<div style=\"display:none\">diplay none</div>", "");
}
- public void testVisibilityHidden() throws Throwable {
- runTest("<div style=\"visibility:hidden\">visibility hidden</div>", "");
- }
-
public void testInvisibleInVisible() throws Throwable {
String html = "<div>visible parent" +
"<div style=\"display:none\">invisible child</div>" +
@@ -50,7 +46,7 @@ public class DomConverterTest extends DomDistillerJsTestCase {
}
public void testVisibleInInvisible() throws Throwable {
- String html = "<div style=\"visibility:hidden\">invisible parent" +
+ String html = "<div style=\"display:none\">invisible parent" +
wychen 2016/06/06 18:11:22 Why changing this file? These are necessary for th
marcelorcorrea 2016/06/06 19:21:59 Done.
"<div>visible child</div>" +
"</div>";
runTest(html, "");
@@ -64,7 +60,7 @@ public class DomConverterTest extends DomDistillerJsTestCase {
}
public void testInvisibleInInvisible() throws Throwable {
- String html = "<div style=\"visibility:hidden\">invisible parent" +
+ String html = "<div style=\"display:none\">invisible parent" +
"<div style=\"display:none\">invisible child</div>" +
"</div>";
runTest(html, "");
@@ -74,20 +70,20 @@ public class DomConverterTest extends DomDistillerJsTestCase {
String html = "<div>visible parent" +
"<div style=\"display:none\">invisible child0</div>" +
"<div>visible child1" +
- "<div style=\"visibility:hidden\">invisible grandchild</div>" +
+ "<div style=\"display:none\">invisible grandchild</div>" +
"</div>" +
- "<div style=\"visibility:hidden\">invisible child2</div>" +
+ "<div style=\"display:none\">invisible child2</div>" +
"</div>";
runTest(html, "<div>visible parent<div>visible child1</div></div>");
}
public void testDifferentChildrenInInvisible() throws Throwable {
- String html = "<div style=\"visibility:hidden\">invisible parent" +
+ String html = "<div style=\"display:none\">invisible parent" +
"<div style=\"display:none\">invisible child0</div>" +
"<div>visible child1" +
"<div style=\"display:none\">invisible grandchild</div>" +
"</div>" +
- "<div style=\"visibility:hidden\">invisible child2</div>" +
+ "<div style=\"display:none\">invisible child2</div>" +
"</div>";
runTest(html, "");
}
@@ -134,6 +130,7 @@ public class DomConverterTest extends DomDistillerJsTestCase {
public void testElementOrder() {
Element container = Document.get().createDivElement();
container.setInnerHTML("Text content <img src=\"http://example.com/1.jpg\"> more content");
+ mBody.appendChild(container);
wychen 2016/06/06 18:11:23 Good catch! How did you find this?
marcelorcorrea 2016/06/06 19:21:59 Actually, I copied from your CL. Sorry for changin
wychen 2016/06/06 21:11:27 lol. I totally forget this. Well, since we don't h
WebDocumentBuilder builder = new WebDocumentBuilder();
DomConverter converter = new DomConverter(builder);
@@ -156,6 +153,7 @@ public class DomConverterTest extends DomDistillerJsTestCase {
public void testList() throws Throwable {
Element container = Document.get().createDivElement();
container.setInnerHTML("<ol><li>some text1</li><li>some text2</li></ol>");
+ mBody.appendChild(container);
wychen 2016/06/06 21:11:27 ditto
WebDocumentBuilder builder = new WebDocumentBuilder();
DomConverter converter = new DomConverter(builder);

Powered by Google App Engine
This is Rietveld 408576698