mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1034474 - B2G NFC: onpeerlost is never called. r=dimi
From 6342cf34f7493711317b613a8e30ef6badabcfd1 Mon Sep 17 00:00:00 2001 --- dom/nfc/tests/marionette/test_nfc_peer.js | 10 +++++++++- dom/system/gonk/Nfc.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-)
This commit is contained in:
parent
216da66080
commit
ccf57a1dbf
@ -12,8 +12,15 @@ function peerReadyCb(evt) {
|
||||
let peer = nfc.getNFCPeer(evt.detail);
|
||||
ok(peer instanceof MozNFCPeer, "Should get a NFCPeer object.");
|
||||
|
||||
// reset callback and NFC Hardware.
|
||||
// reset callback.
|
||||
nfc.onpeerready = null;
|
||||
emulator.deactivate();
|
||||
}
|
||||
|
||||
function peerLostCb() {
|
||||
log("peerLostCb called");
|
||||
ok(true);
|
||||
nfc.onpeerlost = null;
|
||||
toggleNFC(false).then(runNextTest);
|
||||
}
|
||||
|
||||
@ -23,6 +30,7 @@ function handleTechnologyDiscoveredRE0(msg) {
|
||||
is(msg.techList[0], "P2P", "check for correct tech type");
|
||||
|
||||
nfc.onpeerready = peerReadyCb;
|
||||
nfc.onpeerlost = peerLostCb;
|
||||
|
||||
let request = nfc.checkP2PRegistration(MANIFEST_URL);
|
||||
request.onsuccess = function (evt) {
|
||||
|
@ -286,7 +286,7 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
|
||||
isRegisteredP2PTarget: function isRegisteredP2PTarget(appId, event) {
|
||||
let targetInfo = this.peerTargetsMap[appId];
|
||||
// Check if it is a registered target for the 'event'
|
||||
return ((targetInfo != null) && (targetInfo.event & event !== 0));
|
||||
return ((targetInfo != null) && ((targetInfo.event & event) !== 0));
|
||||
},
|
||||
|
||||
notifyPeerEvent: function notifyPeerEvent(appId, event) {
|
||||
@ -527,7 +527,7 @@ Nfc.prototype = {
|
||||
|
||||
gSystemMessenger.broadcastMessage("nfc-manager-tech-lost", message);
|
||||
// Notify 'PeerLost' to appropriate registered target, if any
|
||||
gMessageManager.notifyPeerEvent(this.currentPeerAppId, NFC.NFC_PEER_EVENT_LOST);
|
||||
gMessageManager.notifyPeerEvent(gMessageManager.currentPeerAppId, NFC.NFC_PEER_EVENT_LOST);
|
||||
delete this.sessionTokenMap[this._currentSessionId];
|
||||
this._currentSessionId = null;
|
||||
this.currentPeerAppId = null;
|
||||
|
Loading…
Reference in New Issue
Block a user