Bug 1022534 - [NFC] Fix marionette web-api test test_nfc_tag.js to use Promise in toggleNFC, r=allstars.chh
authorKrzysztof Mioduszewski <kmioduszewski@gmail.com>
Mon, 09 Jun 2014 11:25:40 +0200
changeset 206804 9aa6e1d3a2bf17c7c7d17e3a8b670a152442cd3c
parent 206803 a73938f0d82cf689d818191d8ff7171de7801186
child 206805 4da7bc261b89e9905a7913f8a873fc54d5ffac48
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars
bugs1022534
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1022534 - [NFC] Fix marionette web-api test test_nfc_tag.js to use Promise in toggleNFC, r=allstars.chh
dom/nfc/tests/marionette/test_nfc_tag.js
--- a/dom/nfc/tests/marionette/test_nfc_tag.js
+++ b/dom/nfc/tests/marionette/test_nfc_tag.js
@@ -51,23 +51,22 @@ function testUrlTagDiscover() {
 
     let records = msg.records;
     ok(records.length > 0);
 
     is(tnf, records[0].tnf, "check for TNF field in NDEF");
     is(type, NfcUtils.toUTF8(records[0].type), "check for type field in NDEF");
     is(payload, NfcUtils.toUTF8(records[0].payload), "check for payload field in NDEF");
 
-    toggleNFC(false, runNextTest);
+    toggleNFC(false).then(runNextTest);
   });
 
-  toggleNFC(true, function() {
-    setTagData(T2T_RE_INDEX, flag, tnf, btoa(type), btoa(payload))
-    .then(() => activateRE(T2T_RE_INDEX));
-  });
+  toggleNFC(true)
+  .then(() => setTagData(T2T_RE_INDEX, flag, tnf, btoa(type), btoa(payload)))
+  .then(() => activateRE(T2T_RE_INDEX));
 }
 
 let tests = [
   testUrlTagDiscover
 ];
 
 SpecialPowers.pushPermissions(
   [{'type': 'nfc-manager', 'allow': true, context: document}], runTests);