[common][content][DPTTIZEN-3167, fix audiocontent copyright tc] 08/218308/1
authorqunfang.lin <qunfang.lin@samsung.com>
Fri, 22 Nov 2019 00:44:30 +0000 (08:44 +0800)
committerqunfang.lin <qunfang.lin@samsung.com>
Fri, 22 Nov 2019 00:46:18 +0000 (08:46 +0800)
modify: 1 tc

Change-Id: Ie2bffae07c54f108866f642b7f627ca5d7878efd
Signed-off-by: qunfang.lin <qunfang.lin@samsung.com>
common/tct-content-tizen-tests/content/AudioContent_copyright_attribute.html

index daf29d8fae65d1932b51becb33f44646249fe919..88613ea4cba7e4dfcae0c80223230e8733224367 100755 (executable)
@@ -25,10 +25,9 @@ Authors:
 <script src="support/unitcommon.js"></script>
 <script src="support/content_common.js"></script>
 </head>
-
 <body>
 <div id="log"></div>
-<script type="text/javascript">
+<script>
 //==== TEST: AudioContent_copyright_attribute
 //==== LABEL Check if AudioContent have copyright attribute with proper type and is readonly
 //==== ONLOAD_DELAY 30
@@ -36,10 +35,11 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
 //==== PRIORITY P1
 //==== TEST_CRITERIA AE AT ARO
+
 setup({timeout: 30000});
 
 var t = async_test(document.title, {timeout: 30000}),
-    onSuccess, onError, filter, content;
+    onSuccess, onError, filter, content, i;
 
 setup_contents(t, t.step_func(function () {
     filter = new tizen.AttributeFilter("type", "EXACTLY", "AUDIO");
@@ -52,11 +52,13 @@ setup_contents(t, t.step_func(function () {
         assert_type(contents, "array", "contents should be an array");
         assert_greater_than(contents.length, 0, "media item is not found");
 
-        content = contents[0];
-        if(content.copyright !== null) {
-            check_readonly(content, "copyright", content.copyright, "string", "MyRights");
+        for (i = 0; i < contents.length; i++) {
+            content = contents[i];
+            if (TEST_CONTENT_AUDIOS.includes(content.name)) {
+                check_readonly(content, "copyright", content.copyright, "string", "MyRights");
+                break;
+            }
         }
-
         t.done();
     });