Commit ba683d98 authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Remove EmbeddedTestServer in StartSurfaceTest

After simplifying the tests, there's no need to use EmbeddedTestServer
in StartSurfaceTest anymore.

Bug: None
Change-Id: Id9898777ba8a423439bfb2168293d8fe2a980a29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2206335
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770965}
parent 6488736e
...@@ -83,7 +83,6 @@ import org.chromium.chrome.test.util.browser.Features.EnableFeatures; ...@@ -83,7 +83,6 @@ import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.content_public.browser.test.util.TouchCommon; import org.chromium.content_public.browser.test.util.TouchCommon;
import org.chromium.net.test.EmbeddedTestServer;
import org.chromium.ui.test.util.UiRestriction; import org.chromium.ui.test.util.UiRestriction;
import java.io.IOException; import java.io.IOException;
...@@ -124,7 +123,6 @@ public class StartSurfaceTest { ...@@ -124,7 +123,6 @@ public class StartSurfaceTest {
public TestRule mProcessor = new Features.InstrumentationProcessor(); public TestRule mProcessor = new Features.InstrumentationProcessor();
private final boolean mImmediateReturn; private final boolean mImmediateReturn;
private String mUrl;
public StartSurfaceTest(boolean useInstantStart, boolean immediateReturn) { public StartSurfaceTest(boolean useInstantStart, boolean immediateReturn) {
CachedFeatureFlags.setForTesting(ChromeFeatureList.INSTANT_START, useInstantStart); CachedFeatureFlags.setForTesting(ChromeFeatureList.INSTANT_START, useInstantStart);
...@@ -150,11 +148,6 @@ public class StartSurfaceTest { ...@@ -150,11 +148,6 @@ public class StartSurfaceTest {
@Before @Before
public void setUp() throws IOException { public void setUp() throws IOException {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
mUrl = testServer.getURL("/chrome/test/data/android/navigate/simple.html");
// Scrolling tests need more tabs. // Scrolling tests need more tabs.
String scrollMode = StartSurfaceConfiguration.START_SURFACE_OMNIBOX_SCROLL_MODE.getValue(); String scrollMode = StartSurfaceConfiguration.START_SURFACE_OMNIBOX_SCROLL_MODE.getValue();
int expectedTabs = scrollMode.isEmpty() ? 1 : 16; int expectedTabs = scrollMode.isEmpty() ? 1 : 16;
...@@ -617,7 +610,7 @@ public class StartSurfaceTest { ...@@ -617,7 +610,7 @@ public class StartSurfaceTest {
OverviewModeBehaviorWatcher hideWatcher = OverviewModeBehaviorWatcher hideWatcher =
TabUiTestHelper.createOverviewHideWatcher(mActivityTestRule.getActivity()); TabUiTestHelper.createOverviewHideWatcher(mActivityTestRule.getActivity());
onView(withId(R.id.search_box_text)).perform(replaceText(mUrl)); onView(withId(R.id.search_box_text)).perform(replaceText("about:blank"));
onView(withId(R.id.url_bar)).perform(pressKey(KeyEvent.KEYCODE_ENTER)); onView(withId(R.id.url_bar)).perform(pressKey(KeyEvent.KEYCODE_ENTER));
hideWatcher.waitForBehavior(); hideWatcher.waitForBehavior();
assertThat( assertThat(
...@@ -650,7 +643,8 @@ public class StartSurfaceTest { ...@@ -650,7 +643,8 @@ public class StartSurfaceTest {
OverviewModeBehaviorWatcher hideWatcher = OverviewModeBehaviorWatcher hideWatcher =
TabUiTestHelper.createOverviewHideWatcher(mActivityTestRule.getActivity()); TabUiTestHelper.createOverviewHideWatcher(mActivityTestRule.getActivity());
onView(allOf(withId(R.id.search_box_text), isDisplayed())).perform(replaceText(mUrl)); onView(allOf(withId(R.id.search_box_text), isDisplayed()))
.perform(replaceText("about:blank"));
onView(withId(R.id.url_bar)).perform(pressKey(KeyEvent.KEYCODE_ENTER)); onView(withId(R.id.url_bar)).perform(pressKey(KeyEvent.KEYCODE_ENTER));
hideWatcher.waitForBehavior(); hideWatcher.waitForBehavior();
assertThat( assertThat(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment