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

Unified Diff: javatests/org/chromium/distiller/PageParameterDetectorTest.java

Issue 1029593003: implement validations of pagination URLs (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: addr chris's comments Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: javatests/org/chromium/distiller/PageParameterDetectorTest.java
diff --git a/javatests/org/chromium/distiller/PageParameterDetectorTest.java b/javatests/org/chromium/distiller/PageParameterDetectorTest.java
deleted file mode 100644
index e545ff07fe2080f52d36473c908b9628cac95525..0000000000000000000000000000000000000000
--- a/javatests/org/chromium/distiller/PageParameterDetectorTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.distiller;
-
-public class PageParameterDetectorTest extends DomDistillerJsTestCase {
-
- public void testIsLastNumericPathComponentBad() {
- // Path component is not numeric i.e. contains non-digits.
- String url = "http://www.foo.com/a2";
- int digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // Numeric path component is first.
- url = "http://www.foo.com/2";
- digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // Numeric path component follows a path component that is not a bad page param name.
- url = "http://www.foo.com/good/2";
- digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // Numeric path component follows a path component that is a bad page param name.
- url = "http://www.foo.com/wiki/2";
- digitStart = url.indexOf("2");
- assertTrue(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // (s)htm(l) extension doesn't follow digit.
- url = "http://www.foo.com/2a";
- digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // .htm follows digit, previous path component is not a bad page param name.
- url = "http://www.foo.com/good/2.htm";
- digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // .html follows digit, previous path component is a bad page param name.
- url = "http://www.foo.com/wiki/2.html";
- digitStart = url.indexOf("2");
- assertTrue(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
-
- // .shtml follows digit, previous path component is not a bad page param name, but the one
- // before that is.
- url = "http://www.foo.com/wiki/good/2.shtml";
- digitStart = url.indexOf("2");
- assertFalse(PageParameterDetector.isLastNumericPathComponentBad(url, 18, digitStart,
- digitStart + 1));
- }
-
-}
« no previous file with comments | « javatests/org/chromium/distiller/PageParamInfoTest.java ('k') | javatests/org/chromium/distiller/ParsedUrlTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698