Commit 87f9dd76 authored by Arthur Wang's avatar Arthur Wang Committed by Commit Bot

Change to use feed.R for feed_stream_recycler_view.

R=harringtond@chromium.org

Bug: 1060399
Change-Id: Iff4a8b59a3f7ac1ec79a8adb9d16877a3fbbcbae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252460Reviewed-by: default avatarDan H <harringtond@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779976}
parent 13d9315f
...@@ -6,9 +6,6 @@ import static androidx.test.espresso.Espresso.onView; ...@@ -6,9 +6,6 @@ import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static org.hamcrest.Matchers.instanceOf;
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.espresso.contrib.RecyclerViewActions; import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.filters.MediumTest; import androidx.test.filters.MediumTest;
...@@ -19,10 +16,10 @@ import org.junit.runner.RunWith; ...@@ -19,10 +16,10 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.feed.R;
import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.util.ChromeRenderTestRule; import org.chromium.chrome.test.util.ChromeRenderTestRule;
import org.chromium.chrome.test.util.NewTabPageTestUtils; import org.chromium.chrome.test.util.NewTabPageTestUtils;
...@@ -64,7 +61,8 @@ public final class FeedNewTabPageCardInstrumentationTest { ...@@ -64,7 +61,8 @@ public final class FeedNewTabPageCardInstrumentationTest {
NewTabPageTestUtils.waitForNtpLoaded(mActivityTestRule.getActivity().getActivityTab()); NewTabPageTestUtils.waitForNtpLoaded(mActivityTestRule.getActivity().getActivityTab());
// scroll to "More" button // scroll to "More" button
onView(instanceOf(RecyclerView.class)).perform(RecyclerViewActions.scrollToPosition(3)); onView(withId(R.id.feed_stream_recycler_view))
.perform(RecyclerViewActions.scrollToPosition(3));
// Click "More" button // Click "More" button
onView(withId(R.id.action_button)).perform(click()); onView(withId(R.id.action_button)).perform(click());
...@@ -72,10 +70,12 @@ public final class FeedNewTabPageCardInstrumentationTest { ...@@ -72,10 +70,12 @@ public final class FeedNewTabPageCardInstrumentationTest {
Thread.sleep(2000); Thread.sleep(2000);
// Scroll to position 5 to trigger a network resource load for the cards // Scroll to position 5 to trigger a network resource load for the cards
onView(instanceOf(RecyclerView.class)).perform(RecyclerViewActions.scrollToPosition(5)); onView(withId(R.id.feed_stream_recycler_view))
.perform(RecyclerViewActions.scrollToPosition(5));
// Scroll down to bottom // Scroll down to bottom
onView(instanceOf(RecyclerView.class)).perform(RecyclerViewActions.scrollToPosition(11)); onView(withId(R.id.feed_stream_recycler_view))
.perform(RecyclerViewActions.scrollToPosition(11));
// Wait till image resource loaded // Wait till image resource loaded
Thread.sleep(4000); Thread.sleep(4000);
...@@ -84,7 +84,8 @@ public final class FeedNewTabPageCardInstrumentationTest { ...@@ -84,7 +84,8 @@ public final class FeedNewTabPageCardInstrumentationTest {
"feed_wpr_render_position_11"); "feed_wpr_render_position_11");
// Scroll back to position 3 to see previously rendered card // Scroll back to position 3 to see previously rendered card
onView(instanceOf(RecyclerView.class)).perform(RecyclerViewActions.scrollToPosition(3)); onView(withId(R.id.feed_stream_recycler_view))
.perform(RecyclerViewActions.scrollToPosition(3));
// Wait till it finish rendering cards // Wait till it finish rendering cards
Thread.sleep(1000); Thread.sleep(1000);
......
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