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

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

Issue 1793583002: Handle drop cap letters (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: add comments Created 4 years, 9 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/ElementAction.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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>"; 597 final String article = "<p>" + CONTENT_TEXT + "</p><p>" + CONTENT_TEXT + "</p>";
598 598
599 final String htmlArticle = 599 final String htmlArticle =
600 "<h1>" + CONTENT_TEXT + "</h1>" + 600 "<h1>" + CONTENT_TEXT + "</h1>" +
601 "<div itemscope itemtype=\"http://schema.org/Movie\">" + article + " </div>"; 601 "<div itemscope itemtype=\"http://schema.org/Movie\">" + article + " </div>";
602 final String expected = "<h1>" + CONTENT_TEXT + "</h1>" + article; 602 final String expected = "<h1>" + CONTENT_TEXT + "</h1>" + article;
603 603
604 // Non-article schema.org types should not use the fast path. 604 // Non-article schema.org types should not use the fast path.
605 assertExtractor(expected, htmlArticle); 605 assertExtractor(expected, htmlArticle);
606 } 606 }
607
608 public void testDropCap() {
609 String html =
610 "<h1>" +
611 CONTENT_TEXT +
612 "</h1>" +
613 "<p>" +
614 "<strong><span style=\"float: left\">T</span>est</strong>" +
615 CONTENT_TEXT +
616 "</p>";
617
618 final String expected =
619 "<h1>" +
620 CONTENT_TEXT +
621 "</h1>" +
622 "<p>" +
623 "<strong><span>T</span>est</strong>" +
624 CONTENT_TEXT +
625 "</p>";
626
627 mBody.setInnerHTML(html);
628
629 ContentExtractor extractor = new ContentExtractor(mRoot);
630 String extractedContent = extractor.extractContent();
631 assertEquals(expected,
632 TestUtil.removeAllDirAttributes(extractedContent));
633 }
607 } 634 }
OLDNEW
« no previous file with comments | « java/org/chromium/distiller/webdocument/ElementAction.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698