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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java

Issue 2711563003: Do not drop the final web app scope path component if it ends with a slash. (Closed)
Patch Set: Extra test for dir + fragment and query Created 3 years, 10 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java
index 5cb75eed1447feb9a26e7a4365007d3a0c1792f7..aaec6160b03bca3aa8f1ee7a872f29a41b1f5755 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java
@@ -6,11 +6,12 @@ package org.chromium.chrome.browser;
import static org.junit.Assert.assertEquals;
-import org.chromium.testing.local.LocalRobolectricTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
+import org.chromium.testing.local.LocalRobolectricTestRunner;
+
/**
* Unit tests for {@link org.chromium.chrome.browser.ShortcutHelper}.
*/
@@ -25,7 +26,7 @@ public class ShortcutHelperTest {
public void testGetScopeFromUrl() {
String url1 = "https://www.google.com";
String url2 = "https://www.google.com/";
- String url3 = "https://www.google.com/maps";
+ String url3 = "https://www.google.com/maps.htm";
String url4 = "https://www.google.com/maps/";
String url5 = "https://www.google.com/index.html";
String url6 = "https://www.google.com/index.html?q=maps";
@@ -35,22 +36,28 @@ public class ShortcutHelperTest {
String url10 = "https://www.google.com/maps/au/north/";
String url11 = "https://www.google.com/maps/au/index.html?q=maps#fragment/";
String url12 = "http://www.google.com:8000/maps/au/index.html?q=maps#fragment/";
+ String url13 = "https://www.google.com/maps/au/north/?q=maps#fragment";
+ String url14 = "https://www.google.com/maps/au/north?q=maps#fragment";
String url2_scope = "https://www.google.com/";
+ String url4_scope = "https://www.google.com/maps/";
String url8_scope = "https://www.google.com/maps/au/";
+ String url10_scope = "https://www.google.com/maps/au/north/";
String url12_scope = "http://www.google.com:8000/maps/au/";
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url1));
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url2));
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url3));
- assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url4));
+ assertEquals(url4_scope, ShortcutHelper.getScopeFromUrl(url4));
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url5));
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url6));
assertEquals(url2_scope, ShortcutHelper.getScopeFromUrl(url7));
assertEquals(url8_scope, ShortcutHelper.getScopeFromUrl(url8));
assertEquals(url8_scope, ShortcutHelper.getScopeFromUrl(url9));
- assertEquals(url8_scope, ShortcutHelper.getScopeFromUrl(url10));
+ assertEquals(url10_scope, ShortcutHelper.getScopeFromUrl(url10));
assertEquals(url8_scope, ShortcutHelper.getScopeFromUrl(url11));
assertEquals(url12_scope, ShortcutHelper.getScopeFromUrl(url12));
+ assertEquals(url10_scope, ShortcutHelper.getScopeFromUrl(url13));
+ assertEquals(url8_scope, ShortcutHelper.getScopeFromUrl(url14));
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698