From: Nibha Sharma Date: Tue, 28 Sep 2021 09:25:43 +0000 (+0530) Subject: [ITC][media-content][NonACR][Fix book tc fail for tv profile] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6226c92ec89f2647029bfde8d630f65b117feec;p=test%2Ftct%2Fnative%2Fapi.git [ITC][media-content][NonACR][Fix book tc fail for tv profile] Change-Id: Ia41e3d8c0119db5921d2bc7d74e7aebba020b723 Signed-off-by: Nibha Sharma --- diff --git a/scripts_tpk/inst.sh b/scripts_tpk/inst.sh index 2101c41ad..e357cda86 100755 --- a/scripts_tpk/inst.sh +++ b/scripts_tpk/inst.sh @@ -310,6 +310,12 @@ applist=`ls $DEVICE_SUITE_TARGET_30/res | grep -e tpk -e rpk | cut -d '-' -f1` if [ -f $DEVICE_PHYSICAL_STORAGE_30/TestText.txt ]; then rm -f $DEVICE_PHYSICAL_STORAGE_30/TestText.txt fi + if [ -f $DEVICE_PHYSICAL_STORAGE_30/itc_test.pdf ]; then + rm -f $DEVICE_PHYSICAL_STORAGE_30/itc_test.pdf + fi + if [ -f $DEVICE_PHYSICAL_STORAGE_30/itc_test.epub ]; then + rm -f $DEVICE_PHYSICAL_STORAGE_30/itc_test.epub + fi if [ -d $DEVICE_PHYSICAL_STORAGE_30/Text ]; then rm -rf $DEVICE_PHYSICAL_STORAGE_30/Text fi diff --git a/src/itc/media-content/ITs-media-content-book.c b/src/itc/media-content/ITs-media-content-book.c index 230c0076b..626478293 100755 --- a/src/itc/media-content/ITs-media-content-book.c +++ b/src/itc/media-content/ITs-media-content-book.c @@ -61,6 +61,7 @@ void ITs_media_content_book_startup(void) pszMediaId = NULL; g_hBookDst = NULL; g_hBook = NULL; + g_hBookInfo = NULL; int nRet; nRet = media_content_connect(); if(nRet != MEDIA_CONTENT_ERROR_NONE){ @@ -68,6 +69,13 @@ void ITs_media_content_book_startup(void) return; } + nRet = GetInternalStorageIdandPath(); + PRINT_RESULTNONE_CLEANUP(0, nRet, "GetInternalStorageId", "Return Value Not Correct", media_content_disconnect()); + + AppendPaths(g_szInternalStoragePath, TESTBOOK, g_szBookPath); + nRet = media_info_insert_to_db(g_szBookPath, &g_hBookInfo); + PRINT_RESULTNONE_CLEANUP(MEDIA_CONTENT_ERROR_NONE, nRet, "media_info_insert_to_db", MediaContentGetError(nRet), media_content_disconnect()); + char *pszCondition = "MEDIA_TYPE=5 AND MEDIA_STORAGE_TYPE=0"; nRet = media_filter_create(&g_hFilter); PRINT_RESULTNONE(MEDIA_CONTENT_ERROR_NONE, nRet, "media_filter_create", MediaContentGetError(nRet)); @@ -116,7 +124,11 @@ void ITs_media_content_book_cleanup(void) media_filter_destroy(g_hFilter); g_hFilter = NULL; } - + if(g_hBookInfo) + { + media_info_destroy(g_hBookInfo); + g_hBookInfo = NULL; + } media_content_disconnect(); } diff --git a/src/itc/media-content/ITs-media-content-info.c b/src/itc/media-content/ITs-media-content-info.c index 53967360a..fe801b36c 100755 --- a/src/itc/media-content/ITs-media-content-info.c +++ b/src/itc/media-content/ITs-media-content-info.c @@ -448,10 +448,12 @@ void ITs_media_content_info_startup(void) remove(ERR_LOG); } char *pszMediaId = NULL; + g_hTextInfo = NULL; g_bMediaContentStartup = false; g_hAudioInfo = NULL; g_hImageInfo = NULL; g_hVideoInfo = NULL; + g_hBookInfo = NULL; g_bIsScanFeatureSupported = false; g_bIsScanFeatureNotSupported = false; g_bScanFeatureMismatch= false; @@ -541,6 +543,7 @@ void ITs_media_content_info_cleanup(void) if(g_hTextInfo) { media_info_destroy(g_hTextInfo); + g_hTextInfo = NULL; } if(g_hAudioInfo) { @@ -560,6 +563,7 @@ void ITs_media_content_info_cleanup(void) if(g_hBookInfo) { media_info_destroy(g_hBookInfo); + g_hBookInfo = NULL; } if(g_bMediaContentStartup && g_bIsScanFeatureSupported) {