Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: run_firefox_webrtc.py

Issue 114293002: Adding support for launching firefox from webrtc.DEPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « download_firefox_nightly.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: run_firefox_webrtc.py
===================================================================
--- run_firefox_webrtc.py (revision 0)
+++ run_firefox_webrtc.py (revision 0)
@@ -0,0 +1,60 @@
+#!/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
+from mozrunner import runner
+
+WEBRTC_PREFERENCES = {
+ # Automatically gives permission to access the camera/microphone and
+ # bypasses the permission/selection dialog.
+ 'media.navigator.permission.disabled': True,
+}
+
+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 = runner.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())
Property changes on: run_firefox_webrtc.py
___________________________________________________________________
Added: svn:eol-style
+ LF
Added: svn:executable
+ *
« no previous file with comments | « download_firefox_nightly.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698