/* check that a no stream connection creates 0 media sections */
+ t->on_negotiation_needed = NULL;
t->offer_data = GUINT_TO_POINTER (0);
t->on_offer_created = _count_num_sdp_media;
t->answer_data = GUINT_TO_POINTER (0);
t->on_answer_created = _count_num_sdp_media;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* check that a single stream connection creates the associated number
* of media sections */
+ t->on_negotiation_needed = NULL;
t->offer_data = GUINT_TO_POINTER (1);
t->on_offer_created = _count_num_sdp_media;
t->answer_data = GUINT_TO_POINTER (1);
t->on_answer_created = _count_num_sdp_media;
t->on_ice_candidate = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* check that a dual stream connection creates the associated number
* of media sections */
+ t->on_negotiation_needed = NULL;
t->offer_data = GUINT_TO_POINTER (2);
t->on_offer_created = _count_num_sdp_media;
t->answer_data = GUINT_TO_POINTER (2);
t->on_answer_created = _count_num_sdp_media;
t->on_ice_candidate = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
add_fake_audio_src_harness (h, 96);
t->harnesses = g_list_prepend (t->harnesses, h);
+ t->on_negotiation_needed = NULL;
t->offer_data = &offer;
t->on_offer_created = validate_sdp;
t->answer_data = &answer;
t->on_answer_created = validate_sdp;
t->on_ice_candidate = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
GstWebRTCRTPTransceiver *trans;
GArray *transceivers;
+ t->on_negotiation_needed = NULL;
t->offer_data = &offer;
t->on_offer_created = validate_sdp;
t->on_ice_candidate = NULL;
NULL);
g_array_unref (transceivers);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* check the default dtls setup negotiation values */
+ t->on_negotiation_needed = NULL;
t->offer_data = &offer;
t->on_offer_created = validate_sdp;
t->answer_data = &answer;
t->on_answer_created = validate_sdp;
t->on_ice_candidate = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* test that the stats generated without any streams are sane */
+ t->on_negotiation_needed = NULL;
t->on_offer_created = NULL;
t->on_answer_created = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* add a transceiver that will only receive an opus stream and check that
* the created offer is marked as recvonly */
+ t->on_negotiation_needed = NULL;
t->on_pad_added = _pad_added_fakesink;
t->on_negotiation_needed = NULL;
t->offer_data = &offer;
add_fake_audio_src_harness (h, 96);
t->harnesses = g_list_prepend (t->harnesses, h);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
/* add a transceiver that will only receive an opus stream and check that
* the created offer is marked as recvonly */
+ t->on_negotiation_needed = NULL;
t->on_pad_added = _pad_added_fakesink;
t->on_negotiation_needed = NULL;
t->offer_data = &offer;
add_fake_audio_src_harness (h, 96);
t->harnesses = g_list_prepend (t->harnesses, h);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
test_webrtc_create_offer (t, t->webrtc1);
test_webrtc_wait_for_answer_error_eos (t);
t->on_answer_created = validate_sdp;
t->on_ice_candidate = NULL;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
g_signal_connect (channel, "on-error",
G_CALLBACK (on_channel_error_not_reached), NULL);
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel_transfer_string;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
g_signal_connect (channel, "on-error",
G_CALLBACK (on_channel_error_not_reached), NULL);
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel_transfer_data;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
g_signal_connect (channel, "on-error",
G_CALLBACK (on_channel_error_not_reached), NULL);
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel_create_data_channel;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "prev-label", NULL,
&channel);
g_assert_nonnull (channel);
g_signal_connect (channel, "on-error",
G_CALLBACK (on_channel_error_not_reached), NULL);
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel_check_low_threshold_emitted;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
g_signal_connect (channel, "on-error",
G_CALLBACK (on_channel_error_not_reached), NULL);
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);
t->on_ice_candidate = NULL;
t->on_data_channel = have_data_channel_transfer_large_data;
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE);
+
g_signal_emit_by_name (t->webrtc1, "create-data-channel", "label", NULL,
&channel);
g_assert_nonnull (channel);
t->data_channel_data = channel;
- gst_element_set_state (t->webrtc1, GST_STATE_PLAYING);
- gst_element_set_state (t->webrtc2, GST_STATE_PLAYING);
+ fail_if (gst_element_set_state (t->webrtc1,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
+ fail_if (gst_element_set_state (t->webrtc2,
+ GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
test_webrtc_create_offer (t, t->webrtc1);