1package io.flutter.plugin.common;
3import static org.mockito.ArgumentMatchers.anyInt;
4import static org.mockito.ArgumentMatchers.argThat;
5import static org.mockito.ArgumentMatchers.eq;
6import static org.mockito.Mockito.mock;
7import static org.mockito.Mockito.times;
8import static org.mockito.Mockito.verify;
10import android.content.res.AssetManager;
11import androidx.test.ext.junit.runners.AndroidJUnit4;
12import io.flutter.embedding.engine.FlutterJNI;
13import io.flutter.embedding.engine.dart.DartExecutor;
14import java.nio.ByteBuffer;
16import org.junit.runner.RunWith;
17import org.mockito.ArgumentMatcher;
18import org.robolectric.annotation.Config;
21@RunWith(AndroidJUnit4.class)
27 String channel =
"flutter/test";
36 final byte[] expected = {
37 7, 6, 114, 101, 115, 105, 122, 101, 12, 2, 7, 12, 102, 108, 117, 116, 116, 101, 114, 47, 116,
38 101, 115, 116, 3, 3, 0, 0, 0
42 ArgumentMatcher<ByteBuffer> packetMatcher =
44 verify(mockFlutterJNI,
times(1))
45 .dispatchPlatformMessage(
47 argThat(packetMatcher),
56 String channel =
"flutter/test";
64 final byte[] expected = {
65 7, 8, 111, 118, 101, 114, 102, 108, 111, 119, 12, 2, 7, 12, 102, 108, 117, 116, 116, 101, 114,
66 47, 116, 101, 115, 116, 1
70 ArgumentMatcher<ByteBuffer> packetMatcher =
72 verify(mockFlutterJNI,
times(1))
73 .dispatchPlatformMessage(
75 argThat(packetMatcher),
85 private ByteBuffer expected;
88 this.expected = expected;
92 public boolean matches(ByteBuffer received) {
95 return received.equals(expected);
static SkISize times(const SkISize &size, float factor)
static bool eq(const SkM44 &a, const SkM44 &b, float tol)
static final String CHANNEL_BUFFERS_CHANNEL
boolean matches(ByteBuffer received)
ByteBufferContentMatcher(ByteBuffer expected)
void resizeChannelBufferMessageIsWellformed()
void overflowChannelBufferMessageIsWellformed()
void setWarnsOnChannelOverflow(boolean warns)
void resizeChannelBuffer(int newSize)