Bug 1316707 - Remove B2G related code from Marionette client.
MozReview-Commit-ID: 1GjCDSmpROY
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -268,39 +268,16 @@ class FennecInstance(GeckoInstance):
def close(self, restart=False):
super(FennecInstance, self).close(restart)
if self.runner and self.runner.device.connected:
self.runner.device.dm.remove_forward(
'tcp:{}'.format(int(self.marionette_port))
)
-class B2GDesktopInstance(GeckoInstance):
- def __init__(self, host, port, bin, **kwargs):
- # Pass a profile and change the binary to -bin so that
- # the built-in gaia profile doesn't get touched.
- if kwargs.get('profile', None) is None:
- # GeckoInstance.start will clone the profile.
- kwargs['profile'] = os.path.join(os.path.dirname(bin),
- 'gaia',
- 'profile')
- if '-bin' not in os.path.basename(bin):
- if bin.endswith('.exe'):
- newbin = bin[:-len('.exe')] + '-bin.exe'
- else:
- newbin = bin + '-bin'
- if os.path.exists(newbin):
- bin = newbin
- super(B2GDesktopInstance, self).__init__(host, port, bin, **kwargs)
- if not self.prefs:
- self.prefs = {}
- self.prefs["focusmanager.testmode"] = True
- self.app_args += ['-chrome', 'chrome://b2g/content/shell.html']
-
-
class DesktopInstance(GeckoInstance):
desktop_prefs = {
'app.update.auto': False,
'app.update.enabled': False,
'browser.dom.window.dump.enabled': True,
'browser.firstrun-content.dismissed': True,
# Bug 1145668 - Has to be reverted to about:blank once Marionette
# can correctly handle error pages
@@ -336,13 +313,11 @@ class DesktopInstance(GeckoInstance):
class NullOutput(object):
def __call__(self, line):
pass
apps = {
- 'b2g': B2GDesktopInstance,
- 'b2gdesktop': B2GDesktopInstance,
'fxdesktop': DesktopInstance,
'fennec': FennecInstance,
}
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -1452,25 +1452,23 @@ class Marionette(object):
def page_source(self):
"""A string representation of the DOM."""
return self._send_message("getPageSource", key="value")
def close(self):
"""Close the current window, ending the session if it's the last
window currently open.
- On B2G this method is a noop and will return immediately.
"""
self._send_message("close")
def close_chrome_window(self):
"""Close the currently selected chrome window, ending the session
if it's the last window open.
- On B2G this method is a noop and will return immediately.
"""
self._send_message("closeChromeWindow")
def set_context(self, context):
"""Sets the context that Marionette commands are running in.
:param context: Context, may be one of the class properties
`CONTEXT_CHROME` or `CONTEXT_CONTENT`.
--- a/testing/marionette/harness/docs/basics.rst
+++ b/testing/marionette/harness/docs/basics.rst
@@ -1,28 +1,27 @@
.. py:currentmodule:: marionette_driver.marionette
Marionette Python Client
========================
The Marionette python client library allows you to remotely control a
Gecko-based browser or device which is running a Marionette_
-server. This includes desktop Firefox and FirefoxOS (support for
-Firefox for Android is planned, but not yet fully implemented).
+server. This includes Firefox Desktop and Firefox for Android.
The Marionette server is built directly into Gecko and can be started by
passing in a command line option to Gecko, or by using a Marionette-enabled
build. The server listens for connections from various clients. Clients can
then control Gecko by sending commands to the server.
-This is the official python client for Marionette. There also exists a
+This is the official Python client for Marionette. There also exists a
`NodeJS client`_ maintained by the Firefox OS automation team.
.. _Marionette: https://developer.mozilla.org/en-US/docs/Marionette
-.. _NodeJS client: https://github.com/mozilla-b2g/marionette-js-client
+.. _NodeJS client: https://github.com/mozilla-b2g/gaia/tree/master/tests/jsmarionette
Getting the Client
------------------
The python client is officially supported. To install it, first make sure you
have `pip installed`_ then run:
.. parsed-literal::
@@ -54,19 +53,19 @@ A session is a single instance of a Mari
server. Before you can start executing commands, you need to start a session
with :func:`start_session() <Marionette.start_session>`:
.. parsed-literal::
client = Marionette('localhost', port=2828)
client.start_session()
This returns a session id and an object listing the capabilities of the
-Marionette server. For example, a server running on a Firefox OS device will
-have the ability to rotate the window, while a server running from Firefox
-won't. It's also possible to access the capabilities using the
+Marionette server. For example, a server running on Firefox Desktop will
+have some features which a server running from Firefox Android won't.
+It's also possible to access the capabilities using the
:attr:`~Marionette.session_capabilities` attribute. After finishing with a
session, you can delete it with :func:`~Marionette.delete_session()`. Note that
this will also happen automatically when the Marionette object is garbage
collected.
Context Management
------------------
Commands can only be executed in a single window, frame and scope at a time. In
@@ -88,20 +87,19 @@ Similarly, use :func:`~Marionette.switch
context of a new frame (e.g an <iframe> element):
.. parsed-literal::
iframe = client.find_element(By.TAG_NAME, 'iframe')
client.switch_to_frame(iframe)
assert iframe == client.get_active_frame()
Finally Marionette can switch between `chrome` and `content` scope. Chrome is a
-privileged scope where you can access things like the Firefox UI itself or the
-system app in Firefox OS. Content scope is where things like webpages or normal
-Firefox OS apps live. You can switch between `chrome` and `content` using the
-:func:`~Marionette.set_context` and :func:`~Marionette.using_context` functions:
+privileged scope where you can access things like the Firefox UI itself.
+Content scope is where things like webpages live. You can switch between
+`chrome` and `content` using the :func:`~Marionette.set_context` and :func:`~Marionette.using_context` functions:
.. parsed-literal::
client.set_context(client.CONTEXT_CONTENT)
# content scope
with client.using_context(client.CONTEXT_CHROME):
#chrome scope
... do stuff ...
# content scope restored