OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.content_shell_apk; | 5 package org.chromium.content_shell_apk; |
6 | 6 |
7 import android.support.test.filters.SmallTest; | 7 import android.support.test.filters.SmallTest; |
8 | 8 |
| 9 import org.junit.Assert; |
| 10 import org.junit.Rule; |
| 11 import org.junit.Test; |
| 12 import org.junit.runner.RunWith; |
| 13 |
| 14 import org.chromium.base.test.BaseJUnit4ClassRunner; |
9 import org.chromium.base.test.util.Feature; | 15 import org.chromium.base.test.util.Feature; |
10 | 16 |
11 /** | 17 /** |
12 * Example test that just starts the content shell. | 18 * Example test that just starts the content shell. |
13 */ | 19 */ |
14 public class ContentShellUrlTest extends ContentShellTestBase { | 20 @RunWith(BaseJUnit4ClassRunner.class) |
| 21 public class ContentShellUrlTest { |
| 22 @Rule |
| 23 public ContentShellActivityTestRule mActivityTestRule = new ContentShellActi
vityTestRule(); |
| 24 |
15 // URL used for base tests. | 25 // URL used for base tests. |
16 private static final String URL = "data:text"; | 26 private static final String URL = "data:text"; |
17 | 27 |
| 28 @Test |
18 @SmallTest | 29 @SmallTest |
19 @Feature({"Main"}) | 30 @Feature({"Main"}) |
20 public void testBaseStartup() throws Exception { | 31 public void testBaseStartup() throws Exception { |
21 ContentShellActivity activity = launchContentShellWithUrl(URL); | 32 ContentShellActivity activity = mActivityTestRule.launchContentShellWith
Url(URL); |
22 | 33 |
23 // Make sure the activity was created as expected. | 34 // Make sure the activity was created as expected. |
24 assertNotNull(activity); | 35 Assert.assertNotNull(activity); |
25 | 36 |
26 // Make sure that the URL is set as expected. | 37 // Make sure that the URL is set as expected. |
27 assertEquals(URL, activity.getActiveShell().getContentViewCore().getWebC
ontents().getUrl()); | 38 Assert.assertEquals( |
| 39 URL, activity.getActiveShell().getContentViewCore().getWebConten
ts().getUrl()); |
28 } | 40 } |
29 } | 41 } |
OLD | NEW |