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

Side by Side Diff: javatests/org/chromium/distiller/ContentExtractorTest.java

Issue 2288143003: Ignore exceptions in embed extractors (Closed) Base URL: git@github.com:chromium/dom-distiller.git@noiframe
Patch Set: line wrapping Created 4 years, 3 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 | « java/org/chromium/distiller/webdocument/DomConverter.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
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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 "<p><em>" + CONTENT_TEXT + "</em></p>" + 615 "<p><em>" + CONTENT_TEXT + "</em></p>" +
616 "<div><cite><span><span>" + CONTENT_TEXT + "</span></span></cite></d iv>" + 616 "<div><cite><span><span>" + CONTENT_TEXT + "</span></span></cite></d iv>" +
617 "<div><span>" + CONTENT_TEXT + "</span><span>" + CONTENT_TEXT + "</s pan></div>" + 617 "<div><span>" + CONTENT_TEXT + "</span><span>" + CONTENT_TEXT + "</s pan></div>" +
618 "<BLOCKQUOTE><cite>" + 618 "<BLOCKQUOTE><cite>" +
619 "<span><span>" + CONTENT_TEXT + "</span></span><span>" + CONTENT _TEXT + "</span>" + 619 "<span><span>" + CONTENT_TEXT + "</span></span><span>" + CONTENT _TEXT + "</span>" +
620 "</cite></BLOCKQUOTE>"; 620 "</cite></BLOCKQUOTE>";
621 621
622 assertExtractor(expected, htmlArticle); 622 assertExtractor(expected, htmlArticle);
623 } 623 }
624 624
625 public void testSandboxedIFrame() {
626 final String html ="<iframe sandbox></iframe>";
627
628 assertExtractor("", html);
629 }
630
625 public void testSpanArticle() { 631 public void testSpanArticle() {
626 final String htmlArticle = 632 final String htmlArticle =
627 "<span>" + CONTENT_TEXT + "</span>" + 633 "<span>" + CONTENT_TEXT + "</span>" +
628 "<span>" + CONTENT_TEXT + "</span>" + 634 "<span>" + CONTENT_TEXT + "</span>" +
629 "<span>" + CONTENT_TEXT + "</span>"; 635 "<span>" + CONTENT_TEXT + "</span>";
630 636
631 final String expected = "<div>" + htmlArticle + "</div>"; 637 final String expected = "<div>" + htmlArticle + "</div>";
632 638
633 assertExtractor(expected, htmlArticle); 639 assertExtractor(expected, htmlArticle);
634 } 640 }
635 641
636 public void testUnwantedIFrame() { 642 public void testUnwantedIFrame() {
637 final String html = 643 final String html =
638 "<p>" + CONTENT_TEXT + "</p>" + 644 "<p>" + CONTENT_TEXT + "</p>" +
639 "<iframe>dummy</iframe>" + 645 "<iframe>dummy</iframe>" +
640 "<p>" + CONTENT_TEXT + "</p>"; 646 "<p>" + CONTENT_TEXT + "</p>";
641 647
642 final String expected = 648 final String expected =
643 "<p>" + CONTENT_TEXT + "</p>" + 649 "<p>" + CONTENT_TEXT + "</p>" +
644 "<p>" + CONTENT_TEXT + "</p>"; 650 "<p>" + CONTENT_TEXT + "</p>";
645 651
646 assertExtractor(expected, html); 652 assertExtractor(expected, html);
647 } 653 }
648 } 654 }
OLDNEW
« no previous file with comments | « java/org/chromium/distiller/webdocument/DomConverter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698