| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
| 6 | 6 |
| 7 import android.test.UiThreadTest; | 7 import android.test.UiThreadTest; |
| 8 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
| 9 | 9 |
| 10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.chrome.browser.ShortcutHelper; | 11 import org.chromium.chrome.browser.ShortcutHelper; |
| 12 import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel; | 12 import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel; |
| 13 import org.chromium.content_public.common.ScreenOrientationValues; | 13 import org.chromium.content_public.common.ScreenOrientationValues; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Tests whether the URL bar updates itself properly. | 16 * Tests whether the URL bar updates itself properly. |
| 17 */ | 17 */ |
| 18 public class WebappUrlBarTest extends WebappActivityTestBase { | 18 public class WebappUrlBarTest extends WebappActivityTestBase { |
| 19 private static final String WEBAPP_URL = "http://originalwebsite.com"; | 19 private static final String WEBAPP_URL = "http://originalwebsite.com"; |
| 20 private WebappUrlBar mUrlBar; | 20 private WebappUrlBar mUrlBar; |
| 21 | 21 |
| 22 @Override | 22 @Override |
| 23 protected void setUp() throws Exception { | 23 protected void setUp() throws Exception { |
| 24 super.setUp(); | 24 super.setUp(); |
| 25 | 25 |
| 26 WebappInfo mockInfo = WebappInfo.create(WEBAPP_ID, WEBAPP_URL, null, nul
l, | 26 WebappInfo mockInfo = WebappInfo.create(WEBAPP_ID, WEBAPP_URL, null, nul
l, null, |
| 27 ScreenOrientationValues.DEFAULT, ShortcutHelper.SOURCE_UNKNOWN); | 27 ScreenOrientationValues.DEFAULT, ShortcutHelper.SOURCE_UNKNOWN); |
| 28 getActivity().getWebappInfo().copy(mockInfo); | 28 getActivity().getWebappInfo().copy(mockInfo); |
| 29 mUrlBar = getActivity().getUrlBarForTests(); | 29 mUrlBar = getActivity().getUrlBarForTests(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 @UiThreadTest | 32 @UiThreadTest |
| 33 @MediumTest | 33 @MediumTest |
| 34 @Feature({"Webapps"}) | 34 @Feature({"Webapps"}) |
| 35 public void testUrlDisplay() { | 35 public void testUrlDisplay() { |
| 36 final String scheme = "somescheme://"; | 36 final String scheme = "somescheme://"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 if (iconResource == 0) { | 54 if (iconResource == 0) { |
| 55 assertEquals( | 55 assertEquals( |
| 56 urlExpectedWhenIconNotShown, mUrlBar.getDisplayedUrlForT
ests().toString()); | 56 urlExpectedWhenIconNotShown, mUrlBar.getDisplayedUrlForT
ests().toString()); |
| 57 } else { | 57 } else { |
| 58 assertEquals( | 58 assertEquals( |
| 59 urlExpectedWhenIconShown, mUrlBar.getDisplayedUrlForTest
s().toString()); | 59 urlExpectedWhenIconShown, mUrlBar.getDisplayedUrlForTest
s().toString()); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 } | 63 } |
| OLD | NEW |