#define API_NAMESPACE "WEBRTC_UTC"
#define MICROPHONE_FEATURE "http://tizen.org/feature/microphone"
#define CAMERA_FEATURE "http://tizen.org/feature/camera"
+#define DISPLAY_FEATURE "http://tizen.org/feature/display"
#define TIMEOUT_MS 5000
#define TEST_WIDTH 640
#define TEST_HEIGHT 480
static bool g_bIsMicrophoneFeatureSupported;
static bool g_bIsCameraFeatureSupported;
+static bool g_bIsDisplayFeatureSupported;
static GMainLoop *g_mainloop = NULL;
static int g_timeout_id = 0;
static Evas_Object *g_win = NULL;
g_bIsCameraFeatureSupported = false;
IS_FEATURE_SUPPORTED(CAMERA_FEATURE, g_bIsCameraFeatureSupported, API_NAMESPACE);
+
+ g_bIsDisplayFeatureSupported = false;
+ IS_FEATURE_SUPPORTED(DISPLAY_FEATURE, g_bIsDisplayFeatureSupported, API_NAMESPACE);
}
/**
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, NULL);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_start(g_webrtc);
assert_eq(ret, WEBRTC_ERROR_NONE);
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_EVAS, NULL, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
int utc_media_webrtc_media_source_set_video_loopback_n2(void)
{
int ret = webrtc_media_source_set_video_loopback(g_webrtc, 0, WEBRTC_DISPLAY_TYPE_EVAS, NULL, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_EVAS + 1, NULL, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, NULL);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_unset_video_loopback(g_webrtc, id);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_unset_video_loopback(g_webrtc, 0);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_unset_video_loopback(g_webrtc, id);
- assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_OPERATION);
return 0;
}
int utc_media_webrtc_set_display_n(void)
{
int ret = webrtc_set_display(g_webrtc, 0, WEBRTC_DISPLAY_TYPE_EVAS, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &track_id);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_start(g_webrtc);
assert_eq(ret, WEBRTC_ERROR_NONE);
__run_mainloop();
ret = webrtc_set_display_mode(g_webrtc, track_id, WEBRTC_DISPLAY_MODE_FULL);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_get_display_mode(g_webrtc, track_id, &mode);
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ webrtc_stop(g_webrtc);
+ return 0;
+ }
assert_eq(ret, WEBRTC_ERROR_NONE);
assert_eq(mode, WEBRTC_DISPLAY_MODE_FULL);
int utc_media_webrtc_set_display_mode_n(void)
{
int ret = webrtc_set_display_mode(g_webrtc, 0, WEBRTC_DISPLAY_MODE_ORIGIN_SIZE);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &track_id);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_start(g_webrtc);
assert_eq(ret, WEBRTC_ERROR_NONE);
__run_mainloop();
ret = webrtc_get_display_mode(g_webrtc, track_id, &mode);
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ webrtc_stop(g_webrtc);
+ return 0;
+ }
assert_eq(ret, WEBRTC_ERROR_NONE);
assert_eq(mode, WEBRTC_DISPLAY_MODE_LETTER_BOX); /* check the default value */
int utc_media_webrtc_get_display_mode_n(void)
{
int ret = webrtc_get_display_mode(g_webrtc, 0, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &track_id);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_start(g_webrtc);
assert_eq(ret, WEBRTC_ERROR_NONE);
__run_mainloop();
ret = webrtc_set_display_visible(g_webrtc, track_id, false);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_get_display_visible(g_webrtc, track_id, &visible);
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ webrtc_stop(g_webrtc);
+ return 0;
+ }
assert_eq(ret, WEBRTC_ERROR_NONE);
assert_eq(visible, false);
int utc_media_webrtc_set_display_visible_n(void)
{
int ret = webrtc_set_display_visible(g_webrtc, 0, true);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}
assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_media_source_set_video_loopback(g_webrtc, id, WEBRTC_DISPLAY_TYPE_OVERLAY, g_win, &track_id);
- assert_eq(ret, WEBRTC_ERROR_NONE);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_NONE);
ret = webrtc_start(g_webrtc);
assert_eq(ret, WEBRTC_ERROR_NONE);
__run_mainloop();
ret = webrtc_get_display_visible(g_webrtc, track_id, &visible);
+ if (!g_bIsDisplayFeatureSupported) {
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ webrtc_stop(g_webrtc);
+ return 0;
+ }
assert_eq(ret, WEBRTC_ERROR_NONE);
assert_eq(visible, true); /* check the default value */
int utc_media_webrtc_get_display_visible_n(void)
{
int ret = webrtc_get_display_visible(g_webrtc, 0, NULL);
- assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
+ if (!g_bIsDisplayFeatureSupported)
+ assert_eq(ret, WEBRTC_ERROR_NOT_SUPPORTED);
+ else
+ assert_eq(ret, WEBRTC_ERROR_INVALID_PARAMETER);
return 0;
}