Commit 2afd2291 authored by Ben Goldberger's avatar Ben Goldberger Committed by Chromium LUCI CQ

Add negative test for the chip not showing

Bug: 1099982
Change-Id: I2da346127e5c659d8344a4983c856f099e5b414b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602846Reviewed-by: default avatarSinan Sahin <sinansahin@google.com>
Commit-Queue: Ben Goldberger <benwgold@google.com>
Cr-Commit-Position: refs/heads/master@{#841274}
parent 04d7ff57
......@@ -407,6 +407,26 @@ public class RevampedContextMenuTest implements DownloadTestRule.CustomMainActiv
}, "Activity did not regain focus.");
}
@Test
@MediumTest
@Feature({"Browser"})
@Features.EnableFeatures({ChromeFeatureList.CONTEXT_MENU_GOOGLE_LENS_CHIP})
public void testLensChipNotShowingIfNotEnabled() throws Throwable {
// Required to avoid runtime error.
Looper.prepare();
Tab tab = mDownloadTestRule.getActivity().getActivityTab();
hardcodeTestImageForSharing(TEST_JPG_IMAGE_FILE_EXTENSION);
RevampedContextMenuCoordinator menuCoordinator =
RevampedContextMenuUtils.openContextMenu(tab, "testImage");
// Needs to run on UI thread so creation happens on same thread as dismissal.
TestThreadUtils.runOnUiThreadBlocking(() -> {
Assert.assertNull("Chip popoup was initialized.",
menuCoordinator.getCurrentPopupWindowForTesting());
});
}
@Test
@MediumTest
@Feature({"Browser"})
......
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