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

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

Issue 831903004: [WebView] Add a new flushVisualState API to AwContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: int -> uint62 everywhere for real. Created 5 years, 10 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
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
index f22e1cec9d9afa8057807feab3210b63b5a2ad6b..d125ed774ab8dad35c7a3deec5b9fa7dd6e8996d 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java
@@ -4,12 +4,12 @@
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 org.chromium.android_webview.AwContents;
+import org.chromium.android_webview.test.util.GraphicsTestUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MinAndroidSdkLevel;
@@ -43,17 +43,11 @@ public class AwContentsRenderTest extends AwTestBase {
});
}
- Bitmap grabViewToBitmap() {
- final Bitmap result = Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888);
- mAwContents.onDraw(new android.graphics.Canvas(result));
- return result;
- }
-
int sampleBackgroundColorOnUiThread() throws Exception {
return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- return grabViewToBitmap().getPixel(0, 0);
+ return GraphicsTestUtils.drawAwContents(mAwContents, 10, 10).getPixel(0, 0);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698