Bug 1034660 - Exchange NDEF's PAYLOAD and ID fields in emulator interface. r=dlee

The emulator used PAYLOAD and ID fields of NDEF records in an incorrect
order. The fix makes the command-line interface incompatible with the
current test cases. This patch adapts the test cases by putting ID before
PAYLOAD.
This commit is contained in:
Thomas Zimmermann 2014-07-09 06:27:00 -04:00
Родитель 2852561dc1
Коммит 18e6c62799
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -95,7 +95,7 @@ let TAG = (function() {
function setData(re, flag, tnf, type, payload) {
let deferred = Promise.defer();
let cmd = "nfc tag set " + re +
" [" + flag + "," + tnf + "," + type + "," + payload + ",]";
" [" + flag + "," + tnf + "," + type + ",," + payload + "]";
emulator.run(cmd, function(result) {
is(result.pop(), "OK", "set NDEF data of tag" + re);
@ -122,13 +122,13 @@ let TAG = (function() {
}());
let SNEP = (function() {
function put(dsap, ssap, flags, tnf, type, payload, id) {
function put(dsap, ssap, flags, tnf, type, id, payload) {
let deferred = Promise.defer();
let cmd = "nfc snep put " + dsap + " " + ssap + " [" + flags + "," +
tnf + "," +
type + "," +
payload + "," +
id + "]";
id + "," +
payload + "]";
emulator.run(cmd, function(result) {
is(result.pop(), "OK", "send SNEP PUT");
deferred.resolve();

Просмотреть файл

@ -6,8 +6,8 @@ MARIONETTE_HEAD_JS = 'head.js';
let tnf = NDEF.TNF_WELL_KNOWN;
let type = "U";
let payload = "https://www.example.com";
let id = "";
let payload = "https://www.example.com";
let ndef = null;
@ -35,7 +35,7 @@ function testReceiveNDEF() {
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => SNEP.put(SNEP.SAP_NDEF, SNEP.SAP_NDEF, 0, tnf, btoa(type),
btoa(payload), btoa(id)));
btoa(id), btoa(payload)));
}
let tests = [