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(){
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>
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(){
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>
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(){
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>
//==== 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>