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

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

Issue 2401853004: Strip unwanted classNames from all nodes (Closed)
Patch Set: address comments Created 4 years, 2 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
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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 "<p>" + CONTENT_TEXT + "</p>" + 644 "<p>" + CONTENT_TEXT + "</p>" +
645 "<iframe>dummy</iframe>" + 645 "<iframe>dummy</iframe>" +
646 "<p>" + CONTENT_TEXT + "</p>"; 646 "<p>" + CONTENT_TEXT + "</p>";
647 647
648 final String expected = 648 final String expected =
649 "<p>" + CONTENT_TEXT + "</p>" + 649 "<p>" + CONTENT_TEXT + "</p>" +
650 "<p>" + CONTENT_TEXT + "</p>"; 650 "<p>" + CONTENT_TEXT + "</p>";
651 651
652 assertExtractor(expected, html); 652 assertExtractor(expected, html);
653 } 653 }
654
655 public void testStripUnwantedClassNames() {
656 final String html =
657 "<p class=\"test\">" + CONTENT_TEXT + "</p>" +
658 "<p class=\"iscaption\">" + CONTENT_TEXT + "</p>";
659
660 final String expected =
661 "<p>" + CONTENT_TEXT + "</p>" +
662 "<p class=\"caption\">" + CONTENT_TEXT + "</p>";
663
664 assertExtractor(expected, html);
665 }
654 } 666 }
OLDNEW
« no previous file with comments | « java/org/chromium/distiller/webdocument/WebText.java ('k') | javatests/org/chromium/distiller/DomUtilTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698