Commit 16440292 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Avoid JNI invocation in shape_detection unit tests

Instead of using BigBufferUtil to construct a mojom.BigBuffer for test
images, construct one manually with bytes always inlined. This avoids
using shared memory for large images and thus avoids invoking Mojo JNI
calls which cannot be resolved in the test environment.

Bug: 833632
Cq-Include-Trybots: luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win10_chromium_x64_rel_ng
Change-Id: If11c5fb1d9e1ba6d6cc059fd5c0dcc825d39a2ef
Reviewed-on: https://chromium-review.googlesource.com/1020384Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552392}
parent d565f863
...@@ -15,7 +15,6 @@ import com.google.android.gms.common.GoogleApiAvailability; ...@@ -15,7 +15,6 @@ import com.google.android.gms.common.GoogleApiAvailability;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.test.util.UrlUtils; import org.chromium.base.test.util.UrlUtils;
import org.chromium.mojo_base.BigBufferUtil;
import org.chromium.skia.mojom.ColorType; import org.chromium.skia.mojom.ColorType;
import org.chromium.skia.mojom.ImageInfo; import org.chromium.skia.mojom.ImageInfo;
...@@ -44,7 +43,8 @@ public class TestUtils { ...@@ -44,7 +43,8 @@ public class TestUtils {
mojoBitmap.imageInfo.width = bitmap.getWidth(); mojoBitmap.imageInfo.width = bitmap.getWidth();
mojoBitmap.imageInfo.height = bitmap.getHeight(); mojoBitmap.imageInfo.height = bitmap.getHeight();
mojoBitmap.imageInfo.colorType = ColorType.RGBA_8888; mojoBitmap.imageInfo.colorType = ColorType.RGBA_8888;
mojoBitmap.pixelData = BigBufferUtil.createBigBufferFromBytes(buffer.array()); mojoBitmap.pixelData = new org.chromium.mojo_base.mojom.BigBuffer();
mojoBitmap.pixelData.setBytes(buffer.array());
return mojoBitmap; return mojoBitmap;
} }
......
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