OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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; | 5 package org.chromium.distiller; |
6 | 6 |
7 import com.google.gwt.dom.client.Document; | 7 import com.google.gwt.dom.client.Document; |
8 import com.google.gwt.dom.client.Element; | 8 import com.google.gwt.dom.client.Element; |
9 | 9 |
10 public class ContentExtractorTest extends DomDistillerJsTestCase { | 10 public class ContentExtractorTest extends DomDistillerJsTestCase { |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 public void testSpanArticle() { | 625 public void testSpanArticle() { |
626 final String htmlArticle = | 626 final String htmlArticle = |
627 "<span>" + CONTENT_TEXT + "</span>" + | 627 "<span>" + CONTENT_TEXT + "</span>" + |
628 "<span>" + CONTENT_TEXT + "</span>" + | 628 "<span>" + CONTENT_TEXT + "</span>" + |
629 "<span>" + CONTENT_TEXT + "</span>"; | 629 "<span>" + CONTENT_TEXT + "</span>"; |
630 | 630 |
631 final String expected = "<div>" + htmlArticle + "</div>"; | 631 final String expected = "<div>" + htmlArticle + "</div>"; |
632 | 632 |
633 assertExtractor(expected, htmlArticle); | 633 assertExtractor(expected, htmlArticle); |
634 } | 634 } |
| 635 |
| 636 public void testUnwantedIFrame() { |
| 637 final String html = |
| 638 "<p>" + CONTENT_TEXT + "</p>" + |
| 639 "<iframe>dummy</iframe>" + |
| 640 "<p>" + CONTENT_TEXT + "</p>"; |
| 641 |
| 642 final String expected = |
| 643 "<p>" + CONTENT_TEXT + "</p>" + |
| 644 "<p>" + CONTENT_TEXT + "</p>"; |
| 645 |
| 646 assertExtractor(expected, html); |
| 647 } |
635 } | 648 } |
OLD | NEW |