[Messageport] Fixed listener issues 41/219741/1
authorPiotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 9 Dec 2019 10:26:39 +0000 (11:26 +0100)
committerPiotr Kosko/Native/Web API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 9 Dec 2019 12:54:34 +0000 (13:54 +0100)
commitb3fd4d80857bd5efb4afa38be0956fe41c02f91d
treee94e8493cfd1a59193e6fafd51c963dcf35f6128
parent8558ef7aea21aee58e3bbd95611bbdd9e29143ed
[Messageport] Fixed listener issues

[Bugs]
* There was a problem with missing unregistration of
  listeners for local ports, it was added.
* There was invalid calling of listeners (only latest listener was called),
  now each registered listener is called properly.

[Verification] Messageport TCT passrate 100%.
Below scenario calls 3 different callbacks:

abc = tizen.messageport.requestLocalMessagePort("abc");
abc.addMessagePortListener((data, name) => {console.log(abc.messagePortName + " -> \"" + data + "\" : \"" + name + "\"")} );
abc.addMessagePortListener((data, name) => {console.log("2" + abc.messagePortName + " -> \"" + data + "\" : \"" + name + "\"")} );
abc.addMessagePortListener((data, name) => {console.log("3" + abc.messagePortName + " -> \"" + data + "\" : \"" + name + "\"")} );

abc_remote = tizen.messageport.requestRemoteMessagePort(tizen.application.getCurrentApplication().appInfo.id, "abc");
abc_remote.sendMessage([{key: "key1", value: "val1"}]);

Change-Id: If3a4b362de76599904c83737137c0d0cd4d023c7
src/messageport/messageport_api.js
src/messageport/messageport_instance.cc
src/messageport/messageport_instance.h