[UTC][player][Non-ACR][add TCs for setting audio_policy]
authorNAMJEONGYOON <just.nam@samsung.com>
Thu, 2 Jun 2016 05:12:14 +0000 (14:12 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Fri, 10 Jun 2016 04:19:21 +0000 (13:19 +0900)
Change-Id: I6a7a55f207d588211945d184f05c5beab37fb155
Signed-off-by: NAMJEONGYOON <just.nam@samsung.com>
src/utc/player/tct-player-core_common_iot.h
src/utc/player/tct-player-core_mobile.h
src/utc/player/tct-player-core_tv.h
src/utc/player/tct-player-core_wearable.h
src/utc/player/utc-media-player.c

index 0ccd1e6..19fb8e1 100755 (executable)
@@ -59,6 +59,8 @@ extern int utc_media_player_get_volume_n(void);
 extern int utc_media_player_set_sound_type_p(void);
 extern int utc_media_player_set_sound_type_n(void);
 extern int utc_media_player_set_sound_type_n2(void);
+extern int utc_media_player_set_audio_policy_info_p(void);
+extern int utc_media_player_set_audio_policy_info_n(void);
 extern int utc_media_player_set_subtitle_path_p(void);
 extern int utc_media_player_set_subtitle_path_n(void);
 extern int utc_media_player_set_display_visible_p(void);
@@ -229,7 +231,9 @@ testcase tc_array[] = {
     {"utc_media_player_get_volume_n", utc_media_player_get_volume_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_p", utc_media_player_set_sound_type_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_n", utc_media_player_set_sound_type_n, utc_media_player_startup, utc_media_player_cleanup},
-       {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_p", utc_media_player_set_audio_policy_info_p, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_n", utc_media_player_set_audio_policy_info_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_p", utc_media_player_set_subtitle_path_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_n", utc_media_player_set_subtitle_path_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_display_visible_p", utc_media_player_set_display_visible_p, utc_media_player_startup, utc_media_player_cleanup},
index ca8c48e..19fb8e1 100755 (executable)
@@ -59,6 +59,8 @@ extern int utc_media_player_get_volume_n(void);
 extern int utc_media_player_set_sound_type_p(void);
 extern int utc_media_player_set_sound_type_n(void);
 extern int utc_media_player_set_sound_type_n2(void);
+extern int utc_media_player_set_audio_policy_info_p(void);
+extern int utc_media_player_set_audio_policy_info_n(void);
 extern int utc_media_player_set_subtitle_path_p(void);
 extern int utc_media_player_set_subtitle_path_n(void);
 extern int utc_media_player_set_display_visible_p(void);
@@ -230,6 +232,8 @@ testcase tc_array[] = {
     {"utc_media_player_set_sound_type_p", utc_media_player_set_sound_type_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_n", utc_media_player_set_sound_type_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_p", utc_media_player_set_audio_policy_info_p, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_n", utc_media_player_set_audio_policy_info_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_p", utc_media_player_set_subtitle_path_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_n", utc_media_player_set_subtitle_path_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_display_visible_p", utc_media_player_set_display_visible_p, utc_media_player_startup, utc_media_player_cleanup},
index e48d233..d3534b1 100755 (executable)
@@ -143,6 +143,8 @@ extern int utc_media_player_get_volume_n(void);
 extern int utc_media_player_set_sound_type_p(void);
 extern int utc_media_player_set_sound_type_n(void);
 extern int utc_media_player_set_sound_type_n2(void);
+extern int utc_media_player_set_audio_policy_info_p(void);
+extern int utc_media_player_set_audio_policy_info_n(void);
 extern int utc_media_player_set_subtitle_path_p(void);
 extern int utc_media_player_set_subtitle_path_n(void);
 extern int utc_media_player_set_display_visible_p(void);
@@ -336,7 +338,9 @@ testcase tc_array[] = {
     {"utc_media_player_get_volume_n", utc_media_player_get_volume_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_p", utc_media_player_set_sound_type_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_n", utc_media_player_set_sound_type_n, utc_media_player_startup, utc_media_player_cleanup},
-       {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_p", utc_media_player_set_audio_policy_info_p, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_n", utc_media_player_set_audio_policy_info_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_p", utc_media_player_set_subtitle_path_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_n", utc_media_player_set_subtitle_path_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_display_visible_p", utc_media_player_set_display_visible_p, utc_media_player_startup, utc_media_player_cleanup},
index e48d233..d3534b1 100755 (executable)
@@ -143,6 +143,8 @@ extern int utc_media_player_get_volume_n(void);
 extern int utc_media_player_set_sound_type_p(void);
 extern int utc_media_player_set_sound_type_n(void);
 extern int utc_media_player_set_sound_type_n2(void);
+extern int utc_media_player_set_audio_policy_info_p(void);
+extern int utc_media_player_set_audio_policy_info_n(void);
 extern int utc_media_player_set_subtitle_path_p(void);
 extern int utc_media_player_set_subtitle_path_n(void);
 extern int utc_media_player_set_display_visible_p(void);
@@ -336,7 +338,9 @@ testcase tc_array[] = {
     {"utc_media_player_get_volume_n", utc_media_player_get_volume_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_p", utc_media_player_set_sound_type_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_sound_type_n", utc_media_player_set_sound_type_n, utc_media_player_startup, utc_media_player_cleanup},
-       {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_sound_type_n2", utc_media_player_set_sound_type_n2, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_p", utc_media_player_set_audio_policy_info_p, utc_media_player_startup, utc_media_player_cleanup},
+    {"utc_media_player_set_audio_policy_info_n", utc_media_player_set_audio_policy_info_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_p", utc_media_player_set_subtitle_path_p, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_subtitle_path_n", utc_media_player_set_subtitle_path_n, utc_media_player_startup, utc_media_player_cleanup},
     {"utc_media_player_set_display_visible_p", utc_media_player_set_display_visible_p, utc_media_player_startup, utc_media_player_cleanup},
index bb3ebfb..6d87f04 100644 (file)
@@ -767,6 +767,11 @@ int utc_media_player_set_sound_type_n(void)
     return 0;
 }
 
+/**
+ * @testcase           utc_media_player_set_sound_type_n2
+ * @since_tizen                2.3.1
+ * @description                Negative test case to set sound type
+ */
 int utc_media_player_set_sound_type_n2(void)
 {
     sound_type_e type;
@@ -793,6 +798,59 @@ int utc_media_player_set_sound_type_n2(void)
 }
 
 /**
+ * @testcase           utc_media_player_set_audio_policy_info_p
+ * @since_tizen                3.0
+ * @description                Positive test case to set audio policy info
+ */
+int utc_media_player_set_audio_policy_info_p(void)
+{
+    sound_type_e type;
+    player_state_e state;
+
+    int ret = player_get_state (player, &state);
+    assert_eq(ret, PLAYER_ERROR_NONE);
+    if (state != PLAYER_STATE_IDLE){
+        player_unprepare(player);
+    }
+
+    ret = player_get_state (player, &state);
+    assert_eq(ret, PLAYER_ERROR_NONE);
+
+    if (state == PLAYER_STATE_IDLE){
+        set_sound_stream_info();
+        ret = player_set_audio_policy_info(player, g_stream_info_h);
+        assert_eq(ret, PLAYER_ERROR_NONE);
+    }
+    return 0;
+}
+
+/**
+ * @testcase           utc_media_player_set_audio_policy_info_n
+ * @since_tizen                3.0
+ * @description                Negative test case to set audio policy info
+ */
+int utc_media_player_set_audio_policy_info_n(void)
+{
+    sound_type_e type;
+    player_state_e state;
+
+    int ret = player_get_state (player, &state);
+    assert_eq(ret, PLAYER_ERROR_NONE);
+    if (state != PLAYER_STATE_IDLE){
+        player_unprepare(player);
+    }
+
+    ret = player_get_state (player, &state);
+    assert_eq(ret, PLAYER_ERROR_NONE);
+
+    if (state == PLAYER_STATE_IDLE){
+        ret = player_set_audio_policy_info(NULL, NULL);
+        assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
+    }
+    return 0;
+}
+
+/**
  * @testcase           utc_media_player_set_subtitle_path_p
  * @since_tizen                2.3.1
  * @description                Positive test case to set subtitle path