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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java

Issue 1026723002: [Android WebView] Deflake new OnReceived*Error tests that simulate tap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
index d26b7558674b60522bb75ab3c9044ba4bb576d90..f8207dd2f0e80725faeb456dc6f62a418dd2eaac 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java
@@ -4,8 +4,6 @@
package org.chromium.android_webview.test;
-import android.graphics.Bitmap;
-import android.graphics.Color;
import android.os.Build;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Pair;
@@ -14,7 +12,6 @@ import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwWebResourceResponse;
import org.chromium.android_webview.test.util.AwTestTouchUtils;
import org.chromium.android_webview.test.util.CommonResources;
-import org.chromium.android_webview.test.util.GraphicsTestUtils;
import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MinAndroidSdkLevel;
@@ -242,21 +239,8 @@ public class AwContentsClientShouldInterceptRequestTest extends AwTestBase {
assertEquals(false,
mShouldInterceptRequestHelper.getRequestsForUrl(pageWithLinkUrl).hasUserGesture);
- // TODO(mkosiba): Remove this once we have a real API to wait for the page to load and
- // display.
- // http://crbug.com/364612
- //
- // The code here is waiting for the "link" (which is a full-screen blue div) to appear on
- // screen.
- pollOnUiThread(new Callable<Boolean>() {
- @Override
- public Boolean call() throws Exception {
- Bitmap bitmap = GraphicsTestUtils.drawAwContents(mAwContents, 2, 2,
- -(float) mTestContainerView.getWidth() / 2,
- -(float) mTestContainerView.getHeight() / 2);
- return bitmap.getPixel(0, 0) == Color.BLUE;
- }
- });
+ waitForPixelColorAtCenterOfView(mAwContents,
+ mTestContainerView, CommonResources.LINK_COLOR);
callCount = mShouldInterceptRequestHelper.getCallCount();
AwTestTouchUtils.simulateTouchCenterOfView(mTestContainerView);
mShouldInterceptRequestHelper.waitForCallback(callCount);
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698