| 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));
|
| }
|
| }
|
|
|