1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
content / shell / android / javatests / src / org / chromium / content_shell_apk / ContentShellUrlTest.java [blame]
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.content_shell_apk;
import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
/** Example test that just starts the content shell. */
@RunWith(BaseJUnit4ClassRunner.class)
public class ContentShellUrlTest {
@Rule
public ContentShellActivityTestRule mActivityTestRule = new ContentShellActivityTestRule();
// URL used for base tests.
private static final String URL = "data:text";
@Test
@SmallTest
@Feature({"Main"})
@DisabledTest(message = "https://crbug.com/1371971")
public void testBaseStartup() {
ContentShellActivity activity = mActivityTestRule.launchContentShellWithUrl(URL);
// Make sure the activity was created as expected.
Assert.assertNotNull(activity);
// Make sure that the URL is set as expected.
Assert.assertEquals(
URL, activity.getActiveShell().getWebContents().getVisibleUrl().getSpec());
}
}