Package org.robolectric.fakes
Class RoboWebMessagePort
java.lang.Object
android.webkit.WebMessagePort
org.robolectric.fakes.RoboWebMessagePort
public class RoboWebMessagePort extends WebMessagePort
Robolectric implementation of
WebMessagePort
.-
Nested Class Summary
Nested classes/interfaces inherited from class android.webkit.WebMessagePort
WebMessagePort.WebMessageCallback
-
Constructor Summary
Constructors Constructor Description RoboWebMessagePort()
-
Method Summary
Modifier and Type Method Description void
close()
static RoboWebMessagePort[]
createPair()
RoboWebMessagePort
getConnectedPort()
com.google.common.collect.ImmutableList<String>
getOutgoingMessages()
Returns the list of all messages sent to its connected ports.com.google.common.collect.ImmutableList<String>
getReceivedMessages()
Returns the list of all messages received from its connected ports.WebMessagePort.WebMessageCallback
getWebMessageCallback()
boolean
isClosed()
void
postMessage(WebMessage message)
void
setConnectedPort(RoboWebMessagePort port)
Links another port to this port.void
setWebMessageCallback(WebMessagePort.WebMessageCallback callback)
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()
-