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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java

Issue 2534193002: [Contextual Search] Fix flaky tests (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
index 625ac9d8448802c47e6e588ecf985bc11a1a2733..8baf4d596c580ca29c779f1e96362cd87929e2d7 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -1537,6 +1537,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
*/
@SmallTest
@Feature({"ContextualSearch"})
+ @RetryOnFailure
public void testTapOnRoleIgnored() throws InterruptedException, TimeoutException {
PanelState initialState = mPanel.getPanelState();
clickNode("role");
@@ -2673,7 +2674,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
public void testImageControl() throws InterruptedException, TimeoutException {
simulateTapSearch("search");
- ContextualSearchImageControl imageControl = mPanel.getImageControl();
+ final ContextualSearchImageControl imageControl = mPanel.getImageControl();
final ContextualSearchIconSpriteControl iconSpriteControl =
imageControl.getIconSpriteControl();
@@ -2681,8 +2682,13 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertFalse(imageControl.getThumbnailVisible());
assertTrue(TextUtils.isEmpty(imageControl.getThumbnailUrl()));
- imageControl.setThumbnailUrl("http://someimageurl.com/image.png");
- imageControl.onThumbnailFetched(true);
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ imageControl.setThumbnailUrl("http://someimageurl.com/image.png");
+ imageControl.onThumbnailFetched(true);
+ }
+ });
assertTrue(imageControl.getThumbnailVisible());
assertEquals(imageControl.getThumbnailUrl(), "http://someimageurl.com/image.png");
@@ -2696,7 +2702,12 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
}
});
- imageControl.hideStaticImage(false);
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ imageControl.hideStaticImage(false);
+ }
+ });
assertTrue(iconSpriteControl.isVisible());
assertFalse(imageControl.getThumbnailVisible());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698