From aaedba0a153365ad0ca6d7665da268e942580d26 Mon Sep 17 00:00:00 2001 From: Dimi Lee Date: Tue, 10 Jun 2014 08:52:20 +0200 Subject: [PATCH] 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(-) --- dom/nfc/tests/marionette/test_nfc_tag.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dom/nfc/tests/marionette/test_nfc_tag.js b/dom/nfc/tests/marionette/test_nfc_tag.js index 1e8bf3ec9ebc..f38727fee301 100644 --- a/dom/nfc/tests/marionette/test_nfc_tag.js +++ b/dom/nfc/tests/marionette/test_nfc_tag.js @@ -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(