OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.webdocument.filters; | 5 package org.chromium.distiller.webdocument.filters; |
6 | 6 |
7 import org.chromium.distiller.DomDistillerJsTestCase; | 7 import org.chromium.distiller.DomDistillerJsTestCase; |
8 import org.chromium.distiller.webdocument.TestWebTextBuilder; | |
9 import org.chromium.distiller.webdocument.TestWebDocumentBuilder; | 8 import org.chromium.distiller.webdocument.TestWebDocumentBuilder; |
10 import org.chromium.distiller.webdocument.WebDocument; | 9 import org.chromium.distiller.webdocument.WebDocument; |
11 import org.chromium.distiller.webdocument.WebElement; | 10 import org.chromium.distiller.webdocument.WebElement; |
12 import org.chromium.distiller.webdocument.WebImage; | 11 import org.chromium.distiller.webdocument.WebImage; |
13 import org.chromium.distiller.webdocument.WebText; | |
14 import org.chromium.distiller.webdocument.WebTable; | 12 import org.chromium.distiller.webdocument.WebTable; |
15 | 13 |
16 | 14 |
17 public class RelevantElementsTest extends DomDistillerJsTestCase { | 15 public class RelevantElementsTest extends DomDistillerJsTestCase { |
18 public void testEmptyDocument() { | 16 public void testEmptyDocument() { |
19 WebDocument document = new WebDocument(); | 17 WebDocument document = new WebDocument(); |
20 assertFalse(RelevantElements.process(document)); | 18 assertFalse(RelevantElements.process(document)); |
21 assertTrue(document.getElements().isEmpty()); | 19 assertTrue(document.getElements().isEmpty()); |
22 } | 20 } |
23 | 21 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 public void testImageAfterNonContent() { | 71 public void testImageAfterNonContent() { |
74 TestWebDocumentBuilder builder = new TestWebDocumentBuilder(); | 72 TestWebDocumentBuilder builder = new TestWebDocumentBuilder(); |
75 builder.addText("text 1").setIsContent(true); | 73 builder.addText("text 1").setIsContent(true); |
76 builder.addText("text 2").setIsContent(false); | 74 builder.addText("text 2").setIsContent(false); |
77 WebImage wi = builder.addImage(); | 75 WebImage wi = builder.addImage(); |
78 WebDocument document = builder.build(); | 76 WebDocument document = builder.build(); |
79 assertFalse(RelevantElements.process(document)); | 77 assertFalse(RelevantElements.process(document)); |
80 assertFalse(wi.getIsContent()); | 78 assertFalse(wi.getIsContent()); |
81 } | 79 } |
82 } | 80 } |
OLD | NEW |