Package org.robolectric.fakes
Class RoboWebMessagePort
java.lang.Object
android.webkit.WebMessagePort
org.robolectric.fakes.RoboWebMessagePort
Robolectric implementation of
WebMessagePort
.-
Nested Class Summary
Nested classes/interfaces inherited from class android.webkit.WebMessagePort
WebMessagePort.WebMessageCallback
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static RoboWebMessagePort[]
com.google.common.collect.ImmutableList<String>
Returns the list of all messages sent to its connected ports.com.google.common.collect.ImmutableList<String>
Returns the list of all messages received from its connected ports.boolean
isClosed()
void
postMessage
(WebMessage message) void
Links another port to this port.void
void
setWebMessageCallback
(WebMessagePort.WebMessageCallback callback, Handler handler)
-
Constructor Details
-
RoboWebMessagePort
public RoboWebMessagePort()
-
-
Method Details
-
createPair
-
postMessage
- Specified by:
postMessage
in classWebMessagePort
-
setWebMessageCallback
- Specified by:
setWebMessageCallback
in classWebMessagePort
-
setWebMessageCallback
public void setWebMessageCallback(WebMessagePort.WebMessageCallback callback, @Nullable Handler handler) - Specified by:
setWebMessageCallback
in classWebMessagePort
-
setConnectedPort
Links another port to this port. After set, messages which sent from this port will arrive at the connected one. -
getConnectedPort
-
getWebMessageCallback
-
getOutgoingMessages
Returns the list of all messages sent to its connected ports. -
getReceivedMessages
Returns the list of all messages received from its connected ports. -
close
public void close()- Specified by:
close
in classWebMessagePort
-
isClosed
public boolean isClosed()
-