Bug 1028046 - NFC testcase failure with error message "setTagData undefined". r=yoshi

This commit is contained in:
Dimi Lee 2014-06-20 16:41:07 +08:00
parent 973ba72400
commit def0bdbf3c
2 changed files with 4 additions and 16 deletions

View File

@ -59,30 +59,18 @@ function handleTechnologyDiscoveredRE0ForP2PRegFailure(msg) {
}
}
function activateRE(re) {
let deferred = Promise.defer();
let cmd = "nfc nci rf_intf_activated_ntf " + re;
emulator.run(cmd, function(result) {
is(result.pop(), "OK", "check activation of RE" + re);
deferred.resolve();
});
return deferred.promise;
}
function testPeerReady() {
window.navigator.mozSetMessageHandler(
"nfc-manager-tech-discovered", handleTechnologyDiscoveredRE0);
toggleNFC(true).then(() => activateRE(0));
toggleNFC(true).then(() => emulator.activateRE(0));
}
function testCheckP2PRegFailure() {
window.navigator.mozSetMessageHandler(
"nfc-manager-tech-discovered", handleTechnologyDiscoveredRE0ForP2PRegFailure);
toggleNFC(true).then(() => activateRE(0));
toggleNFC(true).then(() => emulator.activateRE(0));
}
function testCheckNfcPeerObjForInvalidToken() {

View File

@ -35,8 +35,8 @@ function testUrlTagDiscover(re) {
});
toggleNFC(true)
.then(() => setTagData(re, flag, tnf, btoa(type), btoa(payload)))
.then(() => activateRE(re));
.then(() => emulator.setTagData(re, flag, tnf, btoa(type), btoa(payload)))
.then(() => emulator.activateRE(re));
}
function testUrlT1TDiscover() {