Bug 1306778 - Remove DOM/tv and related code. r=jst draft
authorMichelangelo De Simone <mdesimone@mozilla.com>
Fri, 30 Sep 2016 16:38:03 -0700
changeset 424942 8ed0967556ee709fb7ca00713d29049a4515f1c7
parent 424914 7452437b3ab571b1d60aed4e973d82a1471f72b2
child 533802 a386fbef934f15237ae38543a34ddd4ec3545ad5
push id32296
push usermdesimone@mozilla.com
push dateThu, 13 Oct 2016 20:45:19 +0000
reviewersjst
bugs1306778
milestone52.0a1
Bug 1306778 - Remove DOM/tv and related code. r=jst MozReview-Commit-ID: 25Mch3xznlh
browser/installer/package-manifest.in
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/events/test/test_all_synthetic_events.html
dom/moz.build
dom/tv/TVChannel.cpp
dom/tv/TVChannel.h
dom/tv/TVListeners.cpp
dom/tv/TVListeners.h
dom/tv/TVManager.cpp
dom/tv/TVManager.h
dom/tv/TVProgram.cpp
dom/tv/TVProgram.h
dom/tv/TVServiceCallbacks.cpp
dom/tv/TVServiceCallbacks.h
dom/tv/TVServiceFactory.cpp
dom/tv/TVServiceFactory.h
dom/tv/TVServiceRunnables.h
dom/tv/TVSimulatorService.js
dom/tv/TVSimulatorService.manifest
dom/tv/TVSource.cpp
dom/tv/TVSource.h
dom/tv/TVTuner.cpp
dom/tv/TVTuner.h
dom/tv/TVTypes.cpp
dom/tv/TVTypes.h
dom/tv/TVUtils.h
dom/tv/moz.build
dom/tv/nsITVService.idl
dom/tv/nsITVSimulatorService.idl
dom/tv/test/mochitest/chrome.ini
dom/tv/test/mochitest/head.js
dom/tv/test/mochitest/mochitest.ini
dom/tv/test/mochitest/mock_data.json
dom/tv/test/mochitest/test_tv_get_channels.html
dom/tv/test/mochitest/test_tv_get_channels_during_scanning.html
dom/tv/test/mochitest/test_tv_get_current_program.html
dom/tv/test/mochitest/test_tv_get_programs.html
dom/tv/test/mochitest/test_tv_get_sources.html
dom/tv/test/mochitest/test_tv_get_tuners.html
dom/tv/test/mochitest/test_tv_non_permitted_app.html
dom/tv/test/mochitest/test_tv_permitted_app.html
dom/tv/test/mochitest/test_tv_scan_channels_completed.html
dom/tv/test/mochitest/test_tv_scan_channels_stopped.html
dom/tv/test/mochitest/test_tv_set_current_channel.html
dom/tv/test/mochitest/test_tv_set_current_channel_during_scanning.html
dom/tv/test/mochitest/test_tv_set_current_source.html
dom/tv/test/mochitest/test_tv_set_invalid_current_channel.html
dom/tv/test/mochitest/test_tv_set_invalid_current_source.html
dom/tv/test/xpcshell/test_tv_channel_data.js
dom/tv/test/xpcshell/test_tv_program_data.js
dom/tv/test/xpcshell/test_tv_tuner_data.js
dom/tv/test/xpcshell/xpcshell.ini
dom/webidl/Navigator.webidl
dom/webidl/TVChannel.webidl
dom/webidl/TVCurrentChannelChangedEvent.webidl
dom/webidl/TVCurrentSourceChangedEvent.webidl
dom/webidl/TVEITBroadcastedEvent.webidl
dom/webidl/TVManager.webidl
dom/webidl/TVProgram.webidl
dom/webidl/TVScanningStateChangedEvent.webidl
dom/webidl/TVSource.webidl
dom/webidl/TVTuner.webidl
dom/webidl/moz.build
layout/build/nsLayoutModule.cpp
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -208,17 +208,16 @@
 @RESPATH@/components/dom_settings.xpt
 @RESPATH@/components/dom_permissionsettings.xpt
 @RESPATH@/components/dom_sidebar.xpt
 @RESPATH@/components/dom_mobilemessage.xpt
 @RESPATH@/components/dom_storage.xpt
 @RESPATH@/components/dom_stylesheets.xpt
 @RESPATH@/components/dom_telephony.xpt
 @RESPATH@/components/dom_traversal.xpt
-@RESPATH@/components/dom_tv.xpt
 @RESPATH@/components/dom_voicemail.xpt
 #ifdef MOZ_WEBSPEECH
 @RESPATH@/components/dom_webspeechrecognition.xpt
 #endif
 @RESPATH@/components/dom_workers.xpt
 @RESPATH@/components/dom_xbl.xpt
 @RESPATH@/components/dom_xhr.xpt
 @RESPATH@/components/dom_xpath.xpt
@@ -534,19 +533,16 @@
 @RESPATH@/components/PushComponents.js
 
 @RESPATH@/components/remotebrowserutils.manifest
 @RESPATH@/components/RemoteWebNavigation.js
 
 @RESPATH@/components/SlowScriptDebug.manifest
 @RESPATH@/components/SlowScriptDebug.js
 
-@RESPATH@/components/TVSimulatorService.js
-@RESPATH@/components/TVSimulatorService.manifest
-
 #ifdef MOZ_WEBRTC
 @RESPATH@/components/PeerConnection.js
 @RESPATH@/components/PeerConnection.manifest
 #endif
 
 @RESPATH@/chrome/marionette@JAREXT@
 @RESPATH@/chrome/marionette.manifest
 @RESPATH@/components/MarionetteComponents.manifest
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -45,17 +45,16 @@
 #include "mozilla/dom/MobileMessageManager.h"
 #include "mozilla/dom/Permissions.h"
 #include "mozilla/dom/Presentation.h"
 #include "mozilla/dom/ServiceWorkerContainer.h"
 #include "mozilla/dom/StorageManager.h"
 #include "mozilla/dom/TCPSocket.h"
 #include "mozilla/dom/Telephony.h"
 #include "mozilla/dom/Voicemail.h"
-#include "mozilla/dom/TVManager.h"
 #include "mozilla/dom/VRDisplay.h"
 #include "mozilla/dom/workers/RuntimeService.h"
 #include "mozilla/Hal.h"
 #include "nsISiteSpecificUserAgent.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "Connection.h"
 #include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
@@ -217,17 +216,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIccManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileMessageManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTVManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInputPortManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageManager)
 #ifdef MOZ_B2G_RIL
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileConnections)
 #endif
 #ifdef MOZ_B2G_BT
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBluetooth)
@@ -307,20 +305,16 @@ Navigator::Invalidate()
     mTelephony = nullptr;
   }
 
   if (mVoicemail) {
     mVoicemail->Shutdown();
     mVoicemail = nullptr;
   }
 
-  if (mTVManager) {
-    mTVManager = nullptr;
-  }
-
   if (mInputPortManager) {
     mInputPortManager = nullptr;
   }
 
   if (mConnection) {
     mConnection->Shutdown();
     mConnection = nullptr;
   }
@@ -1669,29 +1663,16 @@ Navigator::GetMozTelephony(ErrorResult& 
       return nullptr;
     }
     mTelephony = Telephony::Create(mWindow, aRv);
   }
 
   return mTelephony;
 }
 
-TVManager*
-Navigator::GetTv()
-{
-  if (!mTVManager) {
-    if (!mWindow) {
-      return nullptr;
-    }
-    mTVManager = TVManager::Create(mWindow);
-  }
-
-  return mTVManager;
-}
-
 InputPortManager*
 Navigator::GetInputPortManager(ErrorResult& aRv)
 {
   if (!mInputPortManager) {
     if (!mWindow) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -83,17 +83,16 @@ class BluetoothManager;
 #ifdef MOZ_B2G_RIL
 class MobileConnectionArray;
 #endif
 
 class PowerManager;
 class IccManager;
 class Telephony;
 class Voicemail;
-class TVManager;
 class InputPortManager;
 class DeviceStorageAreaListener;
 class Presentation;
 class LegacyMozTCPSocket;
 class VRDisplay;
 class StorageManager;
 
 namespace time {
@@ -223,17 +222,16 @@ public:
   GetDeviceStorageByNameAndType(const nsAString& aName, const nsAString& aType,
                                 ErrorResult& aRv);
 
   DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
   IccManager* GetMozIccManager(ErrorResult& aRv);
   MobileMessageManager* GetMozMobileMessage();
   Telephony* GetMozTelephony(ErrorResult& aRv);
   Voicemail* GetMozVoicemail(ErrorResult& aRv);
-  TVManager* GetTv();
   InputPortManager* GetInputPortManager(ErrorResult& aRv);
   already_AddRefed<LegacyMozTCPSocket> MozTCPSocket();
   network::Connection* GetConnection(ErrorResult& aRv);
   nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
   MediaDevices* GetMediaDevices(ErrorResult& aRv);
 
 #ifdef MOZ_B2G_RIL
   MobileConnectionArray* GetMozMobileConnections(ErrorResult& aRv);
@@ -333,17 +331,16 @@ private:
   RefPtr<DesktopNotificationCenter> mNotification;
   RefPtr<battery::BatteryManager> mBatteryManager;
   RefPtr<Promise> mBatteryPromise;
   RefPtr<PowerManager> mPowerManager;
   RefPtr<IccManager> mIccManager;
   RefPtr<MobileMessageManager> mMobileMessageManager;
   RefPtr<Telephony> mTelephony;
   RefPtr<Voicemail> mVoicemail;
-  RefPtr<TVManager> mTVManager;
   RefPtr<InputPortManager> mInputPortManager;
   RefPtr<network::Connection> mConnection;
 #ifdef MOZ_B2G_RIL
   RefPtr<MobileConnectionArray> mMobileConnections;
 #endif
 #ifdef MOZ_B2G_BT
   RefPtr<bluetooth::BluetoothManager> mBluetooth;
 #endif
--- a/dom/events/test/test_all_synthetic_events.html
+++ b/dom/events/test/test_all_synthetic_events.html
@@ -555,48 +555,16 @@ const kEventConstructors = {
   TrackEvent:                                { create: function (aName, aProps) {
                                                          return new TrackEvent(aName, aProps);
                                                        },
                                              },
   TransitionEvent:                           { create: function (aName, aProps) {
                                                          return new TransitionEvent(aName, aProps);
                                                        },
                                              },
-  TVCurrentChannelChangedEvent:              { create: function (aName, aProps) {
-                                                         return new TVCurrentChannelChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVCurrentProgramChangedEvent:              { create: function (aName, aProps) {
-                                                         return new TVCurrentProgramChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVCurrentSourceChangedEvent:               { create: function (aName, aProps) {
-                                                         return new TVCurrentSourceChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVEITBroadcastedEvent:                     { create: function (aName, aProps) {
-                                                         return new TVEITBroadcastedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVParentalControlChangedEvent:             { create: function (aName, aProps) {
-                                                         return new TVParentalControlChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVProtectionStateChangedEvent:             { create: function (aName, aProps) {
-                                                         return new TVProtectionStateChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVScanningStateChangedEvent:               { create: function (aName, aProps) {
-                                                         return new TVScanningStateChangedEvent(aName, aProps);
-                                                       },
-                                             },
-  TVTunerChangedEvent:                       { create: function (aName, aProps) {
-                                                         return new TVTunerChangedEvent(aName, aProps);
-                                                       },
-                                             },
   UIEvent:                                   { create: function (aName, aProps) {
                                                          return new UIEvent(aName, aProps);
                                                        },
                                              },
   UserProximityEvent:                        { create: function (aName, aProps) {
                                                          return new UserProximityEvent(aName, aProps);
                                                        },
                                              },
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -91,17 +91,16 @@ DIRS += [
     'workers',
     'camera',
     'audiochannel',
     'broadcastchannel',
     'messagechannel',
     'promise',
     'smil',
     'telephony',
-    'tv',
     'url',
     'voicemail',
     'inputmethod',
     'webidl',
     'xbl',
     'xml',
     'xslt',
     'xul',
deleted file mode 100644
--- a/dom/tv/TVChannel.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/TVServiceCallbacks.h"
-#include "mozilla/dom/TVServiceFactory.h"
-#include "mozilla/dom/TVSource.h"
-#include "mozilla/dom/TVTuner.h"
-#include "mozilla/dom/TVUtils.h"
-#include "nsITVService.h"
-#include "nsServiceManagerUtils.h"
-#include "TVChannel.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(TVChannel, DOMEventTargetHelper,
-                                   mTVService, mSource)
-
-NS_IMPL_ADDREF_INHERITED(TVChannel, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(TVChannel, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TVChannel)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-TVChannel::TVChannel(nsPIDOMWindowInner* aWindow,
-                     TVSource* aSource)
-  : DOMEventTargetHelper(aWindow)
-  , mSource(aSource)
-{
-  MOZ_ASSERT(mSource);
-}
-
-TVChannel::~TVChannel()
-{
-}
-
-/* static */ already_AddRefed<TVChannel>
-TVChannel::Create(nsPIDOMWindowInner* aWindow,
-                  TVSource* aSource,
-                  nsITVChannelData* aData)
-{
-  RefPtr<TVChannel> channel = new TVChannel(aWindow, aSource);
-  return (channel->Init(aData)) ? channel.forget() : nullptr;
-}
-
-bool
-TVChannel::Init(nsITVChannelData* aData)
-{
-  NS_ENSURE_TRUE(aData, false);
-
-  nsString channelType;
-  aData->GetType(channelType);
-  mType = ToTVChannelType(channelType);
-  if (NS_WARN_IF(mType == TVChannelType::EndGuard_)) {
-    return false;
-  }
-
-  aData->GetNetworkId(mNetworkId);
-  aData->GetTransportStreamId(mTransportStreamId);
-  aData->GetServiceId(mServiceId);
-  aData->GetName(mName);
-  aData->GetNumber(mNumber);
-  mIsEmergency = aData->GetIsEmergency();
-  mIsFree = aData->GetIsFree();
-
-  mTVService = TVServiceFactory::AutoCreateTVService();
-  NS_ENSURE_TRUE(mTVService, false);
-
-  return true;
-}
-
-/* virtual */ JSObject*
-TVChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return TVChannelBinding::Wrap(aCx, this, aGivenProto);
-}
-
-nsresult
-TVChannel::DispatchTVEvent(nsIDOMEvent* aEvent)
-{
-  return DispatchTrustedEvent(aEvent);
-}
-
-already_AddRefed<Promise>
-TVChannel::GetPrograms(const TVGetProgramsOptions& aOptions, ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  RefPtr<TVTuner> tuner = mSource->Tuner();
-  nsString tunerId;
-  tuner->GetId(tunerId);
-
-  uint64_t startTime = aOptions.mStartTime.WasPassed() ?
-                       aOptions.mStartTime.Value() :
-                       PR_Now();
-  uint64_t endTime = aOptions.mDuration.WasPassed() ?
-                     (startTime + aOptions.mDuration.Value()) :
-                     std::numeric_limits<uint64_t>::max();
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceProgramGetterCallback(this, promise, false);
-  nsresult rv =
-    mTVService->GetPrograms(tunerId,
-                            ToTVSourceTypeStr(mSource->Type()),
-                            mNumber,
-                            startTime,
-                            endTime,
-                            callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-void
-TVChannel::GetNetworkId(nsAString& aNetworkId) const
-{
-  aNetworkId = mNetworkId;
-}
-
-void
-TVChannel::GetTransportStreamId(nsAString& aTransportStreamId) const
-{
-  aTransportStreamId = mTransportStreamId;
-}
-
-void
-TVChannel::GetServiceId(nsAString& aServiceId) const
-{
-  aServiceId = mServiceId;
-}
-
-already_AddRefed<TVSource>
-TVChannel::Source() const
-{
-  RefPtr<TVSource> source = mSource;
-  return source.forget();
-}
-
-TVChannelType
-TVChannel::Type() const
-{
-  return mType;
-}
-
-void
-TVChannel::GetName(nsAString& aName) const
-{
-  aName = mName;
-}
-
-void
-TVChannel::GetNumber(nsAString& aNumber) const
-{
-  aNumber = mNumber;
-}
-
-bool
-TVChannel::IsEmergency() const
-{
-  return mIsEmergency;
-}
-
-bool
-TVChannel::IsFree() const
-{
-  return mIsFree;
-}
-
-already_AddRefed<Promise>
-TVChannel::GetCurrentProgram(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (aRv.Failed()) {
-    return nullptr;
-  }
-
-  RefPtr<TVTuner> tuner = mSource->Tuner();
-  nsString tunerId;
-  tuner->GetId(tunerId);
-
-  // Get only one program from now on.
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceProgramGetterCallback(this, promise, true);
-  nsresult rv =
-    mTVService->GetPrograms(tunerId,
-                            ToTVSourceTypeStr(mSource->Type()),
-                            mNumber,
-                            PR_Now(),
-                            std::numeric_limits<uint64_t>::max(),
-                            callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVChannel.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVChannel_h
-#define mozilla_dom_TVChannel_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-// Include TVChannelBinding.h since enum TVChannelType can't be forward declared.
-#include "mozilla/dom/TVChannelBinding.h"
-
-class nsITVChannelData;
-class nsITVService;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class TVSource;
-
-class TVChannel final : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TVChannel, DOMEventTargetHelper)
-
-  static already_AddRefed<TVChannel>
-  Create(nsPIDOMWindowInner* aWindow,
-         TVSource* aSource,
-         nsITVChannelData* aData);
-
-  // WebIDL (internal functions)
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  nsresult DispatchTVEvent(nsIDOMEvent* aEvent);
-
-  // WebIDL (public APIs)
-
-  already_AddRefed<Promise> GetPrograms(const TVGetProgramsOptions& aOptions,
-                                        ErrorResult& aRv);
-
-  already_AddRefed<Promise> GetCurrentProgram(ErrorResult& aRv);
-
-  void GetNetworkId(nsAString& aNetworkId) const;
-
-  void GetTransportStreamId(nsAString& aTransportStreamId) const;
-
-  void GetServiceId(nsAString& aServiceId) const;
-
-  already_AddRefed<TVSource> Source() const;
-
-  TVChannelType Type() const;
-
-  void GetName(nsAString& aName) const;
-
-  void GetNumber(nsAString& aNumber) const;
-
-  bool IsEmergency() const;
-
-  bool IsFree() const;
-
-private:
-  TVChannel(nsPIDOMWindowInner* aWindow,
-            TVSource* aSource);
-
-  ~TVChannel();
-
-  bool Init(nsITVChannelData* aData);
-
-  nsCOMPtr<nsITVService> mTVService;
-  RefPtr<TVSource> mSource;
-  nsString mNetworkId;
-  nsString mTransportStreamId;
-  nsString mServiceId;
-  TVChannelType mType;
-  nsString mNumber;
-  nsString mName;
-  bool mIsEmergency;
-  bool mIsFree;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVChannel_h
deleted file mode 100644
--- a/dom/tv/TVListeners.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/TVSource.h"
-#include "mozilla/dom/TVTuner.h"
-#include "mozilla/dom/TVUtils.h"
-#include "TVListeners.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION(TVSourceListener, mSources)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVSourceListener)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVSourceListener)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVSourceListener)
-  NS_INTERFACE_MAP_ENTRY(nsITVSourceListener)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-void
-TVSourceListener::RegisterSource(TVSource* aSource)
-{
-  mSources.AppendElement(aSource);
-}
-
-void
-TVSourceListener::UnregisterSource(TVSource* aSource)
-{
-  for (uint32_t i = 0; i < mSources.Length(); i++) {
-    if (mSources[i] == aSource) {
-      mSources.RemoveElementsAt(i, 1);
-    }
-  }
-}
-
-NS_IMETHODIMP
-TVSourceListener::NotifyChannelScanned(const nsAString& aTunerId,
-                                       const nsAString& aSourceType,
-                                       nsITVChannelData* aChannelData)
-{
-  RefPtr<TVSource> source = GetSource(aTunerId, aSourceType);
-  source->NotifyChannelScanned(aChannelData);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVSourceListener::NotifyChannelScanComplete(const nsAString& aTunerId,
-                                            const nsAString& aSourceType)
-{
-  RefPtr<TVSource> source = GetSource(aTunerId, aSourceType);
-  source->NotifyChannelScanComplete();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVSourceListener::NotifyChannelScanStopped(const nsAString& aTunerId,
-                                           const nsAString& aSourceType)
-{
-  RefPtr<TVSource> source = GetSource(aTunerId, aSourceType);
-  source->NotifyChannelScanStopped();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVSourceListener::NotifyEITBroadcasted(const nsAString& aTunerId,
-                                       const nsAString& aSourceType,
-                                       nsITVChannelData* aChannelData,
-                                       nsITVProgramData** aProgramDataList,
-                                       const uint32_t aCount)
-{
-  RefPtr<TVSource> source = GetSource(aTunerId, aSourceType);
-  source->NotifyEITBroadcasted(aChannelData, aProgramDataList, aCount);
-  return NS_OK;
-}
-
-already_AddRefed<TVSource>
-TVSourceListener::GetSource(const nsAString& aTunerId,
-                            const nsAString& aSourceType)
-{
-  for (uint32_t i = 0; i < mSources.Length(); i++) {
-    nsString tunerId;
-    RefPtr<TVTuner> tuner = mSources[i]->Tuner();
-    tuner->GetId(tunerId);
-
-    nsString sourceType = ToTVSourceTypeStr(mSources[i]->Type());
-
-    if (aTunerId.Equals(tunerId) && aSourceType.Equals(sourceType)) {
-      RefPtr<TVSource> source = mSources[i];
-      return source.forget();
-    }
-  }
-
-  return nullptr;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVListeners.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVListeners_h
-#define mozilla_dom_TVListeners_h
-
-#include "mozilla/dom/TVSource.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsITVService.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class TVSourceListener final : public nsITVSourceListener
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVSourceListener)
-  NS_DECL_NSITVSOURCELISTENER
-
-  void RegisterSource(TVSource* aSource);
-
-  void UnregisterSource(TVSource* aSource);
-
-private:
-  ~TVSourceListener() {}
-
-  already_AddRefed<TVSource> GetSource(const nsAString& aTunerId,
-                                       const nsAString& aSourceType);
-
-  nsTArray<RefPtr<TVSource>> mSources;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVListeners_h
deleted file mode 100644
--- a/dom/tv/TVManager.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/TVManagerBinding.h"
-#include "mozilla/dom/TVServiceCallbacks.h"
-#include "mozilla/dom/TVServiceFactory.h"
-#include "mozilla/dom/TVTuner.h"
-#include "nsITVService.h"
-#include "nsServiceManagerUtils.h"
-#include "TVManager.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(TVManager, DOMEventTargetHelper, mTVService,
-                                   mTuners, mPendingGetTunersPromises)
-
-NS_IMPL_ADDREF_INHERITED(TVManager, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(TVManager, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TVManager)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-TVManager::TVManager(nsPIDOMWindowInner* aWindow)
-  : DOMEventTargetHelper(aWindow)
-  , mIsReady(false)
-{
-}
-
-TVManager::~TVManager()
-{
-}
-
-/* static */ already_AddRefed<TVManager>
-TVManager::Create(nsPIDOMWindowInner* aWindow)
-{
-  RefPtr<TVManager> manager = new TVManager(aWindow);
-  return (manager->Init()) ? manager.forget() : nullptr;
-}
-
-bool
-TVManager::Init()
-{
-  mTVService = TVServiceFactory::AutoCreateTVService();
-  NS_ENSURE_TRUE(mTVService, false);
-
-  nsCOMPtr<nsITVServiceCallback> callback = new TVServiceTunerGetterCallback(this);
-  nsresult rv = mTVService->GetTuners(callback);
-  NS_ENSURE_SUCCESS(rv, false);
-
-  return true;
-}
-
-/* virtual */ JSObject*
-TVManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return TVManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-nsresult
-TVManager::SetTuners(const nsTArray<RefPtr<TVTuner>>& aTuners)
-{
-  // Should be called only when TV Manager hasn't been ready yet.
-  if (mIsReady) {
-    return NS_ERROR_DOM_INVALID_STATE_ERR;
-  }
-
-  mTuners = aTuners;
-  mIsReady = true;
-
-  // Resolve pending promises.
-  uint32_t length = mPendingGetTunersPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetTunersPromises[i]->MaybeResolve(mTuners);
-  }
-  mPendingGetTunersPromises.Clear();
-  return NS_OK;
-}
-
-void
-TVManager::RejectPendingGetTunersPromises(nsresult aRv)
-{
-  // Reject pending promises.
-  uint32_t length = mPendingGetTunersPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetTunersPromises[i]->MaybeReject(aRv);
-  }
-  mPendingGetTunersPromises.Clear();
-}
-
-nsresult
-TVManager::DispatchTVEvent(nsIDOMEvent* aEvent)
-{
-  return DispatchTrustedEvent(aEvent);
-}
-
-already_AddRefed<Promise>
-TVManager::GetTuners(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // Keep track of the promise when the manager hasn't been ready yet.
-  if (mIsReady) {
-    promise->MaybeResolve(mTuners);
-  } else {
-    mPendingGetTunersPromises.AppendElement(promise);
-  }
-
-  return promise.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVManager.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVManager_h
-#define mozilla_dom_TVManager_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-
-class nsITVService;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class TVTuner;
-
-class TVManager final : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TVManager, DOMEventTargetHelper)
-
-  static already_AddRefed<TVManager> Create(nsPIDOMWindowInner* aWindow);
-
-  // WebIDL (internal functions)
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  nsresult SetTuners(const nsTArray<RefPtr<TVTuner>>& aTuners);
-
-  void RejectPendingGetTunersPromises(nsresult aRv);
-
-  nsresult DispatchTVEvent(nsIDOMEvent* aEvent);
-
-  // WebIDL (public APIs)
-
-  already_AddRefed<Promise> GetTuners(ErrorResult& aRv);
-
-private:
-  explicit TVManager(nsPIDOMWindowInner* aWindow);
-
-  ~TVManager();
-
-  bool Init();
-
-  nsCOMPtr<nsITVService> mTVService;
-  nsTArray<RefPtr<TVTuner>> mTuners;
-  bool mIsReady;
-  nsTArray<RefPtr<Promise>> mPendingGetTunersPromises;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVManager_h
deleted file mode 100644
--- a/dom/tv/TVProgram.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/TVChannel.h"
-#include "mozilla/dom/TVProgramBinding.h"
-#include "nsITVService.h"
-#include "TVProgram.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TVProgram, mOwner, mChannel)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVProgram)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVProgram)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVProgram)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-TVProgram::TVProgram(nsISupports* aOwner,
-                     TVChannel* aChannel,
-                     nsITVProgramData* aData)
-  : mOwner(aOwner)
-  , mChannel(aChannel)
-{
-  MOZ_ASSERT(mChannel);
-  MOZ_ASSERT(aData);
-
-  aData->GetEventId(mEventId);
-  aData->GetTitle(mTitle);
-  mStartTime = aData->GetStartTime();
-  mDuration = aData->GetDuration();
-  aData->GetDescription(mDescription);
-  aData->GetRating(mRating);
-
-  uint32_t count;
-  char** languages;
-  aData->GetAudioLanguages(&count, &languages);
-  SetLanguages(count, languages, mAudioLanguages);
-  aData->GetSubtitleLanguages(&count, &languages);
-  SetLanguages(count, languages, mSubtitleLanguages);
-}
-
-TVProgram::~TVProgram()
-{
-}
-
-/* virtual */ JSObject*
-TVProgram::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return TVProgramBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-TVProgram::GetAudioLanguages(nsTArray<nsString>& aLanguages) const
-{
-  aLanguages = mAudioLanguages;
-}
-
-void
-TVProgram::GetSubtitleLanguages(nsTArray<nsString>& aLanguages) const
-{
-  aLanguages = mSubtitleLanguages;
-}
-
-void
-TVProgram::GetEventId(nsAString& aEventId) const
-{
-  aEventId = mEventId;
-}
-
-already_AddRefed<TVChannel>
-TVProgram::Channel() const
-{
-  RefPtr<TVChannel> channel = mChannel;
-  return channel.forget();
-}
-
-void
-TVProgram::GetTitle(nsAString& aTitle) const
-{
-  aTitle = mTitle;
-}
-
-uint64_t
-TVProgram::StartTime() const
-{
-  return mStartTime;
-}
-
-uint64_t
-TVProgram::Duration() const
-{
-  return mDuration;
-}
-
-void
-TVProgram::GetDescription(nsAString& aDescription) const
-{
-  aDescription = mDescription;
-}
-
-void
-TVProgram::GetRating(nsAString& aRating) const
-{
-  aRating = mRating;
-}
-
-void
-TVProgram::SetLanguages(uint32_t aCount,
-                        char** aLanguages,
-                        nsTArray<nsString>& aLanguageList)
-{
-  for (uint32_t i = 0; i < aCount; i++) {
-    nsString language;
-    language.AssignASCII(aLanguages[i]);
-    aLanguageList.AppendElement(language);
-  }
-  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(aCount, aLanguages);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVProgram.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVProgram_h
-#define mozilla_dom_TVProgram_h
-
-#include "nsWrapperCache.h"
-
-class nsITVProgramData;
-
-namespace mozilla {
-namespace dom {
-
-class TVChannel;
-
-class TVProgram final : public nsISupports
-                      , public nsWrapperCache
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TVProgram)
-
-  TVProgram(nsISupports* aOwner,
-            TVChannel* aChannel,
-            nsITVProgramData* aData);
-
-  // WebIDL (internal functions)
-
-  nsISupports* GetParentObject() const
-  {
-    return mOwner;
-  }
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  // WebIDL (public APIs)
-
-  void GetAudioLanguages(nsTArray<nsString>& aLanguages) const;
-
-  void GetSubtitleLanguages(nsTArray<nsString>& aLanguages) const;
-
-  void GetEventId(nsAString& aEventId) const;
-
-  already_AddRefed<TVChannel> Channel() const;
-
-  void GetTitle(nsAString& aTitle) const;
-
-  uint64_t StartTime() const;
-
-  uint64_t Duration() const;
-
-  void GetDescription(nsAString& aDescription) const;
-
-  void GetRating(nsAString& aRating) const;
-
-private:
-  ~TVProgram();
-
-  void SetLanguages(uint32_t aCount,
-                    char** aLanguages,
-                    nsTArray<nsString>& aLanguageList);
-
-  nsCOMPtr<nsISupports> mOwner;
-  RefPtr<TVChannel> mChannel;
-  nsString mEventId;
-  nsString mTitle;
-  uint64_t mStartTime;
-  uint64_t mDuration;
-  nsString mDescription;
-  nsString mRating;
-  nsTArray<nsString> mAudioLanguages;
-  nsTArray<nsString> mSubtitleLanguages;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVProgram_h__
deleted file mode 100644
--- a/dom/tv/TVServiceCallbacks.cpp
+++ /dev/null
@@ -1,492 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/TVManager.h"
-#include "mozilla/dom/TVProgram.h"
-#include "mozilla/dom/TVSource.h"
-#include "mozilla/dom/TVTuner.h"
-#include "nsArrayUtils.h"
-#include "TVServiceCallbacks.h"
-
-namespace mozilla {
-namespace dom {
-
-/*
- * Implementation of TVServiceSourceSetterCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION(TVServiceSourceSetterCallback, mTuner, mPromise)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceSourceSetterCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceSourceSetterCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceSourceSetterCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceSourceSetterCallback::TVServiceSourceSetterCallback(TVTuner* aTuner,
-                                                             Promise* aPromise,
-                                                             TVSourceType aSourceType)
-  : mTuner(aTuner)
-  , mPromise(aPromise)
-  , mSourceType(aSourceType)
-{
-  MOZ_ASSERT(mTuner);
-  MOZ_ASSERT(mPromise);
-}
-
-TVServiceSourceSetterCallback::~TVServiceSourceSetterCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceSourceSetterCallback::NotifySuccess(nsIArray* aDataList)
-{
-  // |aDataList| is expected to be null for setter callbacks.
-  if (aDataList) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsresult rv = mTuner->SetCurrentSource(mSourceType);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    mPromise->MaybeReject(rv);
-    return rv;
-  }
-
-  mPromise->MaybeResolveWithUndefined();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceSourceSetterCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mPromise->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-
-/*
- * Implementation of TVServiceChannelScanCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION(TVServiceChannelScanCallback, mSource, mPromise)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceChannelScanCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceChannelScanCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceChannelScanCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceChannelScanCallback::TVServiceChannelScanCallback(TVSource* aSource,
-                                                           Promise* aPromise,
-                                                           bool aIsScanning)
-  : mSource(aSource)
-  , mPromise(aPromise)
-  , mIsScanning(aIsScanning)
-{
-  MOZ_ASSERT(mSource);
-  MOZ_ASSERT(mPromise);
-}
-
-TVServiceChannelScanCallback::~TVServiceChannelScanCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceChannelScanCallback::NotifySuccess(nsIArray* aDataList)
-{
-  // |aDataList| is expected to be null for setter callbacks.
-  if (aDataList) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mSource->SetIsScanning(mIsScanning);
-
-  mPromise->MaybeResolveWithUndefined();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceChannelScanCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mPromise->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-
-/*
- * Implementation of TVServiceChannelSetterCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION(TVServiceChannelSetterCallback, mSource, mPromise)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceChannelSetterCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceChannelSetterCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceChannelSetterCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceChannelSetterCallback::TVServiceChannelSetterCallback(TVSource* aSource,
-                                                               Promise* aPromise,
-                                                               const nsAString& aChannelNumber)
-  : mSource(aSource)
-  , mPromise(aPromise)
-  , mChannelNumber(aChannelNumber)
-{
-  MOZ_ASSERT(mSource);
-  MOZ_ASSERT(mPromise);
-  MOZ_ASSERT(!mChannelNumber.IsEmpty());
-}
-
-TVServiceChannelSetterCallback::~TVServiceChannelSetterCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceChannelSetterCallback::NotifySuccess(nsIArray* aDataList)
-{
-  // |aDataList| is expected to be with only one element.
-  if (!aDataList) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return rv;
-  }
-  if (length != 1) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsCOMPtr<nsITVChannelData> channelData = do_QueryElementAt(aDataList, 0);
-  if (NS_WARN_IF(!channelData)) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return rv;
-  }
-
-  rv = mSource->SetCurrentChannel(channelData);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return rv;
-  }
-
-  mPromise->MaybeResolveWithUndefined();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceChannelSetterCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mPromise->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-
-/*
- * Implementation of TVServiceTunerGetterCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION(TVServiceTunerGetterCallback, mManager)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceTunerGetterCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceTunerGetterCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceTunerGetterCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceTunerGetterCallback::TVServiceTunerGetterCallback(TVManager* aManager)
-  : mManager(aManager)
-{
-  MOZ_ASSERT(mManager);
-}
-
-TVServiceTunerGetterCallback::~TVServiceTunerGetterCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceTunerGetterCallback::NotifySuccess(nsIArray* aDataList)
-{
-  if (!aDataList) {
-    mManager->RejectPendingGetTunersPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsTArray<RefPtr<TVTuner>> tuners(length);
-  for (uint32_t i = 0; i < length; i++) {
-    nsCOMPtr<nsITVTunerData> tunerData = do_QueryElementAt(aDataList, i);
-    if (NS_WARN_IF(!tunerData)) {
-      continue;
-    }
-
-    RefPtr<TVTuner> tuner = TVTuner::Create(mManager->GetOwner(), tunerData);
-    NS_ENSURE_TRUE(tuner, NS_ERROR_DOM_ABORT_ERR);
-
-    tuners.AppendElement(tuner);
-  }
-  mManager->SetTuners(tuners);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceTunerGetterCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mManager->RejectPendingGetTunersPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mManager->RejectPendingGetTunersPromises(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mManager->RejectPendingGetTunersPromises(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mManager->RejectPendingGetTunersPromises(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-
-/*
- * Implementation of TVServiceChannelGetterCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION(TVServiceChannelGetterCallback, mSource, mPromise)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceChannelGetterCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceChannelGetterCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceChannelGetterCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceChannelGetterCallback::TVServiceChannelGetterCallback(TVSource* aSource,
-                                                               Promise* aPromise)
-  : mSource(aSource)
-  , mPromise(aPromise)
-{
-  MOZ_ASSERT(mSource);
-  MOZ_ASSERT(mPromise);
-}
-
-TVServiceChannelGetterCallback::~TVServiceChannelGetterCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceChannelGetterCallback::NotifySuccess(nsIArray* aDataList)
-{
-  if (!aDataList) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return rv;
-  }
-
-  nsTArray<RefPtr<TVChannel>> channels(length);
-  for (uint32_t i = 0; i < length; i++) {
-    nsCOMPtr<nsITVChannelData> channelData = do_QueryElementAt(aDataList, i);
-    if (NS_WARN_IF(!channelData)) {
-      mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-      return NS_ERROR_DOM_ABORT_ERR;
-    }
-
-    RefPtr<TVChannel> channel =
-      TVChannel::Create(mSource->GetOwner(), mSource, channelData);
-    channels.AppendElement(channel);
-  }
-
-  mPromise->MaybeResolve(channels);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceChannelGetterCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mPromise->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-/*
- * Implementation of TVServiceProgramGetterCallback
- */
-
-NS_IMPL_CYCLE_COLLECTION_0(TVServiceProgramGetterCallback)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(TVServiceProgramGetterCallback)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(TVServiceProgramGetterCallback)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TVServiceProgramGetterCallback)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsITVServiceCallback)
-NS_INTERFACE_MAP_END
-
-TVServiceProgramGetterCallback::TVServiceProgramGetterCallback(TVChannel* aChannel,
-                                                               Promise* aPromise,
-                                                               bool aIsSingular)
-  : mChannel(aChannel)
-  , mPromise(aPromise)
-  , mIsSingular(aIsSingular)
-{
-  MOZ_ASSERT(mChannel);
-  MOZ_ASSERT(mPromise);
-}
-
-TVServiceProgramGetterCallback::~TVServiceProgramGetterCallback()
-{
-}
-
-NS_IMETHODIMP
-TVServiceProgramGetterCallback::NotifySuccess(nsIArray* aDataList)
-{
-  if (!aDataList) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return rv;
-  }
-
-  if (mIsSingular && length == 0) {
-    mPromise->MaybeResolveWithUndefined();
-    return NS_OK;
-  }
-
-  if (mIsSingular) {
-    nsCOMPtr<nsITVProgramData> programData = do_QueryElementAt(aDataList, 0);
-    if (NS_WARN_IF(!programData)) {
-      mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-      return NS_ERROR_DOM_ABORT_ERR;
-    }
-
-    RefPtr<TVProgram> program = new TVProgram(mChannel->GetOwner(), mChannel,
-                                                programData);
-    mPromise->MaybeResolve(program);
-    return NS_OK;
-  }
-
-  nsTArray<RefPtr<TVProgram>> programs(length);
-  for (uint32_t i = 0; i < length; i++) {
-    nsCOMPtr<nsITVProgramData> programData = do_QueryElementAt(aDataList, i);
-    if (NS_WARN_IF(!programData)) {
-      mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-      return NS_ERROR_DOM_ABORT_ERR;
-    }
-
-    RefPtr<TVProgram> program = new TVProgram(mChannel->GetOwner(), mChannel,
-                                                programData);
-    programs.AppendElement(program);
-  }
-
-  mPromise->MaybeResolve(programs);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVServiceProgramGetterCallback::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsITVServiceCallback::TV_ERROR_FAILURE:
-  case nsITVServiceCallback::TV_ERROR_INVALID_ARG:
-    mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NO_SIGNAL:
-    mPromise->MaybeReject(NS_ERROR_DOM_NETWORK_ERR);
-    return NS_OK;
-  case nsITVServiceCallback::TV_ERROR_NOT_SUPPORTED:
-    mPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  mPromise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVServiceCallbacks.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVServiceCallbacks_h
-#define mozilla_dom_TVServiceCallbacks_h
-
-#include "nsITVService.h"
-// Include TVSourceBinding.h since enum TVSourceType can't be forward declared.
-#include "mozilla/dom/TVSourceBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class TVChannel;
-class TVManager;
-class TVTuner;
-class TVSource;
-
-class TVServiceSourceSetterCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceSourceSetterCallback)
-
-  TVServiceSourceSetterCallback(TVTuner* aTuner,
-                                Promise* aPromise,
-                                TVSourceType aSourceType);
-
-private:
-  ~TVServiceSourceSetterCallback();
-
-  RefPtr<TVTuner> mTuner;
-  RefPtr<Promise> mPromise;
-  TVSourceType mSourceType;
-};
-
-class TVServiceChannelScanCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceChannelScanCallback)
-
-  TVServiceChannelScanCallback(TVSource* aSource,
-                               Promise* aPromise,
-                               bool aIsScanning);
-
-private:
-  ~TVServiceChannelScanCallback();
-
-  RefPtr<TVSource> mSource;
-  RefPtr<Promise> mPromise;
-  bool mIsScanning;
-};
-
-class TVServiceChannelSetterCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceChannelSetterCallback)
-
-  TVServiceChannelSetterCallback(TVSource* aSource,
-                                 Promise* aPromise,
-                                 const nsAString& aChannelNumber);
-
-private:
-  ~TVServiceChannelSetterCallback();
-
-  RefPtr<TVSource> mSource;
-  RefPtr<Promise> mPromise;
-  nsString mChannelNumber;
-};
-
-class TVServiceTunerGetterCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceTunerGetterCallback)
-
-  explicit TVServiceTunerGetterCallback(TVManager* aManager);
-
-private:
-  ~TVServiceTunerGetterCallback();
-
-  RefPtr<TVManager> mManager;
-};
-
-class TVServiceChannelGetterCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceChannelGetterCallback)
-
-  TVServiceChannelGetterCallback(TVSource* aSource,
-                                 Promise* aPromise);
-
-private:
-  ~TVServiceChannelGetterCallback();
-
-  RefPtr<TVSource> mSource;
-  RefPtr<Promise> mPromise;
-};
-
-class TVServiceProgramGetterCallback final : public nsITVServiceCallback
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_NSITVSERVICECALLBACK
-  NS_DECL_CYCLE_COLLECTION_CLASS(TVServiceProgramGetterCallback)
-
-  // |aIsSingular| is set when the promise is expected to be resolved as a
-  // TVProgram for |TVChannel::GetCurrentProgram()|, instead of a sequence of
-  // TVProgram for |TVChannel::GetPrograms()|.
-  TVServiceProgramGetterCallback(TVChannel* aChannel,
-                                 Promise* aPromise,
-                                 bool aIsSingular);
-
-private:
-  ~TVServiceProgramGetterCallback();
-
-  RefPtr<TVChannel> mChannel;
-  RefPtr<Promise> mPromise;
-  bool mIsSingular;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVServiceCallbacks_h
deleted file mode 100644
--- a/dom/tv/TVServiceFactory.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/TVListeners.h"
-#include "mozilla/Preferences.h"
-#include "nsITVService.h"
-#include "nsITVSimulatorService.h"
-#include "nsServiceManagerUtils.h"
-#include "TVServiceFactory.h"
-
-namespace mozilla {
-namespace dom {
-
-/* static */ already_AddRefed<nsITVService>
-TVServiceFactory::AutoCreateTVService()
-{
-  nsresult rv = NS_OK;
-  nsCOMPtr<nsITVService> service = do_CreateInstance(TV_SERVICE_CONTRACTID);
-  if (!service) {
-    // Fallback to the TV Simulator Service
-    service = do_CreateInstance(TV_SIMULATOR_SERVICE_CONTRACTID, &rv);
-
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return nullptr;
-    }
-  }
-
-  rv = service->SetSourceListener(new TVSourceListener());
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return nullptr;
-  }
-
-  return service.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVServiceFactory.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVServiceFactory_h
-#define mozilla_dom_TVServiceFactory_h
-
-#include "nsCOMPtr.h"
-
-class nsITVService;
-
-namespace mozilla {
-namespace dom {
-
-class TVServiceFactory
-{
-public:
-  static already_AddRefed<nsITVService> AutoCreateTVService();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVServiceFactory_h
deleted file mode 100644
--- a/dom/tv/TVServiceRunnables.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVServiceRunnables_h
-#define mozilla_dom_TVServiceRunnables_h
-
-#include "nsITVService.h"
-#include "nsThreadUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-/*
- * NOTE: The callbacks passing to |nsITVService| must be called asynchronously.
- * In the implementation, actual runnable objects may need to be created and
- * call the callback off of the runnables, after the function returns. Here are
- * some ready-made runnables and could be used in the following way.
- *
- * nsCOMPtr<nsIRunnable> runnable =
- *   new TVServiceNotifyRunnable(callback, dataList, optional errorCode);
- * return NS_DispatchToCurrentThread(runnable);
- */
-class TVServiceNotifyRunnable final : public nsRunnable
-{
-public:
-  TVServiceNotifyRunnable(nsITVServiceCallback* aCallback,
-                          nsIArray* aDataList,
-                          uint16_t aErrorCode = nsITVServiceCallback::TV_ERROR_OK)
-    : mCallback(aCallback)
-    , mDataList(aDataList)
-    , mErrorCode(aErrorCode)
-  {}
-
-  NS_IMETHOD Run() override
-  {
-    if (mErrorCode == nsITVServiceCallback::TV_ERROR_OK) {
-      return mCallback->NotifySuccess(mDataList);
-    } else {
-      return mCallback->NotifyError(mErrorCode);
-    }
-  }
-
-private:
-  nsCOMPtr<nsITVServiceCallback> mCallback;
-  nsCOMPtr<nsIArray> mDataList;
-  uint16_t mErrorCode;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVServiceRunnables_h
deleted file mode 100644
--- a/dom/tv/TVSimulatorService.js
+++ /dev/null
@@ -1,557 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-function debug(aMsg) {
-  //dump("[TVSimulatorService] " + aMsg + "\n");
-}
-
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cr = Components.returnCode;
-
-Cu.importGlobalProperties(["File"]);
-Cu.import("resource://gre/modules/Services.jsm");
-
-const TV_SIMULATOR_DUMMY_DIRECTORY   = "dummy";
-const TV_SIMULATOR_DUMMY_FILE        = "settings.json";
-
-// See http://seanyhlin.github.io/TV-Manager-API/#idl-def-TVSourceType
-const TV_SOURCE_TYPES = ["dvb-t","dvb-t2","dvb-c","dvb-c2","dvb-s",
-                         "dvb-s2","dvb-h","dvb-sh","atsc","atsc-m/h",
-                         "isdb-t","isdb-tb","isdb-s","isdb-c","1seg",
-                         "dtmb","cmmb","t-dmb","s-dmb"];
-function containInvalidSourceType(aElement, aIndex, aArray) {
-  return !TV_SOURCE_TYPES.includes(aElement);
-}
-
-// See http://seanyhlin.github.io/TV-Manager-API/#idl-def-TVChannelType
-const TV_CHANNEL_TYPES = ["tv","radio","data"];
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function TVSimulatorService() {
-  this._internalTuners = null;
-  this._scanCompleteTimer = null;
-  this._scanningWrapTunerData = null;
-  this._init();
-}
-
-TVSimulatorService.prototype = {
-  classID: Components.ID("{94b065ad-d45a-436a-b394-6dabc3cf110f}"),
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsITVSimulatorService,
-                                         Ci.nsITVService,
-                                         Ci.nsITimerCallback]),
-
-  _init: function TVSimInit() {
-    if (this._internalTuners) {
-      return;
-    }
-
-    // I try to load the testing mock data if related preference are already set.
-    // Otherwise, use to the simulation data from prefences.
-    // See /dom/tv/test/mochitest/head.js for more details.
-    let settingStr = "";
-    try {
-      settingStr = Services.prefs.getCharPref("dom.testing.tv_mock_data");
-    } catch(e) {
-      try {
-        settingStr = this._getDummyData();
-      } catch(e) {
-        debug("TV Simulator service failed to load simulation data: " + e);
-        return;
-      }
-    }
-
-    let settingsObj;
-    try {
-      /*
-       *
-       * Setting JSON file format:
-       *
-       * Note: This setting JSON is not allow empty array.
-       *       If set the empty array, _init() will fail.
-       *       e.g.
-       *        - "tuners": []
-       *        - "channels":[]
-       * Format:
-       *   {
-       *    "tuners": [{
-       *      "id":                     "The ID of the tuner",
-       *      "supportedType":          ["The array of source type to be used."],
-       *      "sources": [{
-       *        "type":                 "The source type to be used",
-       *        "channels" : [{
-       *          "networkId":          "The ID of the channel network",
-       *          "transportStreamId":  "The ID of channel transport stream",
-       *          "serviceId":          "The ID of channel service",
-       *          "type":               "The type of channel",
-       *          "name":               "The channel name",
-       *          "number" :            The LCN (Logical Channel Number) of the channel,
-       *          "isEmergency" :       Whether this channel is emergency status,
-       *          "isFree":             Whether this channel is free or not,
-       *          "videoFilePath":      "The path of the fake video file",
-       *          "programs":[{
-       *            "eventId":          "The ID of this program event",
-       *            "title" :           "This program's title",
-       *            "startTime":        "The start time of this program",
-       *            "duration":         "The duration of this program",
-       *            "description":      "The description of this program",
-       *            "rating":           "The rating of this program",
-       *            "audioLanugages":   ["The array of audio language"],
-       *            "subtitleLanguages":["The array of subtitle language"],
-       *           },]
-       *         },]
-       *       },]
-       *     },]
-       *   }
-       */
-      settingsObj = JSON.parse(settingStr);
-    } catch(e) {
-      debug("File load error: " + e);
-      return;
-    }
-
-    // validation
-    if (!this._validateSettings(settingsObj)) {
-      debug("Failed to validate settings.");
-      return;
-    }
-
-    // Key is as follow
-    // {'tunerId':tunerId, 'sourceType':sourceType}
-    this._internalTuners = new Map();
-
-    // TVTunerData
-    for (let tunerData of settingsObj.tuners) {
-      let tuner = Cc["@mozilla.org/tv/tvtunerdata;1"]
-                    .createInstance(Ci.nsITVTunerData);
-      tuner.id = tunerData.id;
-      tuner.streamType = tuner.TV_STREAM_TYPE_SIMULATOR;
-      tuner.setSupportedSourceTypes(tunerData.supportedType.length,
-                                    tunerData.supportedType);
-
-      let wrapTunerData = {
-        'tuner': tuner,
-        'channels': new Map(),
-        'sourceType': undefined,
-      };
-
-      // TVSource
-      for (let sourceData of tunerData.sources) {
-        wrapTunerData.sourceType = sourceData.type;
-
-        // TVChannel
-        for (let channelData of sourceData.channels) {
-          let channel = Cc["@mozilla.org/tv/tvchanneldata;1"]
-                          .createInstance(Ci.nsITVChannelData);
-          channel.networkId         = channelData.networkId;
-          channel.transportStreamId = channelData.transportStreamId;
-          channel.serviceId         = channelData.serviceId;
-          channel.type              = channelData.type;
-          channel.name              = channelData.name;
-          channel.number            = channelData.number;
-          channel.isEmergency       = channelData.isEmergency;
-          channel.isFree            = channelData.isFree;
-
-          let wrapChannelData = {
-            'channel': channel,
-            'programs': new Array(),
-            'videoFilePath': channelData.videoFilePath,
-          };
-
-          // TVProgram
-          for (let programData of channelData.programs) {
-            let program = Cc["@mozilla.org/tv/tvprogramdata;1"]
-                            .createInstance(Ci.nsITVProgramData);
-            program.eventId     = programData.eventId;
-            program.title       = programData.title;
-            program.startTime   = programData.startTime;
-            program.duration    = programData.duration;
-            program.description = programData.description;
-            program.rating      = programData.rating;
-            program.setAudioLanguages(programData.audioLanguages.length,
-                                      programData.audioLanguages);
-            program.setSubtitleLanguages(programData.subtitleLanguages.length,
-                                         programData.subtitleLanguages);
-            wrapChannelData.programs.push(program);
-          }
-
-          // Sort the program according to the startTime
-          wrapChannelData.programs.sort(function(a, b) {
-            return a.startTime - b.startTime;
-          });
-          wrapTunerData.channels.set(channel.number, wrapChannelData);
-        }
-
-        // Sort the channel according to the channel number
-        wrapTunerData.channels = new Map([...wrapTunerData.channels.entries()].sort(function(a, b) {
-          return a[0] - b[0];
-        }));
-        this._internalTuners.set(
-                this._getTunerMapKey(tuner.id, sourceData.type),
-                wrapTunerData);
-      }
-    }
-  },
-
-  getTuners: function TVSimGetTuners(aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    let tuners = Cc["@mozilla.org/array;1"]
-                   .createInstance(Ci.nsIMutableArray);
-
-    for (let [k,wrapTunerData] of this._internalTuners) {
-      tuners.appendElement(wrapTunerData.tuner, false);
-    }
-
-    return aCallback.notifySuccess(tuners);
-  },
-
-  setSource: function TVSimSetSource(aTunerId, aSourceType, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return NS_ERROR_INVALID_ARG;
-    }
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-    return aCallback.notifySuccess(null);
-  },
-
-  startScanningChannels: function TVSimStartScanningChannels(aTunerId, aSourceType, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData || !wrapTunerData.channels) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    if (this._scanningWrapTunerData) {
-      return aCallback.notifyError(Cr.NS_ERROR_DOM_INVALID_STATE_ERR);
-    }
-
-    this._scanningWrapTunerData = wrapTunerData;
-
-    aCallback.notifySuccess(null);
-
-    for (let [key, wrapChannelData] of wrapTunerData.channels) {
-      this._sourceListener.notifyChannelScanned(
-                                        wrapTunerData.tuner.id,
-                                        wrapTunerData.sourceType,
-                                        wrapChannelData.channel);
-    }
-
-    this._scanCompleteTimer = Cc["@mozilla.org/timer;1"]
-                                .createInstance(Ci.nsITimer);
-    let rv = this._scanCompleteTimer.initWithCallback(this, 10,
-                                                      Ci.nsITimer.TYPE_ONE_SHOT);
-    return Cr.NS_OK;
-  },
-
-  notify: function TVSimTimerCallback(aTimer) {
-    if (!this._scanningWrapTunerData) {
-      return;
-    }
-
-    this._scanCompleteTimer = null;
-    let notifyResult = this._sourceListener.notifyChannelScanComplete(
-                                                  this._scanningWrapTunerData.tuner.id,
-                                                  this._scanningWrapTunerData.sourceType);
-    this._scanningWrapTunerData = null;
-    return notifyResult;
-  },
-
-  stopScanningChannels: function TVSimStopScanningChannels(aTunerId, aSourceType, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    if (!this._scanningWrapTunerData) {
-      return aCallback.notifyError(Cr.NS_ERROR_DOM_INVALID_STATE_ERR);
-    }
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    if (this._scanCompleteTimer) {
-      this._scanCompleteTimer.cancel();
-      this._scanCompleteTimer = null;
-    }
-
-    if (wrapTunerData.tuner.id === this._scanningWrapTunerData.tuner.id &&
-        wrapTunerData.sourceType === this._scanningWrapTunerData.sourceType) {
-      this._scanningWrapTunerData = null;
-      this._sourceListener.notifyChannelScanStopped(
-                                 wrapTunerData.tuner.id,
-                                 wrapTunerData.sourceType);
-    }
-
-    return aCallback.notifySuccess(null);
-  },
-
-  clearScannedChannelsCache: function TVSimClearScannedChannelsCache(aTunerId, aSourceType, aCallback) {
-    // Doesn't support for this method.
-    return Cr.NS_OK;
-  },
-
-  setChannel: function TVSimSetChannel(aTunerId, aSourceType, aChannelNumber, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    let channel = Cc["@mozilla.org/array;1"]
-                    .createInstance(Ci.nsIMutableArray);
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData || !wrapTunerData.channels) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    let wrapChannelData = wrapTunerData.channels.get(aChannelNumber);
-    if (!wrapChannelData) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    channel.appendElement(wrapChannelData.channel, false);
-    return aCallback.notifySuccess(channel);
-
-  },
-
-  getChannels: function TVSimGetChannels(aTunerId, aSourceType, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    let channelArray = Cc["@mozilla.org/array;1"]
-                         .createInstance(Ci.nsIMutableArray);
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData || !wrapTunerData.channels) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    for (let [key, wrapChannelData] of wrapTunerData.channels) {
-      channelArray.appendElement(wrapChannelData.channel, false);
-    }
-
-    return aCallback.notifySuccess(channelArray);
-  },
-
-  getPrograms: function TVSimGetPrograms(aTunerId, aSourceType, aChannelNumber, aStartTime, aEndTime, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-    let programArray = Cc["@mozilla.org/array;1"]
-                         .createInstance(Ci.nsIMutableArray);
-
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData || !wrapTunerData.channels) {
-      return aCallback.notifyError(Ci.nsITVServiceCallback.TV_ERROR_FAILURE);
-    }
-
-    let wrapChannelData = wrapTunerData.channels.get(aChannelNumber);
-    if (!wrapChannelData || !wrapChannelData.programs) {
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    for (let program of wrapChannelData.programs) {
-      programArray.appendElement(program, false);
-    }
-
-    return aCallback.notifySuccess(programArray);
-
-  },
-
-  getOverlayId: function TVSimGetOverlayId(aTunerId, aCallback) {
-    if (!aCallback) {
-      debug("aCallback is null\n");
-      return Cr.NS_ERROR_INVALID_ARG;
-    }
-
-    // TVSimulatorService does not use this parameter.
-    overlayIds = Cc["@mozilla.org/array;1"]
-                  .createInstance(Ci.nsIMutableArray);
-    return aCallback.notifySuccess(overlayIds);
-  },
-
-  set sourceListener(aListener) {
-    this._sourceListener = aListener;
-  },
-
-  get sourceListener() {
-      return this._sourceListener;
-  },
-
-  getSimulatorVideoBlobURL: function TVSimGetSimulatorVideoBlob(aTunerId,
-                                                                aSourceType,
-                                                                aChannelNumber,
-                                                                aWin) {
-    let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
-    if (!wrapTunerData || !wrapTunerData.channels) {
-      return "";
-    }
-
-    let wrapChannelData = wrapTunerData.channels.get(aChannelNumber);
-    if (!wrapChannelData || !wrapChannelData.videoFilePath) {
-      return "";
-    }
-
-    let videoFile = new File(this._getFilePath(wrapChannelData.videoFilePath));
-    let videoBlobURL = aWin.URL.createObjectURL(videoFile);
-
-    return videoBlobURL;
-  },
-
-  _getDummyData : function TVSimGetDummyData() {
-    // Load the setting file from local JSON file.
-    // Synchrhronous File Reading.
-    let file = Cc["@mozilla.org/file/local;1"]
-                 .createInstance(Ci.nsILocalFile);
-
-    let fstream = Cc["@mozilla.org/network/file-input-stream;1"]
-                    .createInstance(Ci.nsIFileInputStream);
-    let cstream = Cc["@mozilla.org/intl/converter-input-stream;1"]
-                   .createInstance(Ci.nsIConverterInputStream);
-
-    let settingsStr = "";
-
-    try {
-      file.initWithPath(this._getFilePath(TV_SIMULATOR_DUMMY_FILE));
-      fstream.init(file, -1, 0, 0);
-      cstream.init(fstream,
-                   "UTF-8",
-                   1024,
-                   Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
-
-      let str = {};
-      while (cstream.readString(0xffffffff, str) != 0) {
-        settingsStr += str.value;
-      }
-    } catch(e) {
-      debug("Catch the Exception when reading the dummy file:" + e );
-      throw e;
-    } finally {
-      cstream.close();
-    }
-
-    return settingsStr;
-  },
-
-  _getTunerMapKey: function TVSimGetTunerMapKey(aTunerId, aSourceType) {
-    return JSON.stringify({'tunerId': aTunerId, 'sourceType': aSourceType});
-  },
-
-  _getWrapTunerData: function TVSimGetWrapTunerData(aTunerId, aSourceType) {
-    if (!this._internalTuners || this._internalTuners.size <= 0) {
-      return null;
-    }
-    return this._internalTuners.get(this._getTunerMapKey(aTunerId, aSourceType));
-  },
-
-  _getFilePath: function TVSimGetFilePathFromDummyDirectory(fileName) {
-    let dsFile = Cc["@mozilla.org/file/directory_service;1"]
-                   .getService(Ci.nsIProperties)
-                   .get("ProfD", Ci.nsIFile);
-    dsFile.append(TV_SIMULATOR_DUMMY_DIRECTORY);
-    dsFile.append(fileName);
-
-    return dsFile.path;
-  },
-
-  _validateSettings: function TVSimValidateSettings(aSettingsObject) {
-    return this._validateTuners(aSettingsObject.tuners);
-  },
-
-  _validateTuners: function TVSimValidateTuners(aTunersObject) {
-    let tunerIds = new Array();
-    for (let tuner of aTunersObject) {
-      if (!tuner.id ||
-          !tuner.supportedType ||
-          !tuner.supportedType.length ||
-          tuner.supportedType.some(containInvalidSourceType) ||
-          tunerIds.includes(tuner.id)) {
-        debug("invalid tuner data.");
-        return false;
-      }
-      tunerIds.push(tuner.id);
-
-      if (!this._validateSources(tuner.sources)) {
-        return false;
-      }
-    }
-    return true;
-  },
-
-  _validateSources: function TVSimValidateSources(aSourcesObject) {
-    for (let source of aSourcesObject) {
-      if (!source.type ||
-          !TV_SOURCE_TYPES.includes(source.type)) {
-        debug("invalid source data.");
-        return false;
-      }
-
-      if (!this._validateChannels(source.channels)) {
-        return false;
-      }
-    }
-    return true;
-  },
-
-  _validateChannels: function TVSimValidateChannels(aChannelsObject) {
-    let channelNumbers = new Array();
-    for (let channel of aChannelsObject) {
-      if (!channel.networkId ||
-          !channel.transportStreamId ||
-          !channel.serviceId ||
-          !channel.type ||
-          !TV_CHANNEL_TYPES.includes(channel.type) ||
-          !channel.number ||
-          channelNumbers.includes(channel.number) ||
-          !channel.name) {
-        debug("invalid channel data.");
-        return false;
-      }
-      channelNumbers.push(channel.number);
-
-      if (!this._validatePrograms(channel.programs)) {
-        return false;
-      }
-    }
-    return true;
-  },
-
-  _validatePrograms: function TVSimValidatePrograms(aProgramsObject) {
-    let eventIds = new Array();
-    for (let program of aProgramsObject) {
-      if (!program.eventId ||
-          eventIds.includes(program.eventId) ||
-          !program.title ||
-          !program.startTime ||
-          !program.duration) {
-        debug("invalid program data.");
-        return false;
-      }
-      eventIds.push(program.eventId);
-    }
-    return true;
-  },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TVSimulatorService]);
deleted file mode 100644
--- a/dom/tv/TVSimulatorService.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {94b065ad-d45a-436a-b394-6dabc3cf110f} TVSimulatorService.js
-contract @mozilla.org/tv/simulatorservice;1 {94b065ad-d45a-436a-b394-6dabc3cf110f}
deleted file mode 100644
--- a/dom/tv/TVSource.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/TVChannel.h"
-#include "mozilla/dom/TVCurrentChannelChangedEvent.h"
-#include "mozilla/dom/TVEITBroadcastedEvent.h"
-#include "mozilla/dom/TVListeners.h"
-#include "mozilla/dom/TVScanningStateChangedEvent.h"
-#include "mozilla/dom/TVServiceCallbacks.h"
-#include "mozilla/dom/TVServiceFactory.h"
-#include "mozilla/dom/TVTuner.h"
-#include "mozilla/dom/TVUtils.h"
-#include "nsITVService.h"
-#include "nsServiceManagerUtils.h"
-#include "TVSource.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(TVSource)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(TVSource,
-                                                  DOMEventTargetHelper)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTVService)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTuner)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCurrentChannel)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(TVSource,
-                                                DOMEventTargetHelper)
-  tmp->Shutdown();
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mTVService)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mTuner)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mCurrentChannel)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_ADDREF_INHERITED(TVSource, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(TVSource, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TVSource)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-TVSource::TVSource(nsPIDOMWindowInner* aWindow,
-                   TVSourceType aType,
-                   TVTuner* aTuner)
-  : DOMEventTargetHelper(aWindow)
-  , mTuner(aTuner)
-  , mType(aType)
-  , mIsScanning(false)
-{
-  MOZ_ASSERT(mTuner);
-}
-
-TVSource::~TVSource()
-{
-  Shutdown();
-}
-
-/* static */ already_AddRefed<TVSource>
-TVSource::Create(nsPIDOMWindowInner* aWindow,
-                 TVSourceType aType,
-                 TVTuner* aTuner)
-{
-  RefPtr<TVSource> source = new TVSource(aWindow, aType, aTuner);
-  return (source->Init()) ? source.forget() : nullptr;
-}
-
-bool
-TVSource::Init()
-{
-  mTVService = TVServiceFactory::AutoCreateTVService();
-  NS_ENSURE_TRUE(mTVService, false);
-
-  nsCOMPtr<nsITVSourceListener> sourceListener;
-  mTVService->GetSourceListener(getter_AddRefs(sourceListener));
-  NS_ENSURE_TRUE(sourceListener, false);
-  (static_cast<TVSourceListener*>(sourceListener.get()))->RegisterSource(this);
-
-  return true;
-}
-
-void
-TVSource::Shutdown()
-{
-  if (!mTVService) {
-    return;
-  }
-
-  nsCOMPtr<nsITVSourceListener> sourceListener;
-  mTVService->GetSourceListener(getter_AddRefs(sourceListener));
-  if (!sourceListener) {
-    return;
-  }
-  (static_cast<TVSourceListener*>(sourceListener.get()))->UnregisterSource(this);
-}
-
-/* virtual */ JSObject*
-TVSource::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return TVSourceBinding::Wrap(aCx, this, aGivenProto);
-}
-
-nsresult
-TVSource::SetCurrentChannel(nsITVChannelData* aChannelData)
-{
-  if (!aChannelData) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsString newChannelNumber;
-  nsresult rv = aChannelData->GetNumber(newChannelNumber);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  if (newChannelNumber.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (mCurrentChannel) {
-    nsString currentChannelNumber;
-    mCurrentChannel->GetNumber(currentChannelNumber);
-    if (newChannelNumber.Equals(currentChannelNumber)) {
-      // No actual change.
-      return NS_OK;
-    }
-  }
-
-  mCurrentChannel = TVChannel::Create(GetOwner(), this, aChannelData);
-  NS_ENSURE_TRUE(mCurrentChannel, NS_ERROR_DOM_ABORT_ERR);
-
-  RefPtr<TVSource> currentSource = mTuner->GetCurrentSource();
-  if (currentSource && mType == currentSource->Type()) {
-    rv = mTuner->ReloadMediaStream();
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-  }
-
-  return DispatchCurrentChannelChangedEvent(mCurrentChannel);
-}
-
-nsresult
-TVSource::UnsetCurrentChannel()
-{
-  mCurrentChannel = nullptr;
-  return DispatchCurrentChannelChangedEvent(mCurrentChannel);
-}
-
-void
-TVSource::SetIsScanning(bool aIsScanning)
-{
-  mIsScanning = aIsScanning;
-}
-
-nsresult
-TVSource::DispatchTVEvent(nsIDOMEvent* aEvent)
-{
-  return DispatchTrustedEvent(aEvent);
-}
-
-already_AddRefed<Promise>
-TVSource::GetChannels(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // The operation is prohibited when the source is scanning channels.
-  if (mIsScanning) {
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
-  }
-
-  nsString tunerId;
-  mTuner->GetId(tunerId);
-
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceChannelGetterCallback(this, promise);
-  nsresult rv =
-    mTVService->GetChannels(tunerId, ToTVSourceTypeStr(mType), callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-already_AddRefed<Promise>
-TVSource::SetCurrentChannel(const nsAString& aChannelNumber,
-                            ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // The operation is prohibited when the source is scanning channels.
-  if (mIsScanning) {
-    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return promise.forget();
-  }
-
-  nsString tunerId;
-  mTuner->GetId(tunerId);
-
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceChannelSetterCallback(this, promise, aChannelNumber);
-  nsresult rv =
-    mTVService->SetChannel(tunerId, ToTVSourceTypeStr(mType), aChannelNumber, callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-already_AddRefed<Promise>
-TVSource::StartScanning(const TVStartScanningOptions& aOptions,
-                        ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  nsString tunerId;
-  mTuner->GetId(tunerId);
-
-  bool isRescanned = aOptions.mIsRescanned.WasPassed() &&
-                     aOptions.mIsRescanned.Value();
-
-  if (isRescanned) {
-    nsresult rv = mTVService->ClearScannedChannelsCache();
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-      return promise.forget();
-    }
-
-    rv = DispatchScanningStateChangedEvent(TVScanningState::Cleared, nullptr);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-      return promise.forget();
-    }
-  }
-
-  // |SetIsScanning(bool)| should be called once |notifySuccess()| of this
-  // callback is invoked.
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceChannelScanCallback(this, promise, true);
-  nsresult rv =
-    mTVService->StartScanningChannels(tunerId, ToTVSourceTypeStr(mType), callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-already_AddRefed<Promise>
-TVSource::StopScanning(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  nsString tunerId;
-  mTuner->GetId(tunerId);
-
-  // |SetIsScanning(bool)| should be called once |notifySuccess()| of this
-  // callback is invoked.
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceChannelScanCallback(this, promise, false);
-  nsresult rv =
-    mTVService->StopScanningChannels(tunerId, ToTVSourceTypeStr(mType), callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-already_AddRefed<TVTuner>
-TVSource::Tuner() const
-{
-  RefPtr<TVTuner> tuner = mTuner;
-  return tuner.forget();
-}
-
-TVSourceType
-TVSource::Type() const
-{
-  return mType;
-}
-
-bool
-TVSource::IsScanning() const
-{
-  return mIsScanning;
-}
-
-already_AddRefed<TVChannel>
-TVSource::GetCurrentChannel() const
-{
-  RefPtr<TVChannel> currentChannel = mCurrentChannel;
-  return currentChannel.forget();
-}
-
-nsresult
-TVSource::NotifyChannelScanned(nsITVChannelData* aChannelData)
-{
-  RefPtr<TVChannel> channel = TVChannel::Create(GetOwner(), this, aChannelData);
-  NS_ENSURE_TRUE(channel, NS_ERROR_DOM_ABORT_ERR);
-
-  return DispatchScanningStateChangedEvent(TVScanningState::Scanned, channel);
-}
-
-nsresult
-TVSource::NotifyChannelScanComplete()
-{
-  SetIsScanning(false);
-  return DispatchScanningStateChangedEvent(TVScanningState::Completed, nullptr);
-}
-
-nsresult
-TVSource::NotifyChannelScanStopped()
-{
-  SetIsScanning(false);
-  return DispatchScanningStateChangedEvent(TVScanningState::Stopped, nullptr);
-}
-
-nsresult
-TVSource::NotifyEITBroadcasted(nsITVChannelData* aChannelData,
-                               nsITVProgramData** aProgramDataList,
-                               uint32_t aCount)
-{
-  RefPtr<TVChannel> channel = TVChannel::Create(GetOwner(), this, aChannelData);
-  Sequence<OwningNonNull<TVProgram>> programs;
-  for (uint32_t i = 0; i < aCount; i++) {
-    RefPtr<TVProgram> program =
-      new TVProgram(GetOwner(), channel, aProgramDataList[i]);
-    *programs.AppendElement(fallible) = program;
-  }
-  return DispatchEITBroadcastedEvent(programs);
-}
-
-nsresult
-TVSource::DispatchCurrentChannelChangedEvent(TVChannel* aChannel)
-{
-  TVCurrentChannelChangedEventInit init;
-  init.mChannel = aChannel;
-  nsCOMPtr<nsIDOMEvent> event =
-    TVCurrentChannelChangedEvent::Constructor(this,
-                                              NS_LITERAL_STRING("currentchannelchanged"),
-                                              init);
-  nsCOMPtr<nsIRunnable> runnable =
-    NewRunnableMethod<nsCOMPtr<nsIDOMEvent>>(this,
-                                             &TVSource::DispatchTVEvent,
-                                             event);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-nsresult
-TVSource::DispatchScanningStateChangedEvent(TVScanningState aState,
-                                            TVChannel* aChannel)
-{
-  TVScanningStateChangedEventInit init;
-  init.mState = aState;
-  init.mChannel = aChannel;
-  nsCOMPtr<nsIDOMEvent> event =
-    TVScanningStateChangedEvent::Constructor(this,
-                                             NS_LITERAL_STRING("scanningstatechanged"),
-                                             init);
-  nsCOMPtr<nsIRunnable> runnable =
-    NewRunnableMethod<nsCOMPtr<nsIDOMEvent>>(this,
-                                             &TVSource::DispatchTVEvent,
-                                             event);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-nsresult
-TVSource::DispatchEITBroadcastedEvent(const Sequence<OwningNonNull<TVProgram>>& aPrograms)
-{
-  TVEITBroadcastedEventInit init;
-  init.mPrograms = aPrograms;
-  nsCOMPtr<nsIDOMEvent> event =
-    TVEITBroadcastedEvent::Constructor(this,
-                                       NS_LITERAL_STRING("eitbroadcasted"),
-                                       init);
-  nsCOMPtr<nsIRunnable> runnable =
-    NewRunnableMethod<nsCOMPtr<nsIDOMEvent>>(this,
-                                             &TVSource::DispatchTVEvent,
-                                             event);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVSource.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVSource_h
-#define mozilla_dom_TVSource_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-// Include TVScanningStateChangedEventBinding.h since enum TVScanningState can't
-// be forward declared.
-#include "mozilla/dom/TVScanningStateChangedEventBinding.h"
-// Include TVSourceBinding.h since enum TVSourceType can't be forward declared.
-#include "mozilla/dom/TVSourceBinding.h"
-
-class nsITVChannelData;
-class nsITVProgramData;
-class nsITVService;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class TVChannel;
-class TVProgram;
-class TVTuner;
-
-class TVSource final : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TVSource, DOMEventTargetHelper)
-
-  static already_AddRefed<TVSource>
-  Create(nsPIDOMWindowInner* aWindow,
-         TVSourceType aType,
-         TVTuner* aTuner);
-
-  // WebIDL (internal functions)
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  nsresult SetCurrentChannel(nsITVChannelData* aChannelData);
-
-  nsresult UnsetCurrentChannel();
-
-  void SetIsScanning(bool aIsScanning);
-
-  nsresult DispatchTVEvent(nsIDOMEvent* aEvent);
-
-  nsresult NotifyChannelScanned(nsITVChannelData* aChannelData);
-
-  nsresult NotifyChannelScanComplete();
-
-  nsresult NotifyChannelScanStopped();
-
-  nsresult NotifyEITBroadcasted(nsITVChannelData* aChannelData,
-                                nsITVProgramData** aProgramDataList,
-                                uint32_t aCount);
-
-  // WebIDL (public APIs)
-
-  already_AddRefed<Promise> GetChannels(ErrorResult& aRv);
-
-  already_AddRefed<Promise> SetCurrentChannel(const nsAString& aChannelNumber,
-                                              ErrorResult& aRv);
-
-  already_AddRefed<Promise> StartScanning(const TVStartScanningOptions& aOptions,
-                                          ErrorResult& aRv);
-
-  already_AddRefed<Promise> StopScanning(ErrorResult& aRv);
-
-  already_AddRefed<TVTuner> Tuner() const;
-
-  TVSourceType Type() const;
-
-  bool IsScanning() const;
-
-  already_AddRefed<TVChannel> GetCurrentChannel() const;
-
-  IMPL_EVENT_HANDLER(currentchannelchanged);
-  IMPL_EVENT_HANDLER(eitbroadcasted);
-  IMPL_EVENT_HANDLER(scanningstatechanged);
-
-private:
-  TVSource(nsPIDOMWindowInner* aWindow,
-           TVSourceType aType,
-           TVTuner* aTuner);
-
-  ~TVSource();
-
-  bool Init();
-
-  void Shutdown();
-
-  nsresult DispatchCurrentChannelChangedEvent(TVChannel* aChannel);
-
-  nsresult DispatchScanningStateChangedEvent(TVScanningState aState,
-                                             TVChannel* aChannel);
-
-  nsresult DispatchEITBroadcastedEvent(const Sequence<OwningNonNull<TVProgram>>& aPrograms);
-
-  nsCOMPtr<nsITVService> mTVService;
-  RefPtr<TVTuner> mTuner;
-  RefPtr<TVChannel> mCurrentChannel;
-  TVSourceType mType;
-  bool mIsScanning;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVSource_h
deleted file mode 100644
--- a/dom/tv/TVTuner.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DOMMediaStream.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/TVCurrentSourceChangedEvent.h"
-#include "mozilla/dom/TVServiceCallbacks.h"
-#include "mozilla/dom/TVServiceFactory.h"
-#include "mozilla/dom/TVSource.h"
-#include "mozilla/dom/TVUtils.h"
-#include "nsISupportsPrimitives.h"
-#include "nsITVService.h"
-#include "nsITVSimulatorService.h"
-#include "nsServiceManagerUtils.h"
-#include "TVTuner.h"
-#include "mozilla/dom/HTMLVideoElement.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(TVTuner, DOMEventTargetHelper,
-                                   mTVService, mStream, mCurrentSource, mSources)
-
-NS_IMPL_ADDREF_INHERITED(TVTuner, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(TVTuner, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TVTuner)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-TVTuner::TVTuner(nsPIDOMWindowInner* aWindow)
-  : DOMEventTargetHelper(aWindow)
-  , mStreamType(0)
-{
-}
-
-TVTuner::~TVTuner()
-{
-}
-
-/* static */ already_AddRefed<TVTuner>
-TVTuner::Create(nsPIDOMWindowInner* aWindow,
-                nsITVTunerData* aData)
-{
-  RefPtr<TVTuner> tuner = new TVTuner(aWindow);
-  return (tuner->Init(aData)) ? tuner.forget() : nullptr;
-}
-
-bool
-TVTuner::Init(nsITVTunerData* aData)
-{
-  NS_ENSURE_TRUE(aData, false);
-
-  nsresult rv = aData->GetId(mId);
-  NS_ENSURE_SUCCESS(rv, false);
-  if (NS_WARN_IF(mId.IsEmpty())) {
-    return false;
-  }
-
-  uint32_t count;
-  char** supportedSourceTypes;
-  rv = aData->GetSupportedSourceTypes(&count, &supportedSourceTypes);
-  NS_ENSURE_SUCCESS(rv, false);
-
-  for (uint32_t i = 0; i < count; i++) {
-    TVSourceType sourceType = ToTVSourceType(supportedSourceTypes[i]);
-    if (NS_WARN_IF(sourceType == TVSourceType::EndGuard_)) {
-      continue;
-    }
-
-    // Generate the source instance based on the supported source type.
-    RefPtr<TVSource> source = TVSource::Create(GetOwner(), sourceType, this);
-    if (NS_WARN_IF(!source)) {
-      continue;
-    }
-
-    mSupportedSourceTypes.AppendElement(sourceType);
-    mSources.AppendElement(source);
-  }
-  NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, supportedSourceTypes);
-
-  mTVService = TVServiceFactory::AutoCreateTVService();
-  NS_ENSURE_TRUE(mTVService, false);
-
-  rv = aData->GetStreamType(&mStreamType);
-  NS_ENSURE_SUCCESS(rv, false);
-
-  return true;
-}
-
-/* virtual */ JSObject*
-TVTuner::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return TVTunerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-nsresult
-TVTuner::SetCurrentSource(TVSourceType aSourceType)
-{
-  ErrorResult error;
-  if (mCurrentSource) {
-    if (aSourceType == mCurrentSource->Type()) {
-      // No actual change.
-      return NS_OK;
-    }
-
-    // No need to stay tuned for non-current sources.
-    nsresult rv = mCurrentSource->UnsetCurrentChannel();
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-  }
-
-  for (uint32_t i = 0; i < mSources.Length(); i++) {
-    if (aSourceType == mSources[i]->Type()) {
-      mCurrentSource = mSources[i];
-      break;
-    }
-  }
-
-  nsresult rv = InitMediaStream();
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  return DispatchCurrentSourceChangedEvent(mCurrentSource);
-}
-
-nsresult
-TVTuner::DispatchTVEvent(nsIDOMEvent* aEvent)
-{
-  return DispatchTrustedEvent(aEvent);
-}
-
-void
-TVTuner::GetSupportedSourceTypes(nsTArray<TVSourceType>& aSourceTypes,
-                                 ErrorResult& aRv) const
-{
-  aSourceTypes = mSupportedSourceTypes;
-}
-
-already_AddRefed<Promise>
-TVTuner::GetSources(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  promise->MaybeResolve(mSources);
-
-  return promise.forget();
-}
-
-already_AddRefed<Promise>
-TVTuner::SetCurrentSource(const TVSourceType aSourceType, ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // |SetCurrentSource(const TVSourceType)| will be called once |notifySuccess|
-  // of the callback is invoked.
-  nsCOMPtr<nsITVServiceCallback> callback =
-    new TVServiceSourceSetterCallback(this, promise, aSourceType);
-  nsresult rv = mTVService->SetSource(mId, ToTVSourceTypeStr(aSourceType), callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
-  }
-
-  return promise.forget();
-}
-
-void
-TVTuner::GetId(nsAString& aId) const
-{
-  aId = mId;
-}
-
-already_AddRefed<TVSource>
-TVTuner::GetCurrentSource() const
-{
-  RefPtr<TVSource> currentSource = mCurrentSource;
-  return currentSource.forget();
-}
-
-already_AddRefed<DOMMediaStream>
-TVTuner::GetStream() const
-{
-  RefPtr<DOMMediaStream> stream = mStream;
-  return stream.forget();
-}
-
-nsresult
-TVTuner::ReloadMediaStream()
-{
-  return InitMediaStream();
-}
-
-nsresult
-TVTuner::InitMediaStream()
-{
-  nsCOMPtr<nsPIDOMWindowInner> window = GetOwner();
-  RefPtr<DOMMediaStream> stream = nullptr;
-  if (mStreamType == nsITVTunerData::TV_STREAM_TYPE_HW) {
-    stream = DOMHwMediaStream::CreateHwStream(window);
-  } else if (mStreamType == nsITVTunerData::TV_STREAM_TYPE_SIMULATOR) {
-    stream = CreateSimulatedMediaStream();
-  }
-
-  mStream = stream.forget();
-  return NS_OK;
-}
-
-already_AddRefed<DOMMediaStream>
-TVTuner::CreateSimulatedMediaStream()
-{
-  nsCOMPtr<nsPIDOMWindowInner> domWin = GetOwner();
-  if (NS_WARN_IF(!domWin)) {
-    return nullptr;
-  }
-
-  nsIDocument* doc = domWin->GetExtantDoc();
-  if (NS_WARN_IF(!doc)) {
-    return nullptr;
-  }
-
-  ErrorResult error;
-  ElementCreationOptionsOrString options;
-
-  options.SetAsString();
-  RefPtr<Element> element = doc->CreateElement(VIDEO_TAG, options, error);
-  if (NS_WARN_IF(error.Failed())) {
-    error.SuppressException();
-    return nullptr;
-  }
-
-  nsCOMPtr<nsIContent> content(do_QueryInterface(element));
-  if (NS_WARN_IF(!content)) {
-    return nullptr;
-  }
-
-  HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(content.get());
-  if (NS_WARN_IF(!mediaElement)) {
-    return nullptr;
-  }
-
-  mediaElement->SetAutoplay(true, error);
-  if (NS_WARN_IF(error.Failed())) {
-    error.SuppressException();
-    return nullptr;
-  }
-
-  mediaElement->SetLoop(true, error);
-  if (NS_WARN_IF(error.Failed())) {
-    error.SuppressException();
-    return nullptr;
-  }
-
-  nsCOMPtr<nsITVSimulatorService> simService(do_QueryInterface(mTVService));
-  if (NS_WARN_IF(!simService)) {
-    return nullptr;
-  }
-
-  if (NS_WARN_IF(!mCurrentSource)) {
-    return nullptr;
-  }
-
-  RefPtr<TVChannel> currentChannel = mCurrentSource->GetCurrentChannel();
-  if (NS_WARN_IF(!currentChannel)) {
-    return nullptr;
-  }
-
-  nsString currentChannelNumber;
-  currentChannel->GetNumber(currentChannelNumber);
-  if (currentChannelNumber.IsEmpty()) {
-    return nullptr;
-  }
-
-  nsString currentVideoBlobUrl;
-  nsresult rv = simService->GetSimulatorVideoBlobURL(mId,
-                                                     ToTVSourceTypeStr(mCurrentSource->Type()),
-                                                     currentChannelNumber,
-                                                     domWin,
-                                                     currentVideoBlobUrl);
-  if (NS_WARN_IF(NS_FAILED(rv) || currentVideoBlobUrl.IsEmpty())) {
-    return nullptr;
-  }
-
-  mediaElement->SetSrc(currentVideoBlobUrl, error);
-  if (NS_WARN_IF(error.Failed())) {
-    error.SuppressException();
-    return nullptr;
-  }
-
-  // See Media Capture from DOM Elements spec.
-  // http://www.w3.org/TR/mediacapture-fromelement/
-  RefPtr<DOMMediaStream> stream = mediaElement->MozCaptureStream(error);
-  if (NS_WARN_IF(error.Failed())) {
-    error.SuppressException();
-    return nullptr;
-  }
-
-  return stream.forget();
-}
-
-nsresult
-TVTuner::DispatchCurrentSourceChangedEvent(TVSource* aSource)
-{
-  TVCurrentSourceChangedEventInit init;
-  init.mSource = aSource;
-  nsCOMPtr<nsIDOMEvent> event =
-    TVCurrentSourceChangedEvent::Constructor(this,
-                                             NS_LITERAL_STRING("currentsourcechanged"),
-                                             init);
-  nsCOMPtr<nsIRunnable> runnable =
-    NewRunnableMethod<nsCOMPtr<nsIDOMEvent>>(this,
-                                             &TVTuner::DispatchTVEvent,
-                                             event);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-nsresult
-TVTuner::NotifyImageSizeChanged(uint32_t aWidth, uint32_t aHeight)
-{
-  DOMHwMediaStream* hwMediaStream = mStream->AsDOMHwMediaStream();
-
-  if (hwMediaStream) {
-    hwMediaStream->SetImageSize(aWidth, aHeight);
-  }
-
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVTuner.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVTuner_h
-#define mozilla_dom_TVTuner_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-// Include TVTunerBinding.h since enum TVSourceType can't be forward declared.
-#include "mozilla/dom/TVTunerBinding.h"
-
-#define VIDEO_TAG NS_LITERAL_STRING("video")
-
-class nsITVService;
-class nsITVTunerData;
-
-namespace mozilla {
-
-class DOMMediaStream;
-
-namespace dom {
-
-class Promise;
-class TVSource;
-
-class TVTuner final : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TVTuner, DOMEventTargetHelper)
-
-  static already_AddRefed<TVTuner> Create(nsPIDOMWindowInner* aWindow,
-                                          nsITVTunerData* aData);
-  nsresult NotifyImageSizeChanged(uint32_t aWidth, uint32_t aHeight);
-
-  // WebIDL (internal functions)
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  nsresult SetCurrentSource(TVSourceType aSourceType);
-
-  nsresult DispatchTVEvent(nsIDOMEvent* aEvent);
-
-  // WebIDL (public APIs)
-
-  void GetSupportedSourceTypes(nsTArray<TVSourceType>& aSourceTypes,
-                               ErrorResult& aRv) const;
-
-  already_AddRefed<Promise> GetSources(ErrorResult& aRv);
-
-  already_AddRefed<Promise> SetCurrentSource(const TVSourceType aSourceType,
-                                             ErrorResult& aRv);
-
-  void GetId(nsAString& aId) const;
-
-  already_AddRefed<TVSource> GetCurrentSource() const;
-
-  already_AddRefed<DOMMediaStream> GetStream() const;
-
-  IMPL_EVENT_HANDLER(currentsourcechanged);
-
-  nsresult ReloadMediaStream();
-
-private:
-  explicit TVTuner(nsPIDOMWindowInner* aWindow);
-
-  ~TVTuner();
-
-  bool Init(nsITVTunerData* aData);
-
-  nsresult InitMediaStream();
-
-  already_AddRefed<DOMMediaStream> CreateSimulatedMediaStream();
-
-  nsresult DispatchCurrentSourceChangedEvent(TVSource* aSource);
-
-  nsCOMPtr<nsITVService> mTVService;
-  RefPtr<DOMMediaStream> mStream;
-  uint16_t mStreamType;
-  RefPtr<TVSource> mCurrentSource;
-  nsTArray<RefPtr<TVSource>> mSources;
-  nsString mId;
-  nsTArray<TVSourceType> mSupportedSourceTypes;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVTuner_h
deleted file mode 100644
--- a/dom/tv/TVTypes.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/TVUtils.h"
-#include "nsCRTGlue.h"
-#include "TVTypes.h"
-
-namespace mozilla {
-namespace dom {
-
-/*
- * Implementation of TVTunerData
- */
-
-NS_IMPL_ISUPPORTS(TVTunerData, nsITVTunerData)
-
-TVTunerData::TVTunerData()
-  : mSupportedSourceTypes(nullptr)
-  , mCount(0)
-  , mStreamType(0)
-{
-}
-
-TVTunerData::~TVTunerData()
-{
-  if (mSupportedSourceTypes) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mSupportedSourceTypes);
-  }
-}
-
-NS_IMETHODIMP
-TVTunerData::GetId(nsAString& aId)
-{
-  aId = mId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVTunerData::SetId(const nsAString& aId)
-{
-  if (aId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mId = aId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVTunerData::GetStreamType(uint16_t* aStreamType)
-{
-  *aStreamType = mStreamType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVTunerData::SetStreamType(const uint16_t aStreamType)
-{
-  mStreamType = aStreamType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVTunerData::GetSupportedSourceTypes(uint32_t* aCount,
-                                     char*** aSourceTypes)
-{
-  *aCount = mCount;
-
-  char** sourceTypes = (mCount > 0) ?
-                       static_cast<char **>(moz_xmalloc(mCount * sizeof(char*))) :
-                       nullptr;
-  for (uint32_t i = 0; i < mCount; i++) {
-    sourceTypes[i] = NS_strdup(mSupportedSourceTypes[i]);
-  }
-
-  *aSourceTypes = sourceTypes;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVTunerData::SetSupportedSourceTypes(uint32_t aCount,
-                                     const char** aSourceTypes)
-{
-  if (aCount == 0) {
-    return NS_ERROR_INVALID_ARG;
-  }
-  NS_ENSURE_ARG_POINTER(aSourceTypes);
-
-  for (uint32_t i = 0; i < aCount; i++) {
-    if (TVSourceType::EndGuard_ == ToTVSourceType(aSourceTypes[i])) {
-      return NS_ERROR_INVALID_ARG;
-    }
-  }
-
-  if (mSupportedSourceTypes) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mSupportedSourceTypes);
-  }
-
-  mCount = aCount;
-
-  mSupportedSourceTypes = (mCount > 0) ?
-                          static_cast<char **>(moz_xmalloc(mCount * sizeof(char*))) :
-                          nullptr;
-  for (uint32_t i = 0; i < mCount; i++) {
-    mSupportedSourceTypes[i] = NS_strdup(aSourceTypes[i]);
-  }
-
-  return NS_OK;
-}
-
-
-/*
- * Implementation of TVChannelData
- */
-
-NS_IMPL_ISUPPORTS(TVChannelData, nsITVChannelData)
-
-TVChannelData::TVChannelData()
-  : mIsEmergency(false)
-  , mIsFree(false)
-{
-}
-
-TVChannelData::~TVChannelData()
-{
-}
-
-NS_IMETHODIMP
-TVChannelData::GetNetworkId(nsAString& aNetworkId)
-{
-  aNetworkId = mNetworkId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetNetworkId(const nsAString& aNetworkId)
-{
-  if (aNetworkId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mNetworkId = aNetworkId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetTransportStreamId(nsAString& aTransportStreamId)
-{
-  aTransportStreamId = mTransportStreamId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetTransportStreamId(const nsAString& aTransportStreamId)
-{
-  if (aTransportStreamId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mTransportStreamId = aTransportStreamId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetServiceId(nsAString& aServiceId)
-{
-  aServiceId = mServiceId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetServiceId(const nsAString& aServiceId)
-{
-  if (aServiceId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mServiceId = aServiceId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetType(nsAString& aType)
-{
-  aType = mType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetType(const nsAString& aType)
-{
-  if (aType.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (TVChannelType::EndGuard_ == ToTVChannelType(aType)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mType = aType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetNumber(nsAString& aNumber)
-{
-  aNumber = mNumber;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetNumber(const nsAString& aNumber)
-{
-  if (aNumber.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mNumber = aNumber;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetName(nsAString& aName)
-{
-  aName = mName;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetName(const nsAString& aName)
-{
-  if (aName.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mName = aName;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetIsEmergency(bool *aIsEmergency)
-{
-  *aIsEmergency = mIsEmergency;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetIsEmergency(bool aIsEmergency)
-{
-  mIsEmergency = aIsEmergency;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::GetIsFree(bool *aIsFree)
-{
-  *aIsFree = mIsFree;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVChannelData::SetIsFree(bool aIsFree)
-{
-  mIsFree = aIsFree;
-  return NS_OK;
-}
-
-
-/*
- * Implementation of TVProgramData
- */
-
-NS_IMPL_ISUPPORTS(TVProgramData, nsITVProgramData)
-
-TVProgramData::TVProgramData()
-  : mStartTime(0)
-  , mDuration(0)
-  , mAudioLanguages(nullptr)
-  , mAudioLanguageCount(0)
-  , mSubtitleLanguages(nullptr)
-  , mSubtitleLanguageCount(0)
-{
-}
-
-TVProgramData::~TVProgramData()
-{
-  if (mAudioLanguages) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mAudioLanguageCount, mAudioLanguages);
-  }
-  if (mSubtitleLanguages) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mSubtitleLanguageCount, mSubtitleLanguages);
-  }
-}
-
-NS_IMETHODIMP
-TVProgramData::GetEventId(nsAString& aEventId)
-{
-  aEventId = mEventId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetEventId(const nsAString& aEventId)
-{
-  if (aEventId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mEventId = aEventId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetTitle(nsAString& aTitle)
-{
-  aTitle = mTitle;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetTitle(const nsAString& aTitle)
-{
-  if (aTitle.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mTitle = aTitle;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetStartTime(uint64_t *aStartTime)
-{
-  *aStartTime = mStartTime;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetStartTime(uint64_t aStartTime)
-{
-  mStartTime = aStartTime;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetDuration(uint64_t *aDuration)
-{
-  *aDuration = mDuration;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetDuration(uint64_t aDuration)
-{
-  mDuration = aDuration;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetDescription(nsAString& aDescription)
-{
-  aDescription = mDescription;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetDescription(const nsAString& aDescription)
-{
-  mDescription = aDescription;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetRating(nsAString& aRating)
-{
-  aRating = mRating;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetRating(const nsAString& aRating)
-{
-  mRating = aRating;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetAudioLanguages(uint32_t* aCount,
-                                 char*** aLanguages)
-{
-  *aCount = mAudioLanguageCount;
-
-  char** languages = (mAudioLanguageCount > 0) ?
-                     static_cast<char **>(moz_xmalloc(mAudioLanguageCount * sizeof(char*))) :
-                     nullptr;
-  for (uint32_t i = 0; i < mAudioLanguageCount; i++) {
-    languages[i] = NS_strdup(mAudioLanguages[i]);
-  }
-
-  *aLanguages = languages;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetAudioLanguages(uint32_t aCount,
-                                 const char** aLanguages)
-{
-  if (aCount > 0) {
-    NS_ENSURE_ARG_POINTER(aLanguages);
-  }
-
-  if (mAudioLanguages) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mAudioLanguageCount, mAudioLanguages);
-  }
-
-  mAudioLanguageCount = aCount;
-
-  mAudioLanguages = (mAudioLanguageCount > 0) ?
-                    static_cast<char **>(moz_xmalloc(mAudioLanguageCount * sizeof(char*))) :
-                    nullptr;
-  for (uint32_t i = 0; i < mAudioLanguageCount; i++) {
-    mAudioLanguages[i] = NS_strdup(aLanguages[i]);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::GetSubtitleLanguages(uint32_t* aCount,
-                                    char*** aLanguages)
-{
-  *aCount = mSubtitleLanguageCount;
-
-  char** languages = (mSubtitleLanguageCount > 0) ?
-                     static_cast<char **>(moz_xmalloc(mSubtitleLanguageCount * sizeof(char*))) :
-                     nullptr;
-  for (uint32_t i = 0; i < mSubtitleLanguageCount; i++) {
-    languages[i] = NS_strdup(mSubtitleLanguages[i]);
-  }
-
-  *aLanguages = languages;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TVProgramData::SetSubtitleLanguages(uint32_t aCount,
-                                    const char** aLanguages)
-{
-  if (aCount > 0) {
-    NS_ENSURE_ARG_POINTER(aLanguages);
-  }
-
-  if (mSubtitleLanguages) {
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mSubtitleLanguageCount, mSubtitleLanguages);
-  }
-
-  mSubtitleLanguageCount = aCount;
-
-  mSubtitleLanguages = (mSubtitleLanguageCount > 0) ?
-                       static_cast<char **>(moz_xmalloc(mSubtitleLanguageCount * sizeof(char*))) :
-                       nullptr;
-  for (uint32_t i = 0; i < mSubtitleLanguageCount; i++) {
-    mSubtitleLanguages[i] = NS_strdup(aLanguages[i]);
-  }
-
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/tv/TVTypes.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVTypes_h
-#define mozilla_dom_TVTypes_h
-
-#include "nsITVService.h"
-
-namespace mozilla {
-namespace dom {
-
-class TVTunerData final : public nsITVTunerData
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSITVTUNERDATA
-
-  TVTunerData();
-
-private:
-  ~TVTunerData();
-
-  nsString mId;
-  char** mSupportedSourceTypes;
-  uint32_t mCount;
-  uint16_t mStreamType;
-};
-
-class TVChannelData final : public nsITVChannelData
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSITVCHANNELDATA
-
-  TVChannelData();
-
-private:
-  ~TVChannelData();
-
-  nsString mNetworkId;
-  nsString mTransportStreamId;
-  nsString mServiceId;
-  nsString mType;
-  nsString mNumber;
-  nsString mName;
-  bool mIsEmergency;
-  bool mIsFree;
-};
-
-class TVProgramData final : public nsITVProgramData
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSITVPROGRAMDATA
-
-  TVProgramData();
-
-private:
-  ~TVProgramData();
-
-  nsString mEventId;
-  nsString mTitle;
-  uint64_t mStartTime;
-  uint64_t mDuration;
-  nsString mDescription;
-  nsString mRating;
-  char** mAudioLanguages;
-  uint32_t mAudioLanguageCount;
-  char** mSubtitleLanguages;
-  uint32_t mSubtitleLanguageCount;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVTypes_h
deleted file mode 100644
--- a/dom/tv/TVUtils.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_TVUtils_h
-#define mozilla_dom_TVUtils_h
-
-// Include TVChannelBinding.h since enum TVChannelType can't be forward declared.
-#include "mozilla/dom/TVChannelBinding.h"
-// Include TVSourceBinding.h since enum TVSourceType can't be forward declared.
-#include "mozilla/dom/TVSourceBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-inline nsString
-ToTVSourceTypeStr(const TVSourceType aSourceType)
-{
-  MOZ_ASSERT(uint32_t(aSourceType) < ArrayLength(TVSourceTypeValues::strings));
-
-  nsString str;
-  str.AssignASCII(TVSourceTypeValues::strings[uint32_t(aSourceType)].value);
-  return str;
-}
-
-inline TVSourceType
-ToTVSourceType(const nsAString& aStr)
-{
-  if (aStr.EqualsLiteral("dvb-t")) {
-    return TVSourceType::Dvb_t;
-  }
-
-  if (aStr.EqualsLiteral("dvb-t2")) {
-    return TVSourceType::Dvb_t2;
-  }
-
-  if (aStr.EqualsLiteral("dvb-c")) {
-    return TVSourceType::Dvb_c;
-  }
-
-  if (aStr.EqualsLiteral("dvb-c2")) {
-    return TVSourceType::Dvb_c2;
-  }
-
-  if (aStr.EqualsLiteral("dvb-s")) {
-    return TVSourceType::Dvb_s;
-  }
-
-  if (aStr.EqualsLiteral("dvb-s2")) {
-    return TVSourceType::Dvb_s2;
-  }
-
-  if (aStr.EqualsLiteral("dvb-h")) {
-    return TVSourceType::Dvb_h;
-  }
-
-  if (aStr.EqualsLiteral("dvb-sh")) {
-    return TVSourceType::Dvb_sh;
-  }
-
-  if (aStr.EqualsLiteral("atsc")) {
-    return TVSourceType::Atsc;
-  }
-
-  if (aStr.EqualsLiteral("atsc-m/h")) {
-    return TVSourceType::Atsc_m_h;
-  }
-
-  if (aStr.EqualsLiteral("isdb-t")) {
-    return TVSourceType::Isdb_t;
-  }
-
-  if (aStr.EqualsLiteral("isdb-tb")) {
-    return TVSourceType::Isdb_tb;
-  }
-
-  if (aStr.EqualsLiteral("isdb-s")) {
-    return TVSourceType::Isdb_s;
-  }
-
-  if (aStr.EqualsLiteral("isdb-c")) {
-    return TVSourceType::Isdb_c;
-  }
-
-  if (aStr.EqualsLiteral("1seg")) {
-    return TVSourceType::_1seg;
-  }
-
-  if (aStr.EqualsLiteral("dtmb")) {
-    return TVSourceType::Dtmb;
-  }
-
-  if (aStr.EqualsLiteral("cmmb")) {
-    return TVSourceType::Cmmb;
-  }
-
-  if (aStr.EqualsLiteral("t-dmb")) {
-    return TVSourceType::T_dmb;
-  }
-
-  if (aStr.EqualsLiteral("s-dmb")) {
-    return TVSourceType::S_dmb;
-  }
-
-  return TVSourceType::EndGuard_;
-}
-
-inline TVSourceType
-ToTVSourceType(const char* aStr)
-{
-  nsString str;
-  str.AssignASCII(aStr);
-  return ToTVSourceType(str);
-}
-
-inline TVChannelType
-ToTVChannelType(const nsAString& aStr)
-{
-  if (aStr.EqualsLiteral("tv")) {
-    return TVChannelType::Tv;
-  }
-
-  if (aStr.EqualsLiteral("radio")) {
-    return TVChannelType::Radio;
-  }
-
-  if (aStr.EqualsLiteral("data")) {
-    return TVChannelType::Data;
-  }
-
-  return TVChannelType::EndGuard_;
-}
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_TVUtils_h
deleted file mode 100644
--- a/dom/tv/moz.build
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS.mozilla.dom += [
-    'TVChannel.h',
-    'TVListeners.h',
-    'TVManager.h',
-    'TVProgram.h',
-    'TVServiceCallbacks.h',
-    'TVServiceFactory.h',
-    'TVServiceRunnables.h',
-    'TVSource.h',
-    'TVTuner.h',
-    'TVTypes.h',
-    'TVUtils.h',
-]
-
-UNIFIED_SOURCES += [
-    'TVChannel.cpp',
-    'TVListeners.cpp',
-    'TVManager.cpp',
-    'TVProgram.cpp',
-    'TVServiceCallbacks.cpp',
-    'TVServiceFactory.cpp',
-    'TVSource.cpp',
-    'TVTuner.cpp',
-    'TVTypes.cpp',
-]
-
-XPIDL_SOURCES += [
-    'nsITVService.idl',
-    'nsITVSimulatorService.idl',
-]
-
-EXTRA_COMPONENTS += [
-    'TVSimulatorService.js',
-    'TVSimulatorService.manifest',
-]
-
-XPIDL_MODULE = 'dom_tv'
-
-MOCHITEST_MANIFESTS  += ['test/mochitest/mochitest.ini']
-
-MOCHITEST_CHROME_MANIFESTS  += ['test/mochitest/chrome.ini']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/dom/tv/nsITVService.idl
+++ /dev/null
@@ -1,393 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-
-%{C++
-#define TV_TUNER_DATA_CID \
-  { 0x1f36be28, 0xf9fe, 0x2dc3, { 0xbf, 0x2a, 0x17, 0x97, 0x93, 0x40, 0xff, 0xe1 } }
-#define TV_TUNER_DATA_CONTRACTID \
-  "@mozilla.org/tv/tvtunerdata;1"
-%}
-
-/**
- * XPCOM component which acts as the container for tuner data.
- *
- * NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
- * and then uses the setter functions to adjust the properties of the object
- * before passing it.
- */
-[scriptable, builtinclass, uuid(c6d39e86-022b-4db5-b0df-602abfbeac69)]
-interface nsITVTunerData : nsISupports
-{
-  /**
-   * Switch TVTuner.stream type.
-   *  TV_STREAM_TYPE_SIMULATOR : Simulate the MediaStream. This MediaStream load from Profile Directory.
-   *  TV_STREAM_TYPE_HW        : Get from real device
-   */
-  const unsigned short TV_STREAM_TYPE_SIMULATOR = 0;
-  const unsigned short TV_STREAM_TYPE_HW = 1;
-
-  attribute unsigned short streamType;
-
-  attribute DOMString id;
-
-  /**
-   * Get the supported source types of the tuner. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count       The number of supported source types.
-   * @param sourceTypes An array of supported source types.
-   */
-  void getSupportedSourceTypes([optional] out unsigned long count,
-                               [retval, array, size_is(count)] out string sourceTypes);
-
-  /**
-   * Set the supported source types of the tuner. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count       The number of supported source types.
-   * @param sourceTypes An array of supported source types.
-   */
-  void setSupportedSourceTypes(in unsigned long count,
-                               [array, size_is(count)] in string sourceTypes);
-};
-
-%{C++
-#define TV_CHANNEL_DATA_CID \
-  { 0xdafe6881, 0x0964, 0xdb5b, { 0x59, 0xc6, 0x20, 0x0b, 0xa6, 0x59, 0xe6, 0x68 } }
-#define TV_CHANNEL_DATA_CONTRACTID \
-  "@mozilla.org/tv/tvchanneldata;1"
-%}
-
-/**
- * XPCOM component which acts as the container for channel data.
- *
- * NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
- * and then uses the setter functions to adjust the properties of the object
- * before passing it.
- */
-[scriptable, builtinclass, uuid(5d01ea74-2db6-11e4-9dba-74d02b97e723)]
-interface nsITVChannelData : nsISupports
-{
-  attribute DOMString networkId;
-  attribute DOMString transportStreamId;
-  attribute DOMString serviceId;
-  attribute DOMString type;
-  attribute DOMString number;
-  attribute DOMString name;
-  [infallible] attribute boolean isEmergency;
-  [infallible] attribute boolean isFree;
-};
-
-%{C++
-#define TV_PROGRAM_DATA_CID \
-  { 0x11415eeb, 0x27a6, 0x1c04, { 0x91, 0x33, 0x3e, 0x0a, 0xdd, 0x48, 0x5d, 0xb3 } }
-#define TV_PROGRAM_DATA_CONTRACTID \
-  "@mozilla.org/tv/tvprogramdata;1"
-%}
-
-/**
- * XPCOM component which acts as the container for program data.
- *
- * NOTE: Use do_CreateInstance() to create the Gecko provided implementation,
- * and then uses the setter functions to adjust the properties of the object
- * before passing it.
- */
-[scriptable, builtinclass, uuid(ed65422e-2d97-11e4-89d6-74d02b97e723)]
-interface nsITVProgramData : nsISupports
-{
-  attribute DOMString eventId;
-  attribute DOMString title;
-  [infallible] attribute unsigned long long startTime;
-  [infallible] attribute unsigned long long duration;
-  attribute DOMString description;
-  attribute DOMString rating;
-
-  /**
-   * Get the audio languages of the program. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count     The number of languages.
-   * @param languages An array of languages.
-   */
-  void getAudioLanguages([optional] out unsigned long count,
-                         [retval, array, size_is(count)] out string languages);
-
-  /**
-   * Set the audio languages of the program. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count     The number of languages.
-   * @param languages An array of languages.
-   */
-  void setAudioLanguages(in unsigned long count,
-                         [array, size_is(count)] in string languages);
-
-  /**
-   * Get the subtitle languages of the program. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count     The number of languages.
-   * @param languages An array of languages.
-   */
-  void getSubtitleLanguages([optional] out unsigned long count,
-                            [retval, array, size_is(count)] out string languages);
-
-  /**
-   * Set the subtitle languages of the program. Please refer to
-   * http://seanyhlin.github.io/TV-Manager-API/ for available values.
-   *
-   * @param count     The number of languages.
-   * @param languages An array of languages.
-   */
-  void setSubtitleLanguages(in unsigned long count,
-                            [array, size_is(count)] in string languages);
-};
-
-[scriptable, builtinclass, uuid(47746633-1b77-4df4-9424-d315bde3d455)]
-interface nsITVSourceListener : nsISupports
-{
-  /**
-   * Called when a channel is detected through scanning (after
-   * |nsITVService::startScanningChannels()| is invoked and probably before
-   * |nsITVService::stopScanningChannels()|, if any, is invoked).
-   *
-   * @param tunerId     The ID of the tuner which the source belongs to.
-   * @param sourceType  The type of the source which the channel belongs to.
-   *                    Please refer to http://seanyhlin.github.io/TV-Manager-API/
-   *                    for available values.
-   * @param channelData The data of the added channel.
-   */
-  void notifyChannelScanned(in DOMString tunerId,
-                            in DOMString sourceType,
-                            in nsITVChannelData channelData);
-
-  /**
-   * Called when the operation of channel scanning is complete (after
-   * |nsITVService::startScanningChannels()| is invoked).
-   *
-   * @param tunerId     The ID of the tuner which the source belongs to.
-   * @param sourceType  The type of the source which the channel belongs to.
-   *                    Please refer to http://seanyhlin.github.io/TV-Manager-API/
-   *                    for available values.
-   */
-  void notifyChannelScanComplete(in DOMString tunerId,
-                                 in DOMString sourceType);
-
-  /**
-   * Called when the operation of channel scanning is forced to stop due to
-   * something wrong during scanning.
-   *
-   * @param tunerId     The ID of the tuner which the source belongs to.
-   * @param sourceType  The type of the source which the channel belongs to.
-   *                    Please refer to http://seanyhlin.github.io/TV-Manager-API/
-   *                    for available values.
-   */
-  void notifyChannelScanStopped(in DOMString tunerId,
-                                in DOMString sourceType);
-
-  /**
-   * Called when a new EIT is broadcasted.
-   *
-   * @param tunerId         The ID of the tuner which the source belongs to.
-   * @param sourceType      The type of the source which the channel belongs to.
-   *                        Please refer to http://seanyhlin.github.io/TV-Manager-API/
-   *                        for available values.
-   * @param channelData     The channel data which the programs belong to.
-   * @param programDataList An array of correspondent program data.
-   * @param count           The number of programs.
-   */
-  void notifyEITBroadcasted(in DOMString tunerId,
-                            in DOMString sourceType,
-                            in nsITVChannelData channelData,
-                            [array, size_is(count)] in nsITVProgramData programDataList,
-                            in unsigned long count);
-};
-
-[scriptable, builtinclass, uuid(01582a11-4707-455d-8d2a-2c8de8227dad)]
-interface nsITVServiceCallback : nsISupports
-{
-  const unsigned short TV_ERROR_OK = 0;
-  const unsigned short TV_ERROR_FAILURE = 1;
-  const unsigned short TV_ERROR_INVALID_ARG = 2;
-  const unsigned short TV_ERROR_NO_SIGNAL = 3;
-  const unsigned short TV_ERROR_NOT_SUPPORTED = 4;
-
-  /**
-   * Called when something wrong happens.
-   *
-   * @param errorCode Error code listed above from the underlying layer.
-   */
-  void notifyError(in unsigned short errorCode);
-
-  /**
-   * Called when the operation succeeds.
-   *
-   * @param dataList A list of data.
-   *                 An array of |nsITVTunerData| when used for |getTuners()|.
-   *                 An array of |nsITVChannelData| ordered by the LCN (Logical
-   *                 Channel Number) when used for |getChannels()|.
-   *                 An array of |nsITVProgramData| ordered by the start time
-   *                 for |getPrograms()|.
-   *                 An array of |nsITVChannelData| with only one element for
-   *                 |setChannel()|.
-   *                 An array of |nsISupportsString| with only one element for
-   *                 |getOverlayId()|.
-   *
-   * NOTE: |nsIArray| is adopted to prevent this interface from being split into
-   * multiple interfaces with different |notifySuccess|. Though the
-   * implementation of TV service may need |nsIMutableArray| to fill in the
-   * array, it doesn't seem necessary for other places to use the mutable one.
-   */
-  void notifySuccess([optional] in nsIArray dataList);
-};
-
-%{C++
-#define TV_SERVICE_CONTRACTID \
-  "@mozilla.org/tv/tvservice;1"
-%}
-
-/**
- * XPCOM component which interacts with the underlying TV components.
- *
- * NOTE: The implementation is expected to be done by TV vendors to cooperate
- * with their own TV stack. The methods should not be called on any thread
- * except for the XPCOM main thread.
- *
- * NOTE: The callbacks passing in the methods must be called asynchronously. In
- * the implementation, actual runnable objects may need to be created and call
- * the callback off of the runnables, after the function returns.
- * TVServiceRunnables.h provides some ready-made runnables and could be used in
- * the following way.
- *
- * nsCOMPtr<nsIRunnable> runnable =
- *   new TVServiceNotifyRunnable(callback, dataList, optional errorCode);
- * return NS_DispatchToCurrentThread(runnable);
- */
-[scriptable, uuid(e52f93f1-6071-468b-a198-d8e6bc5ca348)]
-interface nsITVService : nsISupports
-{
-  attribute nsITVSourceListener sourceListener;
-
-  /**
-   * Get all tuners.
-   *
-   * @param callback   The callback object where either |notifyError| or
-   *                   |notifySuccess|, which takes an array of
-   *                   |nsITVTunerData|, is expected.
-   */
-  void getTuners(in nsITVServiceCallback callback);
-
-  /**
-   * Set the source type to be used by the given tuner.
-   *
-   * @param tunerId    The ID of the tuner.
-   * @param sourceType The source type to be used.
-   * @param callback   The callback object where either |notifyError| or
-   *                   |notifySuccess| is expected.
-   */
-  void setSource(in DOMString tunerId,
-                 in DOMString sourceType,
-                 in nsITVServiceCallback callback);
-
-  /**
-   * Start scanning channels on the given tuner.
-   *
-   * Once the operation successfully starts, a series of |notifyChannelScanned|
-   * from |nsITVSourceListener| are expected, and followed by one of either
-   * |notifyChannelScanComplete| or |notifyChannelScanStopped|.
-   *
-   * @param tunerId     The ID of the tuner.
-   * @param sourceType  The source type to be used.
-   * @param callback    The callback object where either |notifyError| or
-   *                    |notifySuccess| is expected.
-   */
-  void startScanningChannels(in DOMString tunerId,
-                             in DOMString sourceType,
-                             in nsITVServiceCallback callback);
-
-  /**
-   * Stop scanning channels on the given tuner.
-   *
-   * Once the operation succeeds, a call of |notifyChannelScanStopped| from
-   * |nsITVSourceListener| should be expected.
-   *
-   * @param tunerId    The ID of the tuner.
-   * @param sourceType The source type to be used.
-   * @param callback   The callback object where either |notifyError| or
-   *                   |notifySuccess| is expected.
-   */
-  void stopScanningChannels(in DOMString tunerId,
-                            in DOMString sourceType,
-                            in nsITVServiceCallback callback);
-
-  /**
-   * Clear the cache for scanned channels, if any, from the underlying layer.
-   */
-  void clearScannedChannelsCache();
-
-  /**
-   * Set the channel to be used by the tuner.
-   *
-   * @param tunerId       The ID of the tuner.
-   * @param sourceType    The source type to be used.
-   * @param channelNumber The LCN (Logical Channel Number) of the channel.
-   * @param callback      The callback object where either |notifyError| or
-   *                      |notifySuccess| is expected.
-   */
-  void setChannel(in DOMString tunerId,
-                  in DOMString sourceType,
-                  in DOMString channelNumber,
-                  in nsITVServiceCallback callback);
-
-  /**
-   * Get the channels, ordered by the LCN (Logical Channel Number), of a given
-   * source type.
-   *
-   * @param tunerId       The ID of the tuner.
-   * @param sourceType    The source type to be used.
-   * @param callback      The callback object where either |notifyError| or
-   *                      |notifySuccess|, which takes an array of
-   *                      |nsITVChannelData| ordered by the LCN (Logical Channel
-   *                      Number), is expected.
-   */
-  void getChannels(in DOMString tunerId,
-                   in DOMString sourceType,
-                   in nsITVServiceCallback callback);
-
-  /**
-   * Get the programs, ordered by the start time, of a given channel.
-   *
-   * @param tunerId       The ID of the tuner.
-   * @param sourceType    The source type to be used.
-   * @param channelNumber The LCN (Logical Channel Number) of the channel.
-   * @param startTime     The begining of the searching time frame for programs.
-   * @param endTime       The end of the searching time frame for programs.
-   * @param callback      The callback object where either |notifyError| or
-   *                      |notifySuccess|, which takes an array of
-   *                      |nsITVProgramData| ordered by the start time, is
-   *                      expected.
-   */
-  void getPrograms(in DOMString tunerId,
-                   in DOMString sourceType,
-                   in DOMString channelNumber,
-                   in unsigned long long startTime,
-                   in unsigned long long endTime,
-                   in nsITVServiceCallback callback);
-
-  /**
-   * Get the overlay ID of a given tuner.
-   *
-   * @param tunerId       The ID of the tuner.
-   * @param callback      The callback object where either |notifyError| or
-   *                      |notifySuccess|, which takes an array of
-   *                      |nsISupportsString| with only one element, is expected.
-   */
-  void getOverlayId(in DOMString tunerId,
-                    in nsITVServiceCallback callback);
-};
-
deleted file mode 100644
--- a/dom/tv/nsITVSimulatorService.idl
+++ /dev/null
@@ -1,32 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-#include "nsITVService.idl"
-
-interface mozIDOMWindow;
-
-%{C++
-#define TV_SIMULATOR_SERVICE_CONTRACTID\
-  "@mozilla.org/tv/simulatorservice;1"
-%}
-
-[scriptable, uuid(3f670994-5915-415a-b906-7ead54bb3be1)]
-interface nsITVSimulatorService : nsITVService
-{
-  /*
-   * Get the URL of simulated video blob.
-   *
-   * @param tunerId       The ID of the tuner.
-   * @param sourceType    The source type to be used.
-   * @param channelNumber The LCN (Logical Channel Number) of the channel.
-   * @param window        The window object of content.
-   * @return blobUrl      The URL of created blob from local video file.
-   */
-  void getSimulatorVideoBlobURL(in DOMString tunerId,
-                                in DOMString sourceType,
-                                in DOMString channelNumber,
-                                in mozIDOMWindow window,
-                                [retval] out DOMString blobUrl);
-};
deleted file mode 100644
--- a/dom/tv/test/mochitest/chrome.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[DEFAULT]
-skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
-support-files =
-  head.js
-  mock_data.json
-
-[test_tv_permitted_app.html]
-[test_tv_get_tuners.html]
-[test_tv_get_sources.html]
-[test_tv_get_channels.html]
-[test_tv_get_channels_during_scanning.html]
-[test_tv_get_programs.html]
-[test_tv_get_current_program.html]
-[test_tv_set_current_source.html]
-[test_tv_set_invalid_current_source.html]
-[test_tv_set_current_channel.html]
-[test_tv_set_current_channel_during_scanning.html]
-[test_tv_set_invalid_current_channel.html]
-[test_tv_scan_channels_stopped.html]
-[test_tv_scan_channels_completed.html]
deleted file mode 100644
--- a/dom/tv/test/mochitest/head.js
+++ /dev/null
@@ -1,34 +0,0 @@
-"use strict";
-
-function setupPrefs(callback) {
-  let xhr = new XMLHttpRequest;
-  let data;
-
-  xhr.open("GET", "./mock_data.json", false);
-  xhr.send(null);
-  if (xhr.status == 200) {
-    data = xhr.responseText;
-    // Convert the JSON to text and back to eliminate whitespace.
-    data = JSON.stringify(JSON.parse(data));
-    // Preferences can only be 4000 characters in a content process.
-    ok(data.length <= 4000, "Data for preferences must be 4000 characters or less.");
-  }
-
-  SpecialPowers.pushPrefEnv({"set": [
-                              ["dom.tv.enabled", true],
-                              ["dom.ignore_webidl_scope_checks", true],
-                              ["dom.testing.tv_mock_data", data]
-                            ]}, function() {
-    callback();
-  });
-}
-
-function removePrefs(callback) {
-  SpecialPowers.popPrefEnv(callback);
-}
-
-function prepareTest(callback) {
-  removePrefs(function() {
-    setupPrefs(callback);
-  });
-}
deleted file mode 100644
--- a/dom/tv/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-support-files =
-  head.js
-  mock_data.json
-
-[test_tv_non_permitted_app.html]
deleted file mode 100644
--- a/dom/tv/test/mochitest/mock_data.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
-  "tuners": [
-    {
-       "id":"1",
-       "supportedType": ["dvb-t"],
-       "sources": [
-         {
-           "type": "dvb-t",
-           "channels": [
-             {
-             "networkId": "32112",
-             "transportStreamId": "32112",
-             "serviceId": "40960",
-             "type": "tv",
-             "name": "TV #1",
-             "number" : 1,
-             "isEmergency": false,
-             "isFree" : true,
-             "videoFilePath": "tv1.ogv",
-             "programs": [
-               {"eventId":"734475972", "title":"News 1",  "startTime":"1430686800", "duration":"10800", "description":"Morning News", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"422158917", "title":"News 2",  "startTime":"1431266400", "duration":"3600",  "description":"Summary of today news",  "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"533612446", "title":"Entertainment",  "startTime":"1431270000", "duration":"7200",  "description":"Some show", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]}
-               ]
-             },
-             {
-             "_comment": "Channel Data",
-             "networkId": "32122",
-             "transportStreamId": "32122",
-             "serviceId": "40990",
-             "type": "tv",
-             "name": "TV #2",
-             "number" : 2,
-             "isEmergency": false,
-             "isFree" : true,
-             "videoFilePath": "tv2.ogv",
-             "programs": [
-                 {"eventId":"931109607","title":"News 1",	"startTime":"1430686800",	"duration":"10800",	"description":"Provide news in morning",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]},
-                 {"eventId":"297834220","title":"Weekly News",	"startTime":"1431259200",	"duration":"10800",	"description":"Poopular Music program",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]},
-                 {"eventId":"866886159","title":"Weekly news",	"startTime":"1431270000",	"duration":"7200",	"description":"Information program on Monday",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]}
-               ]
-             },
-             {
-             "_comment": "Channel Data",
-             "networkId": "32132",
-             "transportStreamId": "32132",
-             "serviceId": "41020",
-             "type": "tv",
-             "name": "TV #3",
-             "number" : 3,
-             "isEmergency": false,
-             "isFree" : true,
-             "videoFilePath": "tv1.ogv",
-             "programs": [
-               {"eventId":"734475972", "title":"News 1",  "startTime":"1430686800", "duration":"10800", "description":"Morning News", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"586216742", "title":"Info Program", "startTime":"1430697600", "duration":"7200",  "description":"Provide program Information.",  "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"533612446", "title":"Entertainment",  "startTime":"1431270000", "duration":"7200",  "description":"Some show", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]}
-               ]
-             },
-             {
-             "_comment": "Channel Data",
-             "networkId": "32142",
-             "transportStreamId": "32142",
-             "serviceId": "41040",
-             "type": "tv",
-             "name": "TV #5",
-             "number" : 4,
-             "isEmergency": false,
-             "isFree" : true,
-             "videoFilePath": "tv2.ogv",
-             "programs": [
-                 {"eventId":"931109607","title":"News 1",	"startTime":"1430686800",	"duration":"10800",	"description":"Provide news in morning",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]},
-                 {"eventId":"297834220","title":"Weekly News",	"startTime":"1431259200",	"duration":"10800",	"description":"Poopular Music program",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]},
-                 {"eventId":"866886159","title":"Weekly news",	"startTime":"1431270000",	"duration":"7200",	"description":"Information program on Monday",	"rating":"0",	"audioLanguages":["eng"],	"subtitleLanguages":["eng"]}
-               ]
-             },
-             {
-             "_comment": "Channel Data",
-             "networkId": "32152",
-             "transportStreamId": "32152",
-             "serviceId": "41060",
-             "type": "tv",
-             "name": "TV #5",
-             "number" : 5,
-             "isEmergency": false,
-             "isFree" : true,
-             "videoFilePath": "tv1.ogv",
-             "programs": [
-               {"eventId":"734475972", "title":"News 1",  "startTime":"1430686800", "duration":"10800", "description":"Morning News", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"586216742", "title":"Info Program", "startTime":"1430697600", "duration":"7200",  "description":"Provide program Information.",  "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]},
-               {"eventId":"533612446", "title":"Entertainment",  "startTime":"1431270000", "duration":"7200",  "description":"Some show", "rating":"0", "audioLanguages":["eng"], "subtitleLanguages":["eng"]}
-               ]
-             }
-           ]
-         }
-       ]
-    }
-  ]
-}
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_channels.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test GetChannels for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-
-          aSources[0].getChannels().then(
-            function(aChannels) {
-              ok(aChannels.length > 0, "Got at least 1 channel.");
-
-              for (var i = 0; i < aChannels.length; i++) {
-                var channel = aChannels[i];
-                ok(channel instanceof TVChannel, "Channel " + i + " should be in right type.")
-                ok('source' in channel, "Channel " + i + " should have a source.");
-                ok('networkId' in channel, "Channel " + i + " should have a network ID.");
-                ok('transportStreamId' in channel, "Channel " + i + " should have a transport stream ID.");
-                ok('serviceId' in channel, "Channel " + i + " should have a service ID.");
-                ok('type' in channel, "Channel " + i + " should have a type.");
-                ok('name' in channel, "Channel " + i + " should have a name.");
-                ok('number' in channel, "Channel " + i + " should have a number.");
-              }
-
-              SimpleTest.finish();
-            },
-            function(aError) {
-              ok(false, "Error occurred when getting channels: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_channels_during_scanning.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test an error case for GetChannels during scanning for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-  function(aTuners) {
-    ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-    aTuners[0].getSources().then(
-      function(aSources) {
-        ok(aSources.length > 0, "Got at least 1 source.");
-        var source = aSources[0];
-
-        // TODO Bug 1088818 - Modify the behavior of channel scanning.
-        source.startScanning({}).then(
-          function() {
-            source.getChannels().then(
-              function() {
-                ok(false, "Getting channels during scanning should get error.");
-                  SimpleTest.finish();
-                },
-                function(aError) {
-                  is(aError.name, "InvalidStateError",
-                     "InvalidStateError should be expected.");
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when starting scanning: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_current_program.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test GetCurrentProgram for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-
-          aSources[0].getChannels().then(
-            function(aChannels) {
-              ok(aChannels.length > 0, "Got at least 1 channel.");
-
-              aChannels[0].getCurrentProgram().then(
-                function(aCurrentProgram) {
-                  ok(aCurrentProgram, "Got the current program.");
-                  ok(aCurrentProgram instanceof TVProgram, "The current program should be in the right type.")
-                  ok('channel' in aCurrentProgram, "The current program should have a channel.");
-                  ok('eventId' in aCurrentProgram, "The current program should have an event ID.");
-                  ok('title' in aCurrentProgram, "The current program should have a title.");
-                  ok('startTime' in aCurrentProgram, "The current program should have start time.");
-                  ok('duration' in aCurrentProgram, "The current program should have duration.");
-                  ok(aCurrentProgram.getAudioLanguages().length >= 0,
-                     "The current program may have audio language(s).");
-                  ok(aCurrentProgram.getSubtitleLanguages().length >= 0,
-                     "The current program may have subtitle language(s).");
-
-                  SimpleTest.finish();
-                },
-                function(aError) {
-                  ok(false, "Error occurred when getting programs: " + aError);
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when getting channels: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_programs.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test GetPrograms for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-
-          aSources[0].getChannels().then(
-            function(aChannels) {
-              ok(aChannels.length > 0, "Got at least 1 channel.");
-
-              aChannels[0].getPrograms().then(
-                function(aPrograms) {
-                  ok(aPrograms.length > 0, "Got at least 1 program.");
-
-                  for (var i = 0; i < aPrograms.length; i++) {
-                    var program = aPrograms[i];
-                    ok(program instanceof TVProgram, "Program " + i + " should be in the right type.")
-                    ok('channel' in program, "Program " + i + " should have a channel.");
-                    ok('eventId' in program, "Program " + i + " should have an event ID.");
-                    ok('title' in program, "Program " + i + " should have a title.");
-                    ok('startTime' in program, "Program " + i + " should have start time.");
-                    ok('duration' in program, "Program " + i + " should have duration.");
-                    ok(program.getAudioLanguages().length >= 0,
-                       "Program " + i + " may have audio language(s).");
-                    ok(program.getSubtitleLanguages().length >= 0,
-                       "Program " + i + " may have subtitle language(s).");
-                  }
-
-                  SimpleTest.finish();
-                },
-                function(aError) {
-                  ok(false, "Error occurred when getting programs: " + aError);
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when getting channels: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_sources.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test GetSources for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-          for (var i = 0; i < aSources.length; i++) {
-            var source = aSources[i];
-            ok(source instanceof TVSource, "Source " + i + " should be in the right type.");
-            ok('tuner' in source, "Source " + i + " should have a tuner.");
-            ok('type' in source, "Source " + i + " should have a type.");
-            ok('isScanning' in source, "Source " + i + " should have isScanning.");
-            ok(!source.isScanning,
-               "Source " + i + " should not be scanning by default.");
-            ok(!source.currentChannel,
-               "Source " + i + " should have no current channel by default.");
-          }
-
-          SimpleTest.finish();
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_get_tuners.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test GetTuners for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-      for (var i = 0; i < aTuners.length; i++) {
-        var tuner = aTuners[i];
-        ok(tuner instanceof TVTuner, "Tuner " + i + " should be in the right type.");
-        ok('id' in tuner, "Tuner " + i + " should have an ID.");
-        ok(tuner.getSupportedSourceTypes().length > 0,
-           "Tuner " + i + " should have supported source type(s).");
-        ok(!tuner.currentSource,
-           "Tuner " + i + " should have no current source by default.");
-        ok(!tuner.stream, "Tuner " + i + " should have no stream by default.");
-      }
-
-      SimpleTest.finish();
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_non_permitted_app.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test Non-Permitted Application for TV API</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok(!('tv' in navigator),
-     "navigator.tv should not exist for non-permitted app.");
-  SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-setupPrefs(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_permitted_app.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test Permitted Application for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist for permitted app.");
-  SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_scan_channels_completed.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test channel scanning complete for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  var isScannedEventFired = false;
-  
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-          var source = aSources[0];
-
-          source.oneitbroadcasted = function(aEvent) {
-            info("Received EIT broadcasted event.");
-
-            var programs = aEvent.programs;
-            for (var i = 0; i < programs.length; i++) {
-              ok(programs[i], "Program " + i + " should be set.")
-            }
-          };
-
-          source.onscanningstatechanged = function(aEvent) {
-            if (aEvent.state === 'scanned') {
-              isScannedEventFired = true;
-              info("Received channel scanned event.");
-              ok(aEvent.channel, "Scanned channel should be set.");
-            } else if (aEvent.state === 'completed') {
-              ok(isScannedEventFired, "Received channel scanning completed event after channel scanned event.");
-              SimpleTest.finish();
-            }
-          };
-
-          // TODO Bug 1088818 - Modify the behavior of channel scanning.
-          source.startScanning({}).then(
-            function() {},
-            function(aError) {
-              ok(false, "Error occurred when starting scanning: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.expectAssertions(0, 2);
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_scan_channels_stopped.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test StartScanning and StopScanning for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  var isClearedEventFired = false;
-  
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-          var source = aSources[0];
-
-          source.onscanningstatechanged = function(aEvent) {
-            if (aEvent.state === 'cleared') {
-              isClearedEventFired = true;
-              info("Received channel cache cleared event.");
-            } else if (aEvent.state === 'stopped') {
-              ok(isClearedEventFired, "Received channel scanning stopped event after cleared event.");
-              SimpleTest.finish();
-            }
-          };
-
-          // TODO Bug 1088818 - Modify the behavior of channel scanning.
-          source.startScanning({ isRescanned: true }).then(
-            function() {
-              source.stopScanning().then(
-                function() {},
-                function(aError) {
-                  ok(false, "Error occurred when stopping scanning: " + aError);
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when starting scanning: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_set_current_channel.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test SetCurrentChannel for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-      var tuner = aTuners[0];
-      var selectedSourceType = tuner.getSupportedSourceTypes()[0];
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-          var source = aSources[0];
-
-          source.getChannels().then(
-            function(aChannels) {
-              ok(aChannels.length > 0, "Got at least 1 channel.");
-              var selectedChannelNumber = aChannels[0].number;
-
-              source.oncurrentchannelchanged = function(aEvent) {
-                ok(aEvent instanceof TVCurrentChannelChangedEvent,
-                   "The event is in the right type");
-                ok(aEvent.channel instanceof TVChannel,
-                   "The channel is in the right type.");
-                is(aEvent.channel, source.currentChannel,
-                  "The current channel is set.");
-                is(source.currentChannel.number, selectedChannelNumber,
-                   "The current channel number is correct.");
-                SimpleTest.finish();
-              };
-
-              source.setCurrentChannel(selectedChannelNumber).then(
-                function() {},
-                function(aError) {
-                  ok(false, "Error occurred when setting current channel: " + aError);
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when getting channels: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_set_current_channel_during_scanning.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test an error case for SetCurrentChannel during scanning for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners){
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-          var source = aSources[0];
-
-          // TODO Bug 1088818 - Modify the behavior of channel scanning.
-          source.startScanning({}).then(
-            function() {
-              source.setCurrentChannel("1").then(
-                function() {
-                  ok(false, "Setting current channel during scanning should get error.");
-                  SimpleTest.finish();
-                },
-                function(aError) {
-                  is(aError.name, "InvalidStateError",
-                     "InvalidStateError should be expected.");
-                  SimpleTest.finish();
-                }
-              );
-            },
-            function(aError) {
-              ok(false, "Error occurred when starting scanning: " + aError);
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_set_current_source.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test SetCurrentSource for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-      var tuner = aTuners[0];
-      var selectedSourceType = tuner.getSupportedSourceTypes()[0];
-
-      tuner.oncurrentsourcechanged = function(aEvent) {
-        ok(aEvent instanceof TVCurrentSourceChangedEvent,
-           "The event is in the right type");
-        ok(aEvent.source instanceof TVSource,
-           "The source is in the right type.");
-        is(aEvent.source, tuner.currentSource,
-           "The current source is set.");
-        is(tuner.currentSource.type, selectedSourceType,
-           "The current source type is correct.");
-        SimpleTest.finish();
-      };
-
-      tuner.setCurrentSource(selectedSourceType).then(
-        function() {},
-        function(aError) {
-          ok(false, "Error occurred when setting current source: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_set_invalid_current_channel.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test an error case for SetCurrentChannel for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-      var tuner = aTuners[0];
-      var selectedSourceType = tuner.getSupportedSourceTypes()[0];
-
-      aTuners[0].getSources().then(
-        function(aSources) {
-          ok(aSources.length > 0, "Got at least 1 source.");
-
-          aSources[0].setCurrentChannel("NonExistentChannelNumber").then(
-            function() {
-              ok(false, "Setting an invalid current channel should get error.");
-              SimpleTest.finish();
-            },
-            function(aError) {
-              is(aError.name, "AbortError", "AbortError should be expected.");
-              SimpleTest.finish();
-            }
-          );
-        },
-        function(aError) {
-          ok(false, "Error occurred when getting sources: " + aError);
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/mochitest/test_tv_set_invalid_current_source.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test an error case for SetCurrentSource for TV API</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-<script type="application/javascript" src="./head.js"></script>
-<script type="application/javascript">
-
-function runTest() {
-  ok('tv' in navigator, "navigator.tv should exist.");
-
-  navigator.tv.getTuners().then(
-    function(aTuners) {
-      ok(aTuners.length > 0, "Got at least 1 tuner.");
-
-      aTuners[0].setCurrentSource("InvalidSourceType").then(
-        function() {
-          ok(false, "Setting an invalid current source should get error.");
-          SimpleTest.finish();
-        },
-        function(aError) {
-          is(aError.name, "TypeError", "TypeError should be expected.");
-          SimpleTest.finish();
-        }
-      );
-    },
-    function(aError) {
-      ok(false, "Error occurred when getting tuners: " + aError);
-      SimpleTest.finish();
-    }
-  );
-}
-
-SimpleTest.waitForExplicitFinish();
-prepareTest(runTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tv/test/xpcshell/test_tv_channel_data.js
+++ /dev/null
@@ -1,169 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-function run_test() {
-  run_next_test();
-}
-
-add_test(function test_valid_network_id() {
-  var networkId = "networkId";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.networkId = networkId;
-
-  equal(data.networkId, networkId);
-
-  run_next_test();
-});
-
-add_test(function test_empty_network_id() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.networkId = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_transport_stream_id() {
-  var transportStreamId = "transportStreamId";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.transportStreamId = transportStreamId;
-
-  equal(data.transportStreamId, transportStreamId);
-
-  run_next_test();
-});
-
-add_test(function test_empty_transport_stream_id() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.transportStreamId = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_service_id() {
-  var serviceId = "serviceId";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.serviceId = serviceId;
-
-  equal(data.serviceId, serviceId);
-
-  run_next_test();
-});
-
-add_test(function test_empty_service_id() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.serviceId = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_type() {
-  var type = "tv";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.type = type;
-
-  equal(data.type, type);
-
-  run_next_test();
-});
-
-add_test(function test_empty_type() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.type = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_invalid_type() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.type = "invalid";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_number() {
-  var number = "number";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.number = number;
-
-  equal(data.number, number);
-
-  run_next_test();
-});
-
-add_test(function test_empty_number() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.number = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_name() {
-  var name = "name";
-
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.name = name;
-
-  equal(data.name, name);
-
-  run_next_test();
-});
-
-add_test(function test_empty_name() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  Assert.throws(function() {
-    data.name = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_is_emergency() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.isEmergency = true;
-
-  ok(data.isEmergency);
-
-  run_next_test();
-});
-
-add_test(function test_is_free() {
-  var data = Cc["@mozilla.org/tv/tvchanneldata;1"].
-             createInstance(Ci.nsITVChannelData);
-  data.isFree = true;
-
-  ok(data.isFree);
-
-  run_next_test();
-});
deleted file mode 100644
--- a/dom/tv/test/xpcshell/test_tv_program_data.js
+++ /dev/null
@@ -1,197 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-function run_test() {
-  run_next_test();
-}
-
-add_test(function test_valid_event_id() {
-  var eventId = "eventId";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.eventId = eventId;
-
-  equal(data.eventId, eventId);
-
-  run_next_test();
-});
-
-add_test(function test_empty_event_id() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  Assert.throws(function() {
-    data.eventId = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_title() {
-  var title = "title";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.title = title;
-
-  equal(data.title, title);
-
-  run_next_test();
-});
-
-add_test(function test_empty_title() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  Assert.throws(function() {
-    data.title = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_start_time() {
-  var startTime = 1;
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.startTime = startTime;
-
-  equal(data.startTime, startTime);
-
-  run_next_test();
-});
-
-add_test(function test_duration() {
-  var duration = 1;
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.duration = duration;
-
-  equal(data.duration, duration);
-
-  run_next_test();
-});
-
-add_test(function test_valid_description() {
-  var description = "description";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.description = description;
-
-  equal(data.description, description);
-
-  run_next_test();
-});
-
-add_test(function test_empty_description() {
-  var description = "";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.description = description;
-
-  equal(data.description, description);
-
-  run_next_test();
-});
-
-add_test(function test_valid_rating() {
-  var rating = "rating";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.rating = rating;
-
-  equal(data.rating, rating);
-
-  run_next_test();
-});
-
-add_test(function test_empty_rating() {
-  var rating = "";
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.rating = rating;
-
-  equal(data.rating, rating);
-
-  run_next_test();
-});
-
-add_test(function test_valid_audio_languages() {
-  var languages = ["eng", "jpn"];
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.setAudioLanguages(languages.length, languages);
-
-  var audioLanguages = data.getAudioLanguages();
-  equal(audioLanguages.length, languages.length);
-  for (var i = 0; i < audioLanguages.length; i++) {
-    equal(audioLanguages[i], languages[i]);
-  }
-
-  run_next_test();
-});
-
-add_test(function test_empty_audio_languages() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.setAudioLanguages(0, []);
-
-  var audioLanguages = data.getAudioLanguages();
-  equal(audioLanguages.length, 0);
-
-  run_next_test();
-});
-
-add_test(function test_mismatched_audio_languages() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  Assert.throws(function() {
-    data.setAudioLanguages(1, []);
-  }, /NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_subtitle_languages() {
-  var languages = ["eng", "jpn"];
-
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.setSubtitleLanguages(languages.length, languages);
-
-  var subtitleLanguages = data.getSubtitleLanguages();
-  equal(subtitleLanguages.length, languages.length);
-  for (var i = 0; i < subtitleLanguages.length; i++) {
-    equal(subtitleLanguages[i], languages[i]);
-  }
-
-  run_next_test();
-});
-
-add_test(function test_empty_subtitle_languages() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  data.setSubtitleLanguages(0, []);
-
-  var subtitleLanguages = data.getSubtitleLanguages();
-  equal(subtitleLanguages.length, 0);
-
-  run_next_test();
-});
-
-add_test(function test_mismatched_subtitle_languages() {
-  var data = Cc["@mozilla.org/tv/tvprogramdata;1"].
-             createInstance(Ci.nsITVProgramData);
-  Assert.throws(function() {
-    data.setSubtitleLanguages(1, []);
-  }, /NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY/i);
-
-  run_next_test();
-});
deleted file mode 100644
--- a/dom/tv/test/xpcshell/test_tv_tuner_data.js
+++ /dev/null
@@ -1,65 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-function run_test() {
-  run_next_test();
-}
-
-add_test(function test_valid_id() {
-  var id = "id";
-
-  var data = Cc["@mozilla.org/tv/tvtunerdata;1"].
-             createInstance(Ci.nsITVTunerData);
-  data.id = id;
-
-  equal(data.id, id);
-
-  run_next_test();
-});
-
-add_test(function test_empty_id() {
-  var data = Cc["@mozilla.org/tv/tvtunerdata;1"].
-             createInstance(Ci.nsITVTunerData);
-  Assert.throws(function() {
-    data.id = "";
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_valid_supported_source_types() {
-  var sourceTypes = ["dvb-t", "dvb-s"];
-
-  var data = Cc["@mozilla.org/tv/tvtunerdata;1"].
-             createInstance(Ci.nsITVTunerData);
-  data.setSupportedSourceTypes(sourceTypes.length, sourceTypes);
-
-  var types = data.getSupportedSourceTypes();
-  equal(types.length, sourceTypes.length);
-  for (var i = 0; i < types.length; i++) {
-    equal(types[i], sourceTypes[i]);
-  }
-
-  run_next_test();
-});
-
-add_test(function test_empty_supported_source_types() {
-  var data = Cc["@mozilla.org/tv/tvtunerdata;1"].
-             createInstance(Ci.nsITVTunerData);
-  Assert.throws(function() {
-    data.setSupportedSourceTypes(0, []);
-  }, /NS_ERROR_ILLEGAL_VALUE/i);
-
-  run_next_test();
-});
-
-add_test(function test_mismatched_supported_source_types() {
-  var data = Cc["@mozilla.org/tv/tvtunerdata;1"].
-             createInstance(Ci.nsITVTunerData);
-  Assert.throws(function() {
-    data.setSupportedSourceTypes(1, []);
-  }, /NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY/i);
-
-  run_next_test();
-});
deleted file mode 100644
--- a/dom/tv/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_tv_tuner_data.js]
-[test_tv_channel_data.js]
-[test_tv_program_data.js]
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -385,21 +385,16 @@ partial interface Navigator {
 
 partial interface Navigator {
   [Throws, Pref="beacon.enabled"]
   boolean sendBeacon(DOMString url,
                      optional (ArrayBufferView or Blob or DOMString or FormData)? data = null);
 };
 
 partial interface Navigator {
-  [Pref="dom.tv.enabled", ChromeOnly]
-  readonly attribute TVManager? tv;
-};
-
-partial interface Navigator {
   [Throws, Pref="dom.inputport.enabled", ChromeOnly]
   readonly attribute InputPortManager inputPortManager;
 };
 
 partial interface Navigator {
   [Throws, Pref="dom.presentation.enabled", SameObject]
   readonly attribute Presentation? presentation;
 };
deleted file mode 100644
--- a/dom/webidl/TVChannel.webidl
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-enum TVChannelType {
-  "tv",
-  "radio",
-  "data"
-};
-
-dictionary TVGetProgramsOptions {
-  unsigned long long startTime;
-  unsigned long long duration;
-};
-
-[Pref="dom.tv.enabled", ChromeOnly]
-interface TVChannel : EventTarget {
-  [Throws]
-  Promise<sequence<TVProgram>> getPrograms(optional TVGetProgramsOptions options);
-
-  [Throws]
-  Promise<TVProgram> getCurrentProgram();
-
-  readonly attribute DOMString networkId;
-
-  readonly attribute DOMString transportStreamId;
-
-  readonly attribute DOMString serviceId;
-
-  readonly attribute TVSource source;
-
-  readonly attribute TVChannelType type;
-
-  readonly attribute DOMString name;
-
-  readonly attribute DOMString number;
-
-  readonly attribute boolean isEmergency;
-
-  readonly attribute boolean isFree;
-};
deleted file mode 100644
--- a/dom/webidl/TVCurrentChannelChangedEvent.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-dictionary TVCurrentChannelChangedEventInit : EventInit {
-  TVChannel? channel = null;
-};
-
-[Pref="dom.tv.enabled",
- ChromeOnly,
- Constructor(DOMString type, optional TVCurrentChannelChangedEventInit eventInitDict)]
-interface TVCurrentChannelChangedEvent : Event {
-  readonly attribute TVChannel? channel;
-};
deleted file mode 100644
--- a/dom/webidl/TVCurrentSourceChangedEvent.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-dictionary TVCurrentSourceChangedEventInit : EventInit {
-  TVSource? source = null;
-};
-
-[Pref="dom.tv.enabled",
- ChromeOnly,
- Constructor(DOMString type, optional TVCurrentSourceChangedEventInit eventInitDict)]
-interface TVCurrentSourceChangedEvent : Event {
-  readonly attribute TVSource? source;
-};
deleted file mode 100644
--- a/dom/webidl/TVEITBroadcastedEvent.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-dictionary TVEITBroadcastedEventInit : EventInit {
-  sequence<TVProgram> programs = [];
-};
-
-[Pref="dom.tv.enabled",
- ChromeOnly,
- Constructor(DOMString type, optional TVEITBroadcastedEventInit eventInitDict)]
-interface TVEITBroadcastedEvent : Event {
-  [Pure, Cached] readonly attribute sequence<TVProgram> programs;
-};
deleted file mode 100644
--- a/dom/webidl/TVManager.webidl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-[Pref="dom.tv.enabled", ChromeOnly]
-interface TVManager : EventTarget {
-  [Throws]
-  Promise<sequence<TVTuner>> getTuners();
-};
deleted file mode 100644
--- a/dom/webidl/TVProgram.webidl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-[Pref="dom.tv.enabled", ChromeOnly]
-interface TVProgram {
-  sequence<DOMString> getAudioLanguages();
-
-  sequence<DOMString> getSubtitleLanguages();
-
-  readonly attribute DOMString eventId;
-
-  readonly attribute TVChannel channel;
-
-  readonly attribute DOMString title;
-
-  readonly attribute unsigned long long startTime;
-
-  readonly attribute unsigned long long duration;
-
-  readonly attribute DOMString? description;
-
-  readonly attribute DOMString? rating;
-};
deleted file mode 100644
--- a/dom/webidl/TVScanningStateChangedEvent.webidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-enum TVScanningState {
-  "cleared",
-  "scanned",
-  "completed",
-  "stopped"
-};
-
-dictionary TVScanningStateChangedEventInit : EventInit {
-  TVScanningState state = "cleared";
-  TVChannel? channel = null;
-};
-
-[Pref="dom.tv.enabled",
- ChromeOnly, 
- Constructor(DOMString type, optional TVScanningStateChangedEventInit eventInitDict)]
-interface TVScanningStateChangedEvent : Event {
-  readonly attribute TVScanningState state;
-  readonly attribute TVChannel? channel;
-};
deleted file mode 100644
--- a/dom/webidl/TVSource.webidl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-enum TVSourceType {
-  "dvb-t",
-  "dvb-t2",
-  "dvb-c",
-  "dvb-c2",
-  "dvb-s",
-  "dvb-s2",
-  "dvb-h",
-  "dvb-sh",
-  "atsc",
-  "atsc-m/h",
-  "isdb-t",
-  "isdb-tb",
-  "isdb-s",
-  "isdb-c",
-  "1seg",
-  "dtmb",
-  "cmmb",
-  "t-dmb",
-  "s-dmb"
-};
-
-dictionary TVStartScanningOptions {
-  boolean isRescanned;
-};
-
-[Pref="dom.tv.enabled", ChromeOnly]
-interface TVSource : EventTarget {
-  [Throws]
-  Promise<sequence<TVChannel>> getChannels();
-
-  [Throws]
-  Promise<void> setCurrentChannel(DOMString channelNumber);
-
-  [Throws]
-  Promise<void> startScanning(optional TVStartScanningOptions options);
-
-  [Throws]
-  Promise<void> stopScanning();
-
-  readonly attribute TVTuner tuner;
-
-  readonly attribute TVSourceType type;
-
-  readonly attribute boolean isScanning;
-
-  readonly attribute TVChannel? currentChannel;
-
-  attribute EventHandler oncurrentchannelchanged;
-  attribute EventHandler oneitbroadcasted;
-  attribute EventHandler onscanningstatechanged;
-};
deleted file mode 100644
--- a/dom/webidl/TVTuner.webidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://seanyhlin.github.io/TV-Manager-API/
- */
-
-[Pref="dom.tv.enabled", ChromeOnly]
-interface TVTuner : EventTarget {
-  [Throws]
-  sequence<TVSourceType> getSupportedSourceTypes();
-
-  [Throws]
-  Promise<sequence<TVSource>> getSources();
-
-  [Throws]
-  Promise<void> setCurrentSource(TVSourceType sourceType);
-
-  readonly attribute DOMString id;
-
-  readonly attribute TVSource? currentSource;
-
-  readonly attribute MediaStream? stream;
-
-  attribute EventHandler oncurrentsourcechanged;
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -576,21 +576,16 @@ WEBIDL_FILES = [
     'Touch.webidl',
     'TouchEvent.webidl',
     'TouchList.webidl',
     'TransitionEvent.webidl',
     'TreeBoxObject.webidl',
     'TreeColumn.webidl',
     'TreeColumns.webidl',
     'TreeWalker.webidl',
-    'TVChannel.webidl',
-    'TVManager.webidl',
-    'TVProgram.webidl',
-    'TVSource.webidl',
-    'TVTuner.webidl',
     'U2F.webidl',
     'UDPMessageEvent.webidl',
     'UDPSocket.webidl',
     'UIEvent.webidl',
     'UndoManager.webidl',
     'URL.webidl',
     'URLSearchParams.webidl',
     'USSDSession.webidl',
@@ -822,20 +817,16 @@ GENERATED_EVENTS_WEBIDL_FILES = [
     'ScrollViewChangeEvent.webidl',
     'StyleRuleChangeEvent.webidl',
     'StyleSheetApplicableStateChangeEvent.webidl',
     'StyleSheetChangeEvent.webidl',
     'TCPServerSocketEvent.webidl',
     'TCPSocketErrorEvent.webidl',
     'TCPSocketEvent.webidl',
     'TrackEvent.webidl',
-    'TVCurrentChannelChangedEvent.webidl',
-    'TVCurrentSourceChangedEvent.webidl',
-    'TVEITBroadcastedEvent.webidl',
-    'TVScanningStateChangedEvent.webidl',
     'UDPMessageEvent.webidl',
     'UserProximityEvent.webidl',
     'USSDReceivedEvent.webidl',
     'WebGLContextEvent.webidl',
 ]
 
 if CONFIG['MOZ_WEBRTC']:
     GENERATED_EVENTS_WEBIDL_FILES += [
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -215,20 +215,16 @@ static void Shutdown();
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/time/TimeService.h"
 #include "StreamingProtocolService.h"
 
 #include "nsIPresentationService.h"
 #include "nsITelephonyService.h"
 #include "nsIVoicemailService.h"
 
-#include "mozilla/dom/TVServiceFactory.h"
-#include "mozilla/dom/TVTypes.h"
-#include "nsITVService.h"
-
 #include "FakeInputPortService.h"
 #include "InputPortData.h"
 #include "InputPortServiceFactory.h"
 #include "nsIInputPortService.h"
 
 #ifdef MOZ_WIDGET_GONK
 #include "GonkGPSGeolocationProvider.h"
 #endif
@@ -373,19 +369,16 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
                                          MediaManager::GetInstance)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileConnectionService,
                                          NS_CreateMobileConnectionService)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITelephonyService,
                                          NS_CreateTelephonyService)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIVoicemailService,
                                          NS_CreateVoicemailService)
-NS_GENERIC_FACTORY_CONSTRUCTOR(TVTunerData)
-NS_GENERIC_FACTORY_CONSTRUCTOR(TVChannelData)
-NS_GENERIC_FACTORY_CONSTRUCTOR(TVProgramData)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(TextInputProcessor)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(FakeInputPortService,
                                          InputPortServiceFactory::CreateFakeInputPortService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(InputPortData)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPresentationService,
                                          NS_CreatePresentationService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationTCPSessionTransport)
@@ -836,19 +829,16 @@ NS_DEFINE_NAMED_CID(NS_POCKETSPHINX_SPEE
 #endif
 #ifdef MOZ_WEBSPEECH
 NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
 #endif
 
 #ifdef ACCESSIBILITY
 NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
 #endif
-NS_DEFINE_NAMED_CID(TV_TUNER_DATA_CID);
-NS_DEFINE_NAMED_CID(TV_CHANNEL_DATA_CID);
-NS_DEFINE_NAMED_CID(TV_PROGRAM_DATA_CID);
 
 NS_DEFINE_NAMED_CID(FAKE_INPUTPORT_SERVICE_CID);
 NS_DEFINE_NAMED_CID(INPUTPORT_DATA_CID);
 
 NS_DEFINE_NAMED_CID(GECKO_MEDIA_PLUGIN_SERVICE_CID);
 
 NS_DEFINE_NAMED_CID(PRESENTATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(PRESENTATION_DEVICE_MANAGER_CID);
@@ -1133,19 +1123,16 @@ static const mozilla::Module::CIDEntry k
 #endif
   { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
 #ifdef ACCESSIBILITY
   { &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
 #endif
   { &kTELEPHONY_SERVICE_CID, false, nullptr, nsITelephonyServiceConstructor },
   { &kNS_MOBILE_CONNECTION_SERVICE_CID, false, NULL, nsIMobileConnectionServiceConstructor },
   { &kNS_VOICEMAIL_SERVICE_CID, false, nullptr, nsIVoicemailServiceConstructor },
-  { &kTV_TUNER_DATA_CID, false, nullptr, TVTunerDataConstructor },
-  { &kTV_CHANNEL_DATA_CID, false, nullptr, TVChannelDataConstructor },
-  { &kTV_PROGRAM_DATA_CID, false, nullptr, TVProgramDataConstructor },
   { &kPRESENTATION_SERVICE_CID, false, nullptr, nsIPresentationServiceConstructor },
   { &kPRESENTATION_DEVICE_MANAGER_CID, false, nullptr, PresentationDeviceManagerConstructor },
   { &kPRESENTATION_TCP_SESSION_TRANSPORT_CID, false, nullptr, PresentationTCPSessionTransportConstructor },
   { &kTEXT_INPUT_PROCESSOR_CID, false, nullptr, TextInputProcessorConstructor },
   { &kFAKE_INPUTPORT_SERVICE_CID, false, nullptr, FakeInputPortServiceConstructor },
   { &kINPUTPORT_DATA_CID, false, nullptr, InputPortDataConstructor },
 #ifdef MOZ_B2G
   { &kNS_HARDWARE_KEY_HANDLER_CID, false, nullptr, nsIHardwareKeyHandlerConstructor },
@@ -1293,19 +1280,16 @@ static const mozilla::Module::ContractID
   { GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID },
 #endif
   { MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
 #ifdef ACCESSIBILITY
   { "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
   { "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
 #endif
   { TELEPHONY_SERVICE_CONTRACTID, &kTELEPHONY_SERVICE_CID },
-  { TV_TUNER_DATA_CONTRACTID, &kTV_TUNER_DATA_CID },
-  { TV_CHANNEL_DATA_CONTRACTID, &kTV_CHANNEL_DATA_CID },
-  { TV_PROGRAM_DATA_CONTRACTID, &kTV_PROGRAM_DATA_CID },
   { "@mozilla.org/gecko-media-plugin-service;1",  &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
   { NS_MOBILE_CONNECTION_SERVICE_CONTRACTID, &kNS_MOBILE_CONNECTION_SERVICE_CID },
   { NS_VOICEMAIL_SERVICE_CONTRACTID, &kNS_VOICEMAIL_SERVICE_CID },
   { PRESENTATION_SERVICE_CONTRACTID, &kPRESENTATION_SERVICE_CID },
   { PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
   { PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID, &kPRESENTATION_TCP_SESSION_TRANSPORT_CID },
   { "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
   { FAKE_INPUTPORT_SERVICE_CONTRACTID, &kFAKE_INPUTPORT_SERVICE_CID },