Merge "Support different types of transitions." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-25 11:49:59 +00:00
committed by Android (Google) Code Review
3 changed files with 65 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ import androidx.fragment.app.FragmentActivity;
import com.android.settings.SettingsActivity;
import com.android.settings.testutils.shadow.ShadowUtils;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.transition.SettingsTransitionHelper;
import org.junit.Before;
import org.junit.Test;
@@ -97,6 +98,7 @@ public class SubSettingLauncherTest {
.setDestination(SubSettingLauncherTest.class.getName())
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setSourceMetricsCategory(123)
.setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE)
.launch();
doNothing().when(launcher).launch(any(Intent.class));
verify(launcher).launch(intentArgumentCaptor.capture());
@@ -109,6 +111,8 @@ public class SubSettingLauncherTest {
assertThat(intent.getFlags()).isEqualTo(Intent.FLAG_ACTIVITY_NEW_TASK);
assertThat(intent.getIntExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY, -1))
.isEqualTo(123);
assertThat(intent.getIntExtra(SettingsBaseActivity.EXTRA_PAGE_TRANSITION_TYPE, -1))
.isEqualTo(SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE);
}
@Test