From: qunfang.lin Date: Fri, 22 Nov 2019 03:50:06 +0000 (+0800) Subject: [common][mediacontroller][DPTTIZEN-3166,fix 4 mediacontroller client TCs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab9d68321ca1ffd33a8c3b1df9e7f99ef992b787;p=test%2Ftct%2Fweb%2Fapi.git [common][mediacontroller][DPTTIZEN-3166,fix 4 mediacontroller client TCs] -modify: 4 TCs Change-Id: Ic6eb510951edffb9a317a4207bd2b92221d90285 Signed-off-by: qunfang.lin --- diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClientInfo_sendEvent.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClientInfo_sendEvent.html index 128abbb31..0b4cc6d2f 100755 --- a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClientInfo_sendEvent.html +++ b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClientInfo_sendEvent.html @@ -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); }); diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_setCustomEventListener.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_setCustomEventListener.html index 3ff5ab82f..993f818f3 100755 --- a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_setCustomEventListener.html +++ b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_setCustomEventListener.html @@ -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(){}); }); diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_unsetCustomEventListener.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_unsetCustomEventListener.html index 5b78fa7a6..59a59077d 100755 --- a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_unsetCustomEventListener.html +++ b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerClient_unsetCustomEventListener.html @@ -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(){}); }); diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_getAllClientsInfo.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_getAllClientsInfo.html index 6fc78d355..96d1630be 100755 --- a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_getAllClientsInfo.html +++ b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_getAllClientsInfo.html @@ -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);