static void
on_message_string (GObject * channel, const gchar * str, struct test_webrtc *t)
{
- gchar *expected = g_object_steal_data (channel, "expected");
+ GstWebRTCDataChannelState state;
+ gchar *expected;
+
+ g_object_get (channel, "ready-state", &state, NULL);
+ fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
+
+ expected = g_object_steal_data (channel, "expected");
g_assert_cmpstr (expected, ==, str);
g_free (expected);
g_object_get (our, "ready-state", &state, NULL);
fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
- g_object_get (other, "ready-state", &state, NULL);
- fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
g_object_set_data_full (our, "expected", g_strdup (test_string), g_free);
g_signal_connect (our, "on-message-string", G_CALLBACK (on_message_string),
static void
on_message_data (GObject * channel, GBytes * data, struct test_webrtc *t)
{
- GBytes *expected = g_object_steal_data (channel, "expected");
+ GstWebRTCDataChannelState state;
+ GBytes *expected;
+
+ g_object_get (channel, "ready-state", &state, NULL);
+ fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
+
+ expected = g_object_steal_data (channel, "expected");
g_assert_cmpbytes (data, expected);
g_bytes_unref (expected);
g_object_get (our, "ready-state", &state, NULL);
fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
- g_object_get (other, "ready-state", &state, NULL);
- fail_unless_equals_int (GST_WEBRTC_DATA_CHANNEL_STATE_OPEN, state);
g_object_set_data_full (our, "expected", g_bytes_ref (data),
(GDestroyNotify) g_bytes_unref);