Commit 94db8b48 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Test] Test metric recording for bottom sheet dismiss button

This CL tests the metric recording for the bottom sheet dismiss button
in the web sign-in flow.

Bug: 1139333
Change-Id: Iafb7fe0528bd5149657a9d92ea3a218fbd9d1228
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2484424Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818406}
parent 9535f7a0
...@@ -223,6 +223,9 @@ public class AccountPickerBottomSheetTest { ...@@ -223,6 +223,9 @@ public class AccountPickerBottomSheetTest {
@Test @Test
@MediumTest @MediumTest
public void testDismissCollapsedSheetWithDismissButton() { public void testDismissCollapsedSheetWithDismissButton() {
MetricsUtils.HistogramDelta accountConsistencyHistogram =
new HistogramDelta("Signin.AccountConsistencyPromoAction",
AccountConsistencyPromoAction.DISMISSED_BUTTON);
buildAndShowCollapsedBottomSheet(); buildAndShowCollapsedBottomSheet();
onView(withText(PROFILE_DATA1.getAccountName())).check(matches(isDisplayed())); onView(withText(PROFILE_DATA1.getAccountName())).check(matches(isDisplayed()));
BottomSheetController controller = getBottomSheetController(); BottomSheetController controller = getBottomSheetController();
...@@ -232,6 +235,7 @@ public class AccountPickerBottomSheetTest { ...@@ -232,6 +235,7 @@ public class AccountPickerBottomSheetTest {
Assert.assertFalse(controller.isSheetOpen()); Assert.assertFalse(controller.isSheetOpen());
verify(mAccountPickerDelegateMock).onDismiss(); verify(mAccountPickerDelegateMock).onDismiss();
Assert.assertEquals(0, mFakeProfileDataSource.getNumberOfObservers()); Assert.assertEquals(0, mFakeProfileDataSource.getNumberOfObservers());
Assert.assertEquals(1, accountConsistencyHistogram.getDelta());
} }
@Test @Test
......
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