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

[Instant Start] Use assumeTrue() to skip invalid parameters in tests

Bug: 1082664
Change-Id: I11df4fcd668a517d160c9bbe29656f92e312cfaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2205001
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770966}
parent ba683d98
...@@ -28,6 +28,7 @@ import static org.junit.Assert.assertEquals; ...@@ -28,6 +28,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil.TAB_SWITCHER_ON_RETURN_MS; import static org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil.TAB_SWITCHER_ON_RETURN_MS;
import static org.chromium.chrome.features.start_surface.InstantStartTest.createThumbnailBitmapAndWriteToFile; import static org.chromium.chrome.features.start_surface.InstantStartTest.createThumbnailBitmapAndWriteToFile;
...@@ -772,10 +773,9 @@ public class StartSurfaceTest { ...@@ -772,10 +773,9 @@ public class StartSurfaceTest {
"/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/top"}) "/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/top"})
public void testScroll_OmniboxOnly_Top() { public void testScroll_OmniboxOnly_Top() {
// clang-format on // clang-format on
if (!mImmediateReturn) { // TODO(crbug.com/1082664): Make it work with NoReturn.
// TODO(crbug.com/1082664): Make it work with NoReturn. assumeTrue(mImmediateReturn);
return;
}
onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed())); onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed()));
onView(withId(R.id.search_box)).check(matches(isDisplayed())); onView(withId(R.id.search_box)).check(matches(isDisplayed()));
...@@ -796,10 +796,9 @@ public class StartSurfaceTest { ...@@ -796,10 +796,9 @@ public class StartSurfaceTest {
"/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/quick"}) "/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/quick"})
public void testScroll_OmniboxOnly_Quick() { public void testScroll_OmniboxOnly_Quick() {
// clang-format on // clang-format on
if (!mImmediateReturn) { // TODO(crbug.com/1082664): Make it work with NoReturn.
// TODO(crbug.com/1082664): Make it work with NoReturn. assumeTrue(mImmediateReturn);
return;
}
onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed())); onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed()));
onView(withId(R.id.search_box)).check(matches(isDisplayed())); onView(withId(R.id.search_box)).check(matches(isDisplayed()));
...@@ -820,10 +819,9 @@ public class StartSurfaceTest { ...@@ -820,10 +819,9 @@ public class StartSurfaceTest {
"/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/pinned"}) "/hide_switch_when_no_incognito_tabs/true/omnibox_scroll_mode/pinned"})
public void testScroll_OmniboxOnly_Pinned() { public void testScroll_OmniboxOnly_Pinned() {
// clang-format on // clang-format on
if (!mImmediateReturn) { // TODO(crbug.com/1082664): Make it work with NoReturn.
// TODO(crbug.com/1082664): Make it work with NoReturn. assumeTrue(mImmediateReturn);
return;
}
onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed())); onViewWaiting(allOf(withId(R.id.primary_tasks_surface_view), isDisplayed()));
onView(withId(R.id.search_box)).check(matches(isDisplayed())); onView(withId(R.id.search_box)).check(matches(isDisplayed()));
......
...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.tasks; ...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.tasks;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeTrue;
import static org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil.TAB_SWITCHER_ON_RETURN_MS_PARAM; import static org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil.TAB_SWITCHER_ON_RETURN_MS_PARAM;
...@@ -457,7 +458,7 @@ public class ReturnToChromeTest { ...@@ -457,7 +458,7 @@ public class ReturnToChromeTest {
public void testInitialScrollIndex() throws Exception { public void testInitialScrollIndex() throws Exception {
// clang-format on // clang-format on
// Instant start is not applicable since we need to create tabs and restart. // Instant start is not applicable since we need to create tabs and restart.
if (mUseInstantStart) return; assumeTrue(!mUseInstantStart);
EmbeddedTestServer testServer = EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
......
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