Bug 1016777 - Testcase for reading NDEF data from type 1 tag.

From 4bd160a590ab40916b83eeb48eba7dca0b3f7313 Mon Sep 17 00:00:00 2001
 r=tzimmermann
---
 dom/nfc/tests/marionette/test_nfc_tag.js |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
This commit is contained in:
Dimi Lee 2014-06-10 08:52:20 +02:00
Родитель 83678209fb
Коммит aaedba0a15
1 изменённых файлов: 15 добавлений и 5 удалений

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

@ -7,7 +7,8 @@ MARIONETTE_HEAD_JS = "head.js";
let url = "http://www.mozilla.org";
// TODO : Get this from emulator console command.
const T2T_RE_INDEX = 2;
const T1T_RE_INDEX = 2;
const T2T_RE_INDEX = 3;
function activateRE(re) {
let deferred = Promise.defer();
@ -35,7 +36,7 @@ function setTagData(re, flag, tnf, type, payload) {
return deferred.promise;
}
function testUrlTagDiscover() {
function testUrlTagDiscover(re) {
log("Running \'testUrlTagDiscover\'");
// TODO : Make flag value readable.
let flag = 0xd0;
@ -60,12 +61,21 @@ function testUrlTagDiscover() {
});
toggleNFC(true)
.then(() => setTagData(T2T_RE_INDEX, flag, tnf, btoa(type), btoa(payload)))
.then(() => activateRE(T2T_RE_INDEX));
.then(() => setTagData(re, flag, tnf, btoa(type), btoa(payload)))
.then(() => activateRE(re));
}
function testUrlT1TDiscover() {
testUrlTagDiscover(T1T_RE_INDEX);
}
function testUrlT2TDiscover() {
testUrlTagDiscover(T2T_RE_INDEX);
}
let tests = [
testUrlTagDiscover
testUrlT1TDiscover,
testUrlT2TDiscover
];
SpecialPowers.pushPermissions(