Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Unified Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java

Issue 2746013011: [Home] Add BottomSheetObserverTest#testSheetContentChanged (Closed)
Patch Set: [Home] Add BottomSheetObserverTest#testSheetContentChanged Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/android/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java
index 9997e61bd32c8a7b785b26ae69425f2c899b316e..3da8435e17bed7cbbb5e2c121ecf3c04b99c4fde 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/BottomSheetTestCaseBase.java
@@ -14,6 +14,7 @@ import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetContent;
+import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentController;
import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
/**
@@ -25,6 +26,9 @@ public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa
/** A handle to the bottom sheet. */
protected BottomSheet mBottomSheet;
+ /** A handle to the {@link BottomSheetContentController}. */
+ protected BottomSheetContentController mBottomSheetContentController;
+
private boolean mOldChromeHomeFlagValue;
@Override
protected void setUp() throws Exception {
@@ -50,6 +54,7 @@ public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa
((RecyclerView) getBottomSheetContent().getContentView()));
mBottomSheet = getActivity().getBottomSheet();
+ mBottomSheetContentController = getActivity().getBottomSheetContentController();
}
@Override
@@ -93,4 +98,17 @@ public abstract class BottomSheetTestCaseBase extends ChromeTabbedActivityTestBa
protected BottomSheetContent getBottomSheetContent() {
return getActivity().getBottomSheet().getCurrentSheetContent();
}
+
+ /**
+ * @param itemId The id of the MenuItem corresponding to the {@link BottomSheetContent} to
+ * select.
+ */
+ protected void selectBottomSheetContent(final int itemId) {
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ mBottomSheetContentController.selectItemForTests(itemId);
+ }
+ });
+ }
}
« no previous file with comments | « chrome/test/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698