Commit d17ece3a authored by Gang Wu's avatar Gang Wu Committed by Commit Bot

Revert "Batch BottomSheetControllerTests"

This reverts commit 3c8430ae.

Reason for revert:
https://ci.chromium.org/p/chromium/builders/ci/android-marshmallow-x86-rel/1133

Original change's description:
> Batch BottomSheetControllerTests
> 
> This patch batches all the tests in BottomSheetControllerTest.
> Consequently, some new methods to reset the sheet's state were added
> to the test support classes and BlankCTATabInitialState was updated to
> support any subclass of ChromeActivity.
> 
> Bug: 1122163
> Change-Id: I3fbb73431eff206010d93d8c5e26e4942b84adb8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377664
> Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
> Commit-Queue: Matthew Jones <mdjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#803156}

TBR=mthiesse@chromium.org,mdjones@chromium.org

Change-Id: I41a36c86f34d947b69e00a92109f56f0bfcda760
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1122163
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386500Reviewed-by: default avatarGang Wu <gangwu@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803346}
parent 590567c5
......@@ -22,13 +22,11 @@ import org.chromium.content_public.browser.test.util.TestThreadUtils;
*
* State is stored statically, and so the Activity may be reused across multiple test suites within
* the same {@link Batch}.
*
* @param <T> The type of {@link ChromeActivity}.
*/
public class BlankCTATabInitialStateRule<T extends ChromeActivity> implements TestRule {
public class BlankCTATabInitialStateRule implements TestRule {
private static ChromeActivity sActivity;
private final ChromeActivityTestRule<T> mActivityTestRule;
private final ChromeActivityTestRule<ChromeActivity> mActivityTestRule;
private final boolean mClearAllTabState;
/**
......@@ -37,7 +35,7 @@ public class BlankCTATabInitialStateRule<T extends ChromeActivity> implements Te
* renderer process between each test.
*/
public BlankCTATabInitialStateRule(
ChromeActivityTestRule<T> activityTestRule, boolean clearAllTabState) {
ChromeActivityTestRule<ChromeActivity> activityTestRule, boolean clearAllTabState) {
super();
mActivityTestRule = activityTestRule;
mClearAllTabState = clearAllTabState;
......@@ -54,7 +52,7 @@ public class BlankCTATabInitialStateRule<T extends ChromeActivity> implements Te
mActivityTestRule.startMainActivityOnBlankPage();
sActivity = mActivityTestRule.getActivity();
} else {
mActivityTestRule.setActivity((T) sActivity);
mActivityTestRule.setActivity(sActivity);
if (mClearAllTabState) {
resetTabStateThorough();
} else {
......
......@@ -367,14 +367,6 @@ class BottomSheetControllerImpl implements ManagedBottomSheetController {
mBottomSheet.endAnimations();
}
@VisibleForTesting
public void forceDismissAllContent() {
clearRequestsAndHide();
// Handle content that has a custom lifecycle.
hideContent(mBottomSheet.getCurrentSheetContent(), /* animate= */ true);
}
@Override
public boolean requestShowContent(BottomSheetContent content, boolean animate) {
if (mBottomSheet == null) mSheetInitializer.run();
......
......@@ -99,11 +99,6 @@ public class BottomSheetTestSupport {
return getBottomSheet().forceScrollingStateForTesting(sheetHeight, yVelocity);
}
/** Dismiss all content currently queued in the controller including custom lifecycles. */
public void forceDismissAllContent() {
mController.forceDismissAllContent();
}
/** @return The bottom sheet view. */
private BottomSheet getBottomSheet() {
return (BottomSheet) mController.getBottomSheetViewForTesting();
......
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