@Test
    public void testNotifyChannelCreationAndSendMessages() {
        mConnection.notifyMessageChannelReady(null);
        assertTrue(mCallback.isMessageChannelReady());

        mConnection.postMessage("message1", null);
        assertEquals(mCallback.getMessages().size(), 1);

        mConnection.postMessage("message2", null);
        assertEquals(mCallback.getMessages().size(), 2);
    }
Tests for {@link PostMessageServiceConnection} with no {@link CustomTabsService} component.
customtabs/tests/src/android/support/customtabs/PostMessageServiceConnectionTest.java