Bug 1087931 - Remove mozNfc.getNFCTag. r=smaug, dimi
authorYoshi Huang <allstars.chh@mozilla.com>
Thu, 23 Oct 2014 18:36:10 +0800
changeset 212868 236c6e9e724e121f38bd7b2711521d92fcd1271b
parent 212867 627bfb5807ea1093e8a6afa998d921d8770f002a
child 212869 0dc06ccc5ea24393ce9e7ca30f8e3e3ef6667a6e
push id27734
push userryanvm@gmail.com
push dateWed, 29 Oct 2014 20:15:52 +0000
treeherdermozilla-central@8345ae427a3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, dimi
bugs1087931
milestone36.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 1087931 - Remove mozNfc.getNFCTag. r=smaug, dimi From 59396995908ed8a7227dd2b62b07aad0e16e88dc Mon Sep 17 00:00:00 2001 --- dom/nfc/nsNfc.js | 8 -------- dom/nfc/tests/marionette/test_nfc_peer.js | 15 +-------------- dom/webidl/MozNFC.webidl | 5 ----- 3 files changed, 1 insertion(+), 27 deletions(-)
dom/nfc/nsNfc.js
dom/nfc/tests/marionette/test_nfc_peer.js
dom/webidl/MozNFC.webidl
--- a/dom/nfc/nsNfc.js
+++ b/dom/nfc/nsNfc.js
@@ -162,24 +162,16 @@ mozNfc.prototype = {
   stopPoll: function stopPoll() {
     return this._nfcContentHelper.stopPoll(this._window);
   },
 
   powerOff: function powerOff() {
     return this._nfcContentHelper.powerOff(this._window);
   },
 
-  getNFCTag: function getNFCTag(sessionToken) {
-    let obj = new MozNFCTag(this._window, sessionToken);
-    if (this._nfcContentHelper.checkSessionToken(sessionToken)) {
-      return this._window.MozNFCTag._create(this._window, obj);
-    }
-    return null;
-  },
-
   getNFCPeer: function getNFCPeer(sessionToken) {
     if (!sessionToken || !this._nfcContentHelper.checkSessionToken(sessionToken)) {
       return null;
     }
 
     if (!this.nfcObject || this.nfcObject.session != sessionToken) {
       let obj = new MozNFCPeer(this._window, sessionToken);
       this.nfcObject = obj;
--- a/dom/nfc/tests/marionette/test_nfc_peer.js
+++ b/dom/nfc/tests/marionette/test_nfc_peer.js
@@ -186,34 +186,21 @@ function testPeerShouldThrow() {
 function testPeerInvalidToken() {
   log("testPeerInvalidToken");
   let peer = nfc.getNFCPeer("fakeSessionToken");
   is(peer, null, "NFCPeer should be null on wrong session token");
 
   runNextTest();
 }
 
-/**
- * Added for completeness in Bug 1042651,
- * TODO: remove once Bug 963531 lands
- */
-function testTagInvalidToken() {
-  log("testTagInvalidToken");
-  let tag = nfc.getNFCTag("fakeSessionToken");
-  is(tag, null, "NFCTag should be null on wrong session token");
-
-  runNextTest();
-}
-
 let tests = [
   testPeerReady,
   testGetNFCPeer,
   testCheckP2PRegFailure,
   testPeerLostShouldBeCalled,
   testPeerLostShouldNotBeCalled,
   testPeerShouldThrow,
-  testPeerInvalidToken,
-  testTagInvalidToken
+  testPeerInvalidToken
 ];
 
 SpecialPowers.pushPermissions(
   [{"type": "nfc-manager", "allow": true, context: document},
    {"type": "nfc-write", "allow": true, context: document}], runTests);
--- a/dom/webidl/MozNFC.webidl
+++ b/dom/webidl/MozNFC.webidl
@@ -49,21 +49,16 @@ interface MozNFCManager {
 
 [JSImplementation="@mozilla.org/navigatorNfc;1",
  NavigatorProperty="mozNfc",
  Func="Navigator::HasNFCSupport",
  CheckPermissions="nfc-read nfc-write",
  AvailableIn="CertifiedApps"]
 interface MozNFC : EventTarget {
   /**
-   * Returns MozNFCTag object or null in case of invalid sessionToken
-   */
-  MozNFCTag? getNFCTag(DOMString sessionToken);
-
-  /**
    * Returns MozNFCPeer object or null in case of invalid sessionToken
    */
   MozNFCPeer? getNFCPeer(DOMString sessionToken);
 
   /**
    * This event will be fired when another NFCPeer is detected, and user confirms
    * to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P.
    * The event will be type of NFCPeerEvent.