Commit 5cb0eb17 authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

Fix context menu tests

testDismissContextMenuOnClick instrumentation test fails because we
click on a notification instead of a view in the app which causes a
java.lang.SecurityException: "Injecting to another application requires
INJECT_EVENTS permission."

To work around this issue, this CL changes the test to click roughly
the bottom right corner of the screen.

Bug: 1001966
Change-Id: I3f0d3c06ad72450217b936ea17d896db4162deb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792685Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#695179}
parent 5cde406e
...@@ -231,8 +231,8 @@ public class ContextMenuTest implements CustomMainActivityStart { ...@@ -231,8 +231,8 @@ public class ContextMenuTest implements CustomMainActivityStart {
} }
}); });
TestTouchUtils.singleClickView( TestTouchUtils.singleClickView(InstrumentationRegistry.getInstrumentation(), tab.getView(),
InstrumentationRegistry.getInstrumentation(), tab.getView(), 0, 0); tab.getView().getWidth() - 5, tab.getView().getHeight() - 5);
CriteriaHelper.pollUiThread(new Criteria("Activity did not regain focus.") { CriteriaHelper.pollUiThread(new Criteria("Activity did not regain focus.") {
@Override @Override
......
...@@ -178,8 +178,8 @@ public class RevampedContextMenuTest implements DownloadTestRule.CustomMainActiv ...@@ -178,8 +178,8 @@ public class RevampedContextMenuTest implements DownloadTestRule.CustomMainActiv
} }
}); });
TestTouchUtils.singleClickView( TestTouchUtils.singleClickView(InstrumentationRegistry.getInstrumentation(), tab.getView(),
InstrumentationRegistry.getInstrumentation(), tab.getView(), 0, 0); tab.getView().getWidth() - 5, tab.getView().getHeight() - 5);
CriteriaHelper.pollUiThread(new Criteria("Activity did not regain focus.") { CriteriaHelper.pollUiThread(new Criteria("Activity did not regain focus.") {
@Override @Override
......
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