Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6557)

Unified Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java

Issue 2829943002: Redirecting off-origin navigations in PWAs to CCT. (Closed)
Patch Set: Relaxed the WebApkIntegrationTest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java
index abbdc747d0d19c2503f807bc8465040420586a89..a0635e399c28a204be59becb1d9c62b498d57220 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java
@@ -87,6 +87,7 @@ public class ContextMenuUtils {
* @param tab The tab to open a context menu for.
* @param openerDOMNodeId The DOM node to long press to open the context menu for.
* @param itemId The context menu item ID to select.
+ * @param activity The activity to assert for gaining focus after click or null.
* @throws InterruptedException
* @throws TimeoutException
*/
@@ -103,6 +104,7 @@ public class ContextMenuUtils {
* @param jsCode The javascript to get the DOM node to long press
* to open the context menu for.
* @param itemId The context menu item ID to select.
+ * @param activity The activity to assert for gaining focus after click or null.
* @throws InterruptedException
* @throws TimeoutException
*/
@@ -157,11 +159,14 @@ public class ContextMenuUtils {
}
});
- CriteriaHelper.pollInstrumentationThread(new Criteria("Activity did not regain focus.") {
- @Override
- public boolean isSatisfied() {
- return activity.hasWindowFocus();
- }
- });
+ if (activity != null) {
+ CriteriaHelper.pollInstrumentationThread(
+ new Criteria("Activity did not regain focus.") {
+ @Override
+ public boolean isSatisfied() {
+ return activity.hasWindowFocus();
+ }
+ });
+ }
}
}
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698