[common][mediacontroller][DPTTIZEN-3166,fix 4 mediacontroller client TCs] 44/218344/2
authorqunfang.lin <qunfang.lin@samsung.com>
Fri, 22 Nov 2019 03:50:06 +0000 (11:50 +0800)
committerQunfang Lin <qunfang.lin@samsung.com>
Thu, 21 Nov 2019 10:56:41 +0000 (10:56 +0000)
-modify: 4 TCs

Change-Id: Ic6eb510951edffb9a317a4207bd2b92221d90285
Signed-off-by: qunfang.lin <qunfang.lin@samsung.com>
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClientInfo_sendEvent.html
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_setCustomEventListener.html
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_unsetCustomEventListener.html
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_getAllClientsInfo.html

index 128abbb312dfbbb2d43b8070e6b2d43a2c1c74c2..0b4cc6d2f15006301926744575dfdf0b2a9ff235 100755 (executable)
@@ -36,7 +36,8 @@ Authors:
 
 setup({timeout: 30000});
 
-var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer, mcClientsInfoAll, successCallback, retValue = null;
+var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer, mcClientsInfoAll,
+    successCallback, retValue = null, index;
 
 t.step(function () {
     add_result_callback(function(){
@@ -54,7 +55,12 @@ t.step(function () {
     mcServer = tizen.mediacontroller.createServer();
     mcServer.updatePlaybackState("PLAY");
     mcClientsInfoAll = mcServer.getAllClientsInfo();
-    retValue = mcClientsInfoAll[0].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), successCallback);
+
+    for (index = 0; index < mcClientsInfoAll.length; index++) {
+        if (mcClientsInfoAll[index].name == "apimediact.WebAPITizenMediaKeyTests")
+            break;
+    }
+    retValue = mcClientsInfoAll[index].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), successCallback);
 });
 
 </script>
index 3ff5ab82fb9e7612a1605f333caf876adcf59eb0..993f818f3689de317d1baf34c5765de82aff2f29 100755 (executable)
@@ -36,7 +36,8 @@ Authors:
 
 setup({timeout: 30000});
 
-var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer, mcClientsInfoAll, retValue = null;
+var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer,
+    mcClientsInfoAll, retValue = null, index;
 
 t.step(function () {
     add_result_callback(function(){
@@ -57,7 +58,12 @@ t.step(function () {
     mcServer = tizen.mediacontroller.createServer();
     mcServer.updatePlaybackState("PLAY");
     mcClientsInfoAll = mcServer.getAllClientsInfo();
-    mcClientsInfoAll[0].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), function(){});
+
+    for (index = 0; index < mcClientsInfoAll.length; index++) {
+        if (mcClientsInfoAll[index].name == "apimediact.WebAPITizenMediaKeyTests")
+            break;
+    }
+    mcClientsInfoAll[index].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), function(){});
 });
 
 </script>
index 5b78fa7a6c5382898550f52ada7fd2de00bc2cfa..59a59077d55ed95543ac9df2086f9a3f0462ba8a 100755 (executable)
@@ -36,7 +36,8 @@ Authors:
 
 setup({timeout: 30000});
 
-var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer, mcClientsInfoAll, retValue = null;
+var t = async_test(document.title, {timeout: 30000}), listener, mcClient, mcServer,
+    mcClientsInfoAll, retValue = null, index;
 
 t.step(function () {
     add_result_callback(function(){
@@ -52,7 +53,12 @@ t.step(function () {
     mcServer = tizen.mediacontroller.createServer();
     mcServer.updatePlaybackState("PLAY");
     mcClientsInfoAll = mcServer.getAllClientsInfo();
-    mcClientsInfoAll[0].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), function(){});
+
+    for (index = 0; index < mcClientsInfoAll.length; index++) {
+        if (mcClientsInfoAll[index].name == "apimediact.WebAPITizenMediaKeyTests")
+            break;
+    }
+    mcClientsInfoAll[index].sendEvent("test", new tizen.Bundle({param1: "value1", param2: "value2"}), function(){});
 });
 
 </script>
index 6fc78d355f31954f603d722deaa78a70871e6a13..96d1630bee8673138f8a084499f01ceb17ab3339 100755 (executable)
@@ -35,13 +35,18 @@ Authors:
 //==== TEST_CRITERIA MR
 
 test(function () {
-    var mcServer, mcClient, retValue;
+    var mcServer, mcClient, retValue, i, newArr = new Array();
+
     mcClient = tizen.mediacontroller.getClient();
     mcServer = tizen.mediacontroller.createServer();
     mcServer.updatePlaybackState("PLAY");
     retValue = mcServer.getAllClientsInfo();
     assert_type(retValue, "array", "Invalid type of return value");
-    assert_equals(retValue[0].name, "apimediact.WebAPITizenMediaKeyTests", "invalid value of client name");
+
+    for (i = 0; i < retValue.length; i++) {
+        newArr.push(retValue[i].name);
+    }
+    assert_in_array("apimediact.WebAPITizenMediaKeyTests", newArr, "can not find the client name");
 }, document.title);
 
 </script>