Remove firefox support.

Bug: chromium:751211
Change-Id: Ie5c509eee7198ed21c3f76c58b384d5e7a6450b3
Reviewed-on: https://webrtc-review.googlesource.com/51762
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
diff --git a/DEPS b/DEPS
index 5465298..ebd6820 100644
--- a/DEPS
+++ b/DEPS
@@ -7,18 +7,6 @@
 }
 
 deps = {
-  'webrtc.DEPS/third_party/manifestdestiny':
-    Var('git_url') + '/chromium/deps/manifestdestiny.git@46ae53ac463e23bfefec374a81806355ea598ac4',
-  'webrtc.DEPS/third_party/mozdownload':
-    Var('git_url') + '/chromium/deps/mozdownload.git@5d3e0bf7851b093ff9a89d45f13185691c496be',
-  'webrtc.DEPS/third_party/mozinfo':
-    Var('git_url') + '/chromium/deps/mozinfo.git@f4cc257e21c48bc33dc1d12123d934a4dcaa120c',
-  'webrtc.DEPS/third_party/mozprocess':
-    Var('git_url') + '/chromium/deps/mozprocess.git@11d11bebc8517dcedec71f377cbec07fb91a3b1f',
-  'webrtc.DEPS/third_party/mozprofile':
-    Var('git_url') + '/chromium/deps/mozprofile.git@313295a0d9e1687dafa58e12f1f01b093a136446',
-  'webrtc.DEPS/third_party/mozrunner':
-    Var('git_url') + '/chromium/deps/mozrunner.git@efb11330692424f7aa5533839b0ae728bc5f30d1',
   'webrtc.DEPS/third_party/requests/':
     Var('git_url') + '/external/github.com/kennethreitz/requests.git@2128321b85dfd969498e5d1636dcc3c4a27917ba'
 }
@@ -78,14 +66,4 @@
                "--recursive",
                "src/chrome/test/data/webrtc/resources/tools"],
   },
-  {
-    # Download firefox for the Firefox AppRTC test.
-    # TODO(phoglund): Disabled due to http://crbug.com/545862.
-    "pattern": ".",
-    "action" : ["python",
-                "webrtc.DEPS/download_firefox_nightly.py",
-                "--clean-old-firefox-archives",
-                "--target-dir",
-                "firefox-nightly"],
-  },
 ]
diff --git a/download_firefox_nightly.py b/download_firefox_nightly.py
deleted file mode 100755
index 719d3d0..0000000
--- a/download_firefox_nightly.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Downloads a Firefox Nightly build for the current platform."""
-
-import datetime
-import glob
-import os
-import shutil
-import sys
-import subprocess
-import tarfile
-import time
-import zipfile
-
-from optparse import OptionParser
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-THIRD_PARTY_DIR = os.path.abspath(os.path.join(BASE_DIR, 'third_party'))
-
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozdownload'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozinfo'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'requests'))
-
-from mozdownload import errors
-from mozdownload import scraper
-import utils
-
-
-def _Touch(a_file):
-  with open(a_file, 'a'):
-    os.utime(a_file, None)
-
-
-def _GetFirefoxArchivesSortedOnModifiedDate(target_dir):
-  firefox_archives = glob.glob(os.path.join(target_dir, '*tar.bz2'))
-  if not firefox_archives:
-    return None
-
-  firefox_archives.sort(key=os.path.getmtime, reverse=True)
-  return firefox_archives
-
-
-def _CleanOldFirefoxArchives(target_dir): 
-  firefox_archives = _GetFirefoxArchivesSortedOnModifiedDate(target_dir)
-  if not firefox_archives or len(firefox_archives) < 2:
-    return
-
-  # Keep the newest archive around as a fallback build and delete the rest.
-  rest = firefox_archives[1:]
-  print 'About to delete old Firefox archives %s.' % rest
-  for old_archive in rest:
-    try:
-      os.remove(old_archive)
-    except OSError:
-      pass
-
-
-def _FindFallbackFirefoxBuild(target_dir):
-  firefox_archives = _GetFirefoxArchivesSortedOnModifiedDate(target_dir)
-  if not firefox_archives:
-    return None, None
-
-  newest_build = firefox_archives[0]
-  build_age_seconds = time.time() - os.path.getmtime(newest_build)
-  build_age_days = datetime.timedelta(seconds=build_age_seconds).days
-
-  return newest_build, build_age_days
-
-
-def _MaybeDownload(target_dir, force):
-  try:
-    downloader = scraper.DailyScraper(destination=target_dir)
-    filename = downloader.build_filename(downloader.binary)
-    firefox_archive = os.path.join(target_dir, filename)
-
-    if os.path.exists(firefox_archive) and not force:
-      # Touch the file anyway since we were 'successful', so we can accurately
-      # compute the age of the most recent download attempt and act accordingly
-      # when a download fails later.
-      _Touch(firefox_archive)
-      print 'Skipping download as %s is already downloaded.' % firefox_archive
-      return None
-
-    downloader.download()
-    print 'Downloaded %s' % firefox_archive
-    return firefox_archive
-  except errors.NotFoundError as exception:
-    print 'Failed to download firefox: %s.' % exception
-    fallback_build, age_days = _FindFallbackFirefoxBuild(target_dir)
-
-    if not fallback_build:
-      raise Exception('We failed to download Firefox and we have no builds to '
-                      'fall back on; failing...')
-    if age_days > 3:
-      raise Exception('We have failed to download firefox builds for more '
-                      'than 3 days now: failing so someone looks at it. The '
-                      'most recent build we have is %d days old.' % age_days)
-
-    print 'Using %s instead; it is %d days old.' % (fallback_build, age_days)
-    return fallback_build
-
-
-def _ExtractArchive(firefox_archive, target_dir):
-  if utils.GetPlatform() is 'linux':
-    tar_archive = tarfile.open(firefox_archive, 'r:bz2')
-    tar_archive.extractall(path=target_dir)
-  else:
-    raise Exception('Unsupported platform: %s' % sys.platform)
-
-  print 'Extracted %s' % firefox_archive
-
-
-def main():
-  usage = 'usage: %prog -t <target_dir>'
-  parser = OptionParser(usage)
-  parser.add_option('-t', '--target-dir',
-                    help=('Target directory to put the downloaded and extracted'
-                          ' folder with the Firefox Nightly build in.'))
-  parser.add_option('-f', '--force', action='store_true',
-                    help=('Force download even if the current nightly is '
-                          'already downloaded.'))
-  parser.add_option('-c', '--clean-old-firefox-archives', action='store_true',
-                    help=('Clean old firefox archives; one will always be '
-                          'kept as a fallback.'))
-  options, _args = parser.parse_args()
-  if not options.target_dir:
-    parser.error('You must specify the target directory.')
-
-  if utils.GetPlatform() is not 'linux':
-    print 'This script is only supported on Linux for now.'
-    return
-
-  target_dir = options.target_dir
-  if not os.path.isdir(target_dir):
-    os.mkdir(target_dir)
-
-  firefox_archive = _MaybeDownload(target_dir, options.force)
-  if firefox_archive:
-    _ExtractArchive(firefox_archive, target_dir) 
-
-  if options.clean_old_firefox_archives:
-    _CleanOldFirefoxArchives(target_dir)
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/run_firefox_webrtc.py b/run_firefox_webrtc.py
deleted file mode 100755
index c96c6de..0000000
--- a/run_firefox_webrtc.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Launches Firefox and browses to an URL."""
-
-import os
-import signal
-import sys
-
-from optparse import OptionParser
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-THIRD_PARTY_DIR = os.path.abspath(os.path.join(BASE_DIR, 'third_party'))
-
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'manifestdestiny'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozinfo'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozprocess'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozprofile'))
-sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozrunner'))
-
-from mozprofile import profile
-import mozrunner
-
-WEBRTC_PREFERENCES = {
-    # Automatically gives permission to access the camera/microphone and
-    # bypasses the permission/selection dialog.
-    'media.navigator.permission.disabled': True,
-
-    # TODO(phoglund): Disable e10s to see if we're still affected by
-    # the sandbox audio issue.
-    'browser.tabs.remote.autostart': False,
-}
-
-def main():
-  usage = 'usage: %prog --binary <firefox_executable> --webpage <url>'
-  parser = OptionParser(usage)
-  parser.add_option('-b', '--binary',
-                    help=('Firefox executable to run.'))
-  parser.add_option('-w', '--webpage',
-                    help=('Web page to browse to.'))
-  options, _args = parser.parse_args()
-  if not options.binary:
-    parser.error('You must specify the Firefox browser executable.')
-  if not options.webpage:
-    parser.error('You must specify the web page to browse to.')
-
-  firefox_profile = profile.FirefoxProfile(preferences=WEBRTC_PREFERENCES)
-  firefox_runner = mozrunner.FirefoxRunner(profile=firefox_profile,
-                                           binary=options.binary,
-                                           cmdargs=[options.webpage])
-  def KillFirefox(signum, frame):
-    firefox_runner.stop()
-  signal.signal(signal.SIGTERM, KillFirefox)
-
-  firefox_runner.start()
-
-  # Run until Chrome kills us.
-  firefox_runner.process_handler.wait(timeout=600)
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main())