# HG changeset patch # User Andreas Tolfsen # Date 1519317140 0 # Node ID 64aac0ce028bbec3f7d46918a0d66115828d1344 # Parent 4cdea9ca426b455f4f21ed1cc5c341ee5a1391ab Bug 1441019 - Remove pre-generated Marionette API docs. r=whimboo This removes statically generated API documentation for Marionette. Subsequent commits will embed the API documentation with Sphinx. DONTBUILD MozReview-Commit-ID: 13LHrvoWIXT diff --git a/testing/marionette/doc/api/AsyncChromeSender.html b/testing/marionette/doc/api/AsyncChromeSender.html deleted file mode 100644 --- a/testing/marionette/doc/api/AsyncChromeSender.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - JSDoc: Class: AsyncChromeSender - - - - - - - - - - -
- -

Class: AsyncChromeSender

- - - - - - -
- -
- -

AsyncChromeSender()

- -

Sends asynchronous RPC messages to chrome space using a frame's -sendAsyncMessage (nsIAsyncMessageSender) function.

-

Example on how to use from a frame content script:

-
let sender = new AsyncChromeSender(messageManager);
-let promise = sender.send("runEmulatorCmd", "my command");
-let rv = await promise;
- - -
- -
-
- - - - -

Constructor

- - - -

new AsyncChromeSender()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

send(name, args) → {Promise}

- - - - - - -
-

Call registered function in chrome context.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
name - - -string - - - -

Function to call in the chrome, e.g. for Marionette:foo, - use foo.

args - - -* - - - -

Argument list to pass the function. Must be JSON serialisable.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

A promise that resolves to the value sent back.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/Command.html b/testing/marionette/doc/api/Command.html deleted file mode 100644 --- a/testing/marionette/doc/api/Command.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - JSDoc: Class: Command - - - - - - - - - - -
- -

Class: Command

- - - - - - -
- -
- -

Command(msgId, name, params)

- -

A command is a request from the client to run a series of remote end -steps and return a fitting response.

-

The command can be synthesised from the message passed over the -Marionette socket using the {@code fromMsg} function. The format of -a message is:

-
[type, id, name, params]

where

-

type (integer) - Must be zero (integer). Zero means that this message is a command.

-

id (integer) - Integer used as a sequence number. The server replies with the - same ID for the response.

-

name (string) - String representing the command name with an associated set of - remote end steps.

-

params (JSON Object or null) - Object of command function arguments. The keys of this object - must be strings, but the values can be arbitrary values.

-

A command has an associated message {@code id} that prevents the -dispatcher from sending responses in the wrong order.

-

The command may also have optional error- and result handlers that -are called when the client returns with a response. These are -{@code function onerror({Object})}, {@code function onresult({Object})}, -and {@code function onresult({Response})}.

- - -
- -
-
- - - - -

Constructor

- - - -

new Command(msgId, name, params)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msgId - - -number - - - -

Message ID unique identifying this message.

name - - -string - - - -

Command name.

params - - -Object.<string, ?> - - - -

Command parameters.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

onresponse(resp)

- - - - - - -
-

Calls the error- or result handler associated with this command. -This function can be replaced with a custom response handler.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
resp - - -Response - - - -

The response to pass on to the result or error to the - {@code onerror} or {@code onresult} handlers to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/ContentEventObserverService.html b/testing/marionette/doc/api/ContentEventObserverService.html deleted file mode 100644 --- a/testing/marionette/doc/api/ContentEventObserverService.html +++ /dev/null @@ -1,609 +0,0 @@ - - - - - JSDoc: Class: ContentEventObserverService - - - - - - - - - - -
- -

Class: ContentEventObserverService

- - - - - - -
- -
- -

ContentEventObserverService(windowGlobal, sendAsyncMessage)

- -

Provides the frame script backend for the -WebElementEventTarget.

-

This service receives requests for new DOM events to listen for and -to cease listening for, and despatches IPC messages to the browser -when they fire.

- - -
- -
-
- - - - -

Constructor

- - - -

new ContentEventObserverService(windowGlobal, sendAsyncMessage)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
windowGlobal - - -WindowProxy - - - -

Window.

sendAsyncMessage - - -nsIMessageSender.sendAsyncMessage - - - -

Function for sending an async message to the parent browser.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

add(type)

- - - - - - -
-

Observe a new DOM event.

-

When the DOM event of type fires, a message is passed -to the parent browser's event observer.

-

If event type is already being observed, only a single message -is sent. E.g. multiple registration for events will only ever emit -a maximum of one message.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
type - - -string - - - -

DOM event to listen for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

clear()

- - - - - - -
-

Ceases observing all previously registered DOM events.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

remove(type)

- - - - - - -
-

Ceases observing a DOM event.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
type - - -string - - - -

DOM event to stop listening for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/DebuggerTransport.html b/testing/marionette/doc/api/DebuggerTransport.html deleted file mode 100644 --- a/testing/marionette/doc/api/DebuggerTransport.html +++ /dev/null @@ -1,2401 +0,0 @@ - - - - - JSDoc: Class: DebuggerTransport - - - - - - - - - - -
- -

Class: DebuggerTransport

- - - - - - -
- -
- -

DebuggerTransport(input, output, nsIAsyncOutputStream) → {Promise}

- - -
- -
-
- - - - - - -

new DebuggerTransport(input, output, nsIAsyncOutputStream) → {Promise}

- - - - - - -
-

An adapter that handles data transfers between the debugger client -and server. It can work with both nsIPipe and nsIServerSocket -transports so long as the properly created input and output streams -are specified. (However, for intra-process connections, -LocalDebuggerTransport, below, is more efficient than using an nsIPipe -pair with DebuggerTransport.)

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
input - - -nsIAsyncInputStream - - - -

The input stream.

output - - -nsIAsyncOutputStream - - - -

The output stream.

-

Given a DebuggerTransport instance dt: -1) Set dt.hooks to a packet handler object (described below). -2) Call dt.ready() to begin watching for input packets. -3) Call dt.send() / dt.startBulkSend() to send packets. -4) Call dt.close() to close the connection, and disengage from - the event loop.

-

A packet handler is an object with the following methods:

-
    -
  • onPacket(packet) - called when we have received a complete packet. -|packet| is the parsed form of the packet --- a JavaScript value, not -a JSON-syntax string.

    -
  • -
  • onBulkPacket(packet) - called when we have switched to bulk packet -receiving mode. |packet| is an object containing:

    -
      -
    • actor: Name of actor that will receive the packet
    • -
    • type: Name of actor's method that should be called on receipt
    • -
    • length: Size of the data to be read
    • -
    • stream: This input stream should only be used directly if you
          can ensure that you will read exactly |length| bytes and
      -    will not close the stream when reading is complete
    • -
    • done: If you use the stream directly (instead of |copyTo|
          below), you must signal completion by resolving/rejecting
      -    this deferred.  If it's rejected, the transport will
      -    be closed.  If an Error is supplied as a rejection value,
      -    it will be logged via |dump|.  If you do use |copyTo|,
      -    resolving is taken care of for you when copying completes.
    • -
    • copyTo: A helper function for getting your data out of the
          stream that meets the stream handling requirements above,
      -    and has the following signature:
    • -
    -
  • -
nsIAsyncOutputStream - - -output - - - -

The stream to copy to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The promise is resolved when copying completes or - rejected if any (unexpected) errors occur. This object - also emits "progress" events for each chunk that is - copied. See stream-utils.js.

-
    -
  • onClosed(reason) - called when the connection is closed. |reason| -is an optional nsresult or object, typically passed when the -transport is closed due to some error in a underlying stream.
  • -
-

See ./packets.js and the Remote Debugging Protocol specification for -more details on the format of these packets.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - -
- - - - - - - - - - - - - - -

Members

- - - -

_currentOutgoing

- - - - -
-

The currently outgoing packet (at the top of the queue).

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -

Methods

- - - - - - - -

_destroyAllOutgoing()

- - - - - - -
-

Clear the entire outgoing queue.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_destroyIncoming()

- - - - - - -
-

Remove all handlers and references related to the current incoming -packet, either because it is now complete or because the transport -is closing.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_finishCurrentOutgoing()

- - - - - - -
-

Remove the current outgoing packet from the queue upon completion.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_flushIncoming()

- - - - - - -
-

If the incoming packet is done, log it as needed and clear the buffer.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_flushOutgoing()

- - - - - - -
-

Flush data to the outgoing stream. Waits until the output -stream notifies us that it is ready to be written to (via -onOutputStreamReady).

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_onBulkReadReady()

- - - - - - -
-

Handler triggered by an incoming BulkPacket entering the |read| -phase for the stream portion of the packet. Delivers info about the -incoming streaming data to this.hooks.onBulkPacket. See the main -comment on the transport at the top of this file for more details.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_onJSONObjectReady()

- - - - - - -
-

Handler triggered by an incoming JSONPacket completing it's |read| -method. Delivers the packet to this.hooks.onPacket.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

_processIncoming() → {boolean}

- - - - - - -
-

Process the incoming data. Will create a new currently incoming -Packet if needed. Tells the incoming Packet to read as much data -as it can, but reading may not complete. The Packet signals that -its data is ready for delivery by calling one of this transport's -_onReady methods (see ./packets.js and the _onReady methods below).

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Whether incoming stream processing should continue for any - remaining data.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

_readHeader() → {boolean}

- - - - - - -
-

Read as far as we can into the incoming data, attempting to build -up a complete packet header (which terminates with ":"). We'll only -read up to PACKET_HEADER_MAX characters.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if we now have a complete header.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

_waitForIncoming()

- - - - - - -
-

Asks the input stream to notify us (via onInputStreamReady) when it is -ready for reading.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

close(reasonopt)

- - - - - - -
-

Close the transport.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
reason - - -nsresult -| - -object - - - - - - <optional>
- - - - - -

The status code or error message that corresponds to the reason - for closing the transport (likely because a stream closed - or failed).

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

onInputStreamReady()

- - - - - - -
-

Called when the stream is either readable or closed.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

onOutputStreamReady()

- - - - - - -
-

This is called when the output stream is ready for more data to -be written. The current outgoing packet will attempt to write some -amount of data, but may not complete.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

pauseIncoming()

- - - - - - -
-

Pause this transport's attempts to read from the input stream. -This is used when we've temporarily handed off our input stream for -reading bulk data.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

pauseOutgoing()

- - - - - - -
-

Pause this transport's attempts to write to the output stream. -This is used when we've temporarily handed off our output stream for -writing bulk data.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

ready()

- - - - - - -
-

Initialize the input stream for reading. Once this method has been -called, we watch for packets on the input stream, and pass them to -the appropriate handlers via this.hooks.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

resumeIncoming()

- - - - - - -
-

Resume this transport's attempts to read from the input stream.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

resumeOutgoing()

- - - - - - -
-

Resume this transport's attempts to write to the output stream.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

send()

- - - - - - -
-

Transmit an object as a JSON packet.

-

This method returns immediately, without waiting for the entire -packet to be transmitted, registering event handlers as needed to -transmit the entire packet. Packets are transmitted in the order they -are passed to this method.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

startBulkSend(header, input) → {Promise|Promise}

- - - - - - -
-

Transmit streaming data via a bulk packet.

-

This method initiates the bulk send process by queuing up the header -data. The caller receives eventual access to a stream for writing.

-

N.B.: Do not attempt to close the stream handed to you, as it -will continue to be used by this transport afterwards. Most users -should instead use the provided |copyFrom| function instead.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
header - - -Object - - - -

This is modeled after the format of JSON packets above, but does - not actually contain the data, but is instead just a routing - header:

-
  - actor:  Name of actor that will receive the packet
-  - type:   Name of actor's method that should be called on receipt
-  - length: Size of the data to be sent
input - - -nsIAsyncInputStream - - - -

The stream to copy from.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
-
    -
  • -
    -

    The promise will be resolved when you are allowed to write to - the stream with an object containing:

    -
      - stream:   This output stream should only be used directly
    -              if you can ensure that you will write exactly
    -              |length| bytes and will not close the stream when
    -               writing is complete.
    -  - done:     If you use the stream directly (instead of
    -              |copyFrom| below), you must signal completion by
    -              resolving/rejecting this deferred.  If it's
    -              rejected, the transport will be closed.  If an
    -              Error is supplied as a rejection value, it will
    -              be logged via |dump|.  If you do use |copyFrom|,
    -              resolving is taken care of for you when copying
    -              completes.
    -  - copyFrom: A helper function for getting your data onto the
    -              stream that meets the stream handling requirements
    -              above, and has the following signature:
    -
    - - - -
    -
    - Type -
    -
    - -Promise - - -
    -
    -
  • - -
  • -
    -

    The promise is resolved when copying completes - or rejected if any (unexpected) errors occur. - This object also emits "progress" events for - each chunkthat is copied. See stream-utils.js.

    -
    - - - -
    -
    - Type -
    -
    - -Promise - - -
    -
    -
  • -
- - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/ElementClickInterceptedError.html b/testing/marionette/doc/api/ElementClickInterceptedError.html deleted file mode 100644 --- a/testing/marionette/doc/api/ElementClickInterceptedError.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - JSDoc: Class: ElementClickInterceptedError - - - - - - - - - - -
- -

Class: ElementClickInterceptedError

- - - - - - -
- -
- -

ElementClickInterceptedError(obscuredElopt, coords)

- -

An element click could not be completed because the element receiving -the events is obscuring the element that was requested clicked.

- - -
- -
-
- - - - -

Constructor

- - - -

new ElementClickInterceptedError(obscuredElopt, coords)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obscuredEl - - -Element - - - - - - <optional>
- - - - - -

Element obscuring the element receiving the click. Providing this - is not required, but will produce a nicer error message.

coords - - -Map.<string, number> - - - - - - - - - -

Original click location. Providing this is not required, but - will produce a nicer error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/ElementNotAccessibleError.html b/testing/marionette/doc/api/ElementNotAccessibleError.html deleted file mode 100644 --- a/testing/marionette/doc/api/ElementNotAccessibleError.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - JSDoc: Class: ElementNotAccessibleError - - - - - - - - - - -
- -

Class: ElementNotAccessibleError

- - - - - - -
- -
- -

ElementNotAccessibleError()

- -

The Gecko a11y API indicates that the element is not accessible.

- - -
- -
-
- - - - -

Constructor

- - - -

new ElementNotAccessibleError()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/ElementNotInteractableError.html b/testing/marionette/doc/api/ElementNotInteractableError.html deleted file mode 100644 --- a/testing/marionette/doc/api/ElementNotInteractableError.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - JSDoc: Class: ElementNotInteractableError - - - - - - - - - - -
- -

Class: ElementNotInteractableError

- - - - - - -
- -
- -

ElementNotInteractableError()

- -

A command could not be completed because the element is not pointer- -or keyboard interactable.

- - -
- -
-
- - - - -

Constructor

- - - -

new ElementNotInteractableError()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/GeckoDriver.html b/testing/marionette/doc/api/GeckoDriver.html deleted file mode 100644 --- a/testing/marionette/doc/api/GeckoDriver.html +++ /dev/null @@ -1,14476 +0,0 @@ - - - - - JSDoc: Class: GeckoDriver - - - - - - - - - - -
- -

Class: GeckoDriver

- - - - - - -
- -
- -

GeckoDriver(appName, server)

- - -
- -
-
- - - - - - -

new GeckoDriver(appName, server)

- - - - - - -
-

Implements (parts of) the W3C WebDriver protocol. GeckoDriver lives -in chrome space and mediates calls to the message listener of the current -browsing context's content frame message listener via ListenerProxy.

-

Throughout this prototype, functions with the argument cmd's -documentation refers to the contents of the cmd.parameter -object.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
appName - - -string - - - -

Description of the product, for example "Firefox".

server - - -MarionetteServer - - - -

The instance of Marionette server.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

acceptConnections(state)

- - - - - - -
-

Enables or disables accepting new socket connections.

-

By calling this method with false the server will not accept any -further connections, but existing connections will not be forcible -closed. Use true to re-enable accepting connections.

-

Please note that when closing the connection via the client you can -end-up in a non-recoverable state if it hasn't been enabled before.

-

This method is used for custom in application shutdowns via -marionette.quit() or marionette.restart(), like File -> Quit.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
state - - -boolean - - - -

True if the server should accept new socket connections.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

acceptDialog()

- - - - - - -
-

Accepts a currently displayed tab modal, or returns no such alert if -no modal is displayed.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

actionChain(value) → {number}

- - - - - - -
-

An action chain.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
value - - -Object - - - -

A nested array where the inner array represents each event, - and the outer array represents a collection of events.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not applicable to application.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Last touch ID.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

addBrowser(win) → {string}

- - - - - - -
-

Create a new browsing context for window and add to known browsers.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
win - - -ChromeWindow - - - -

Window for which we will create a browsing context.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Returns the unique server-assigned ID of the window.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

addCookie()

- - - - - - -
-

Add a single cookie to the cookie store associated with the active -document's address.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
{Map. - -

(string|number|boolean)> cookie - Cookie object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If cookie is for a different domain than the active - document's host.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -InvalidCookieDomainError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

clearElement(id)

- - - - - - -
-

Clear the text of an element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be cleared.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

clickElement(id)

- - - - - - -
-

Send click event to element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be clicked.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

close() → {Array.<string>}

- - - - - - -
-

Close the currently selected tab/window.

-

With multiple open tabs present the currently selected tab will -be closed. Otherwise the window itself will be closed. If it is the -last window currently open, the window will not be closed to prevent -a shutdown of the application. Instead the returned list of window -handles is empty.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Unique window handles of remaining windows.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

closeChromeWindow() → {Array.<string>}

- - - - - - -
-

Close the currently selected chrome window.

-

If it is the last window currently open, the chrome window will not be -closed to prevent a shutdown of the application. Instead the returned -list of chrome window handles is empty.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Unique chrome window handles of remaining chrome windows.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

deleteAllCookies()

- - - - - - -
-

Delete all cookies that are visible to a document.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

deleteCookie()

- - - - - - -
-

Delete a cookie by name.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

deleteSession()

- - - - - - -
-

Delete Marionette session.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

dismissDialog()

- - - - - - -
-

Dismisses a currently displayed tab modal, or returns no such alert if -no modal is displayed.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

executeAsyncScript(script, args, scriptTimeout, sandboxopt, newSandboxopt, filenameopt, lineopt, debug_scriptopt, directInjectopt) → {string|boolean|number|object|WebElement}

- - - - - - -
-

Executes a JavaScript function in the context of the current browsing -context, if in content space, or in chrome space otherwise, and returns -the object passed to the callback.

-

The callback is always the last argument to the arguments -list passed to the function scope of the script. It can be retrieved -as such:

-

-    let callback = arguments[arguments.length - 1];
-    callback("foo");
-    // "foo" is returned
-
- -

It is important to note that if the sandboxName parameter -is left undefined, the script will be evaluated in a mutable sandbox, -causing any change it makes on the global state of the document to have -lasting side-effects.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
script - - -string - - - - - - - - - -

Script to evaluate as a function body.

args - - -Array.<(string|boolean|number|object|WebElement)> - - - - - - - - - -

Arguments exposed to the script in arguments. - The array items must be serialisable to the WebDriver protocol.

scriptTimeout - - -number - - - - - - - - - -

Duration in milliseconds of when to interrupt and abort the - script evaluation.

sandbox - - -string - - - - - - <optional>
- - - - - -

Name of the sandbox to evaluate the script in. The sandbox is - cached for later re-use on the same Window object if - newSandbox is false. If the parameter is undefined, - the script is evaluated in a mutable sandbox. If the parameter - is "system", it will be evaluted in a sandbox with elevated system - privileges, equivalent to chrome space.

newSandbox - - -boolean - - - - - - <optional>
- - - - - -

Forces the script to be evaluated in a fresh sandbox. Note that if - it is undefined, the script will normally be evaluted in a fresh - sandbox.

filename - - -string - - - - - - <optional>
- - - - - -

Filename of the client's program where this script is evaluated.

line - - -number - - - - - - <optional>
- - - - - -

Line in the client's program where this script is evaluated.

debug_script - - -boolean - - - - - - <optional>
- - - - - -

Attach an onerror event handler on the Window - object. It does not differentiate content errors from chrome errors.

directInject - - -boolean - - - - - - <optional>
- - - - - -

Evaluate the script without wrapping it in a function.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If the script was interrupted due to reaching the - scriptTimeout or default timeout.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -ScriptTimeoutError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If an Error was thrown whilst evaluating the script.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -JavaScriptError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Return value from the script, or null which signifies either the - JavaScript notion of null or undefined.

-
- - - -
-
- Type -
-
- -string -| - -boolean -| - -number -| - -object -| - -WebElement - - -
-
- - - - - - - - - - - - - -

executeScript(script, args, scriptTimeout, sandboxopt, newSandboxopt, filenameopt, lineopt, debug_scriptopt, directInjectopt) → {string|boolean|number|object|WebElement}

- - - - - - -
-

Executes a JavaScript function in the context of the current browsing -context, if in content space, or in chrome space otherwise, and returns -the return value of the function.

-

It is important to note that if the sandboxName parameter -is left undefined, the script will be evaluated in a mutable sandbox, -causing any change it makes on the global state of the document to have -lasting side-effects.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
script - - -string - - - - - - - - - -

Script to evaluate as a function body.

args - - -Array.<(string|boolean|number|object|WebElement)> - - - - - - - - - -

Arguments exposed to the script in arguments. - The array items must be serialisable to the WebDriver protocol.

scriptTimeout - - -number - - - - - - - - - -

Duration in milliseconds of when to interrupt and abort the - script evaluation.

sandbox - - -string - - - - - - <optional>
- - - - - -

Name of the sandbox to evaluate the script in. The sandbox is - cached for later re-use on the same Window object if - newSandbox is false. If he parameter is undefined, - the script is evaluated in a mutable sandbox. If the parameter - is "system", it will be evaluted in a sandbox with elevated system - privileges, equivalent to chrome space.

newSandbox - - -boolean - - - - - - <optional>
- - - - - -

Forces the script to be evaluated in a fresh sandbox. Note that if - it is undefined, the script will normally be evaluted in a fresh - sandbox.

filename - - -string - - - - - - <optional>
- - - - - -

Filename of the client's program where this script is evaluated.

line - - -number - - - - - - <optional>
- - - - - -

Line in the client's program where this script is evaluated.

debug_script - - -boolean - - - - - - <optional>
- - - - - -

Attach an onerror event handler on the Window - object. It does not differentiate content errors from chrome errors.

directInject - - -boolean - - - - - - <optional>
- - - - - -

Evaluate the script without wrapping it in a function.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If the script was interrupted due to reaching the - scriptTimeout or default timeout.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -ScriptTimeoutError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If an Error was thrown whilst evaluating the script.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -JavaScriptError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Return value from the script, or null which signifies either the - JavaScript notion of null or undefined.

-
- - - -
-
- Type -
-
- -string -| - -boolean -| - -number -| - -object -| - -WebElement - - -
-
- - - - - - - - - - - - - -

findElement(using, value)

- - - - - - -
-

Find an element using the indicated search strategy.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
using - - -string - - - -

Indicates which search method to use.

value - - -string - - - -

Value the client is looking for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

findElements(using, value)

- - - - - - -
-

Find elements using the indicated search strategy.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
using - - -string - - - -

Indicates which search method to use.

value - - -string - - - -

Value the client is looking for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

findWindow(winIterable, filter) → {Object}

- - - - - - -
-

Find a specific window according to some filter function.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
winIterable - - -Iterable.<Window> - - - -

Iterable that emits Windows.

filter - - -function - - - -

A callback function taking two arguments; the window and - the outerId of the window, and returning a boolean indicating - whether the window is the target.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

A window handle object containing the window and some - associated metadata.

-
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

fullscreenWindow() → {Map.<string, number>}

- - - - - - -
-

Synchronously sets the user agent window to full screen as if the user -had done "View > Enter Full Screen".

-

No action is taken if the window is already in full screen mode.

-

Not supported on Fennec.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available for current application.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Window rect.

-
- - - -
-
- Type -
-
- -Map.<string, number> - - -
-
- - - - - - - - - - - - - -

get(url)

- - - - - - -
-

Navigate to given URL.

-

Navigates the current browsing context to the given URL and waits for -the document to load or the session's page timeout duration to elapse -before returning.

-

The command will return with a failure if there is an error loading -the document or the URL is blocked. This can occur if it fails to -reach host, the URL is malformed, or if there is a certificate issue -to name some examples.

-

The document is considered successfully loaded when the -DOMContentLoaded event on the frame element associated with the -current window triggers and document.readyState is "complete".

-

In chrome context it will change the current window's location to -the supplied URL and wait until document.readyState equals "complete" -or the page timeout duration has elapsed.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
url - - -string - - - -

URL to navigate to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

getActiveElement() → {WebElement}

- - - - - - -
-

Return the active element on the page.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Active element of the current browsing context's document element.

-
- - - -
-
- Type -
-
- -WebElement - - -
-
- - - - - - - - - - - - - -

getChromeWindowHandle() → {string}

- - - - - - -
-

Get the current window's handle. This corresponds to a window that -may itself contain tabs.

-

Return an opaque server-assigned identifier to this window that -uniquely identifies it within this Marionette instance. This can -be used to switch to this window at a later point.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

Top-level browsing context has been discarded.

-
-
-
-
-
-
- Type -
-
- -NoSuchWindowError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Unique window handle.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getChromeWindowHandles() → {Array.<string>}

- - - - - - -
-

Returns identifiers for each open chrome window for tests interested in -managing a set of chrome windows and tabs separately.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Unique window handles.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

getContext()

- - - - - - -
-

Gets the context of the server, either "chrome" or "content".

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getCookies()

- - - - - - -
-

Get all the cookies for the current domain.

-

This is the equivalent of calling document.cookie and -parsing the result.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

getCurrentUrl()

- - - - - - -
-

Get a string representing the current URL.

-

On Desktop this returns a string representation of the URL of the -current top level browsing context. This is equivalent to -document.location.href.

-

When in the context of the chrome, this returns the canonical URL -of the current resource.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

getCurrentWindow(forcedContextopt) → {ChromeWindow}

- - - - - - -
-

Get the session's current top-level browsing context.

-

It will return the outer ChromeWindow previously selected by -window handle through #switchToWindow, or the first window that -was registered.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
forcedContext - - -Context - - - - - - <optional>
- - - - - -

Optional name of the context to use for finding the window. - It will be required if a command always needs a specific context, - whether which context is currently set. Defaults to the current - context.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The current top-level browsing context.

-
- - - -
-
- Type -
-
- -ChromeWindow - - -
-
- - - - - - - - - - - - - -

getElementAttribute(id, name) → {string}

- - - - - - -
-

Get a given attribute of an element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Web element reference ID to the element that will be inspected.

name - - -string - - - -

Name of the attribute which value to retrieve.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Value of the attribute.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getElementProperty(id, name) → {string}

- - - - - - -
-

Returns the value of a property associated with given element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Web element reference ID to the element that will be inspected.

name - - -string - - - -

Name of the property which value to retrieve.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Value of the property.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getElementRect()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

getElementTagName(id) → {string}

- - - - - - -
-

Get the tag name of the element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be inspected.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Local tag name of element.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getElementText(id) → {string}

- - - - - - -
-

Get the text of an element, if any. Includes the text of all child -elements.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be inspected.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Element's text "as rendered".

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getElementValueOfCssProperty(id, propertyName) → {string}

- - - - - - -
-

Return the property of the computed style of an element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be checked.

propertyName - - -string - - - -

CSS rule that is being requested.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Value of |propertyName|.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getPageSource() → {string}

- - - - - - -
-

Gets the page source of the content document.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

String serialisation of the DOM of the current browsing context's - active document.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getScreenOrientation()

- - - - - - -
-

Get the current browser orientation.

-

Will return one of the valid primary orientation values -portrait-primary, landscape-primary, portrait-secondary, or -landscape-secondary.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getSessionCapabilities()

- - - - - - -
-

Send the current session's capabilities to the client.

-

Capabilities informs the client of which WebDriver features are -supported by Firefox and Marionette. They are immutable for the -length of the session.

-

The return value is an immutable map of string keys -("capabilities") to values, which may be of types boolean, -numerical or string.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getTextFromDialog()

- - - - - - -
-

Returns the message shown in a currently displayed modal, or returns -a no such alert error if no modal is currently displayed.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getTitle() → {string}

- - - - - - -
-

Gets the current title of the window.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Document title of the top-level browsing context.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getVisibleText(el, lines)

- - - - - - -
-

Recursively get all labeled text.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
el - - -Element - - - -

The parent element.

lines - - -Array.<string> - - - -

Array that holds the text lines.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getWindowHandle() → {string}

- - - - - - -
-

Get the current window's handle. On desktop this typically corresponds -to the currently selected tab.

-

Return an opaque server-assigned identifier to this window that -uniquely identifies it within this Marionette instance. This can -be used to switch to this window at a later point.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

Top-level browsing context has been discarded.

-
-
-
-
-
-
- Type -
-
- -NoSuchWindowError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Unique window handle.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

getWindowHandles() → {Array.<string>}

- - - - - - -
-

Get a list of top-level browsing contexts. On desktop this typically -corresponds to the set of open tabs for browser windows, or the window -itself for non-browser chrome windows.

-

Each window handle is assigned by the server and is guaranteed unique, -however the return array does not have a specified ordering.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Unique window handles.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

getWindowRect() → {Object.<string, number>}

- - - - - - -
-

Get the current position and size of the browser window currently in focus.

-

Will return the current browser window size in pixels. Refers to -window outerWidth and outerHeight values, which include scroll bars, -title bars, etc.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Object with |x| and |y| coordinates, and |width| and |height| - of browser window.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

getWindowType()

- - - - - - -
-

Gets the current type of the window.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

globalModalDialogHandler()

- - - - - - -
-

Callback used to observe the creation of new modal or tab modal dialogs -during the session's lifetime.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

goBack()

- - - - - - -
-

Cause the browser to traverse one step backward in the joint history -of the current browsing context.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

goForward()

- - - - - - -
-

Cause the browser to traverse one step forward in the joint history -of the current browsing context.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

isElementDisplayed(id) → {boolean}

- - - - - - -
-

Check if element is displayed.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be inspected.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

True if displayed, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

isElementEnabled(id) → {boolean}

- - - - - - -
-

Check if element is enabled.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be checked.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

True if enabled, false if disabled.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

isElementSelected(id) → {boolean}

- - - - - - -
-

Check if element is selected.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be checked.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

True if selected, false if unselected.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

localizeEntity(urls, id) → {string}

- - - - - - -
-

Retrieve the localized string for the specified entity id.

-

Example: - localizeEntity(["chrome://global/locale/about.dtd"], "about.version")

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
urls - - -Array.<string> - - - -

Array of .dtd URLs.

id - - -string - - - -

The ID of the entity to retrieve the localized string for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The localized string for the requested entity.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

localizeProperty(urls, id) → {string}

- - - - - - -
-

Retrieve the localized string for the specified property id.

-

Example:

-
localizeProperty(
-    ["chrome://global/locale/findbar.properties"], "FastFind");
-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
urls - - -Array.<string> - - - -

Array of .properties URLs.

id - - -string - - - -

The ID of the property to retrieve the localized string for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The localized string for the requested property.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

maximizeWindow() → {Object.<string, number>}

- - - - - - -
-

Synchronously maximizes the user agent window as if the user pressed -the maximize button.

-

No action is taken if the window is already maximized.

-

Not supported on Fennec.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available for current application.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Window rect.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

minimizeWindow() → {Object.<string, number>}

- - - - - - -
-

Synchronously minimizes the user agent window as if the user pressed -the minimize button.

-

No action is taken if the window is already minimized.

-

Not supported on Fennec.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available for current application.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Window rect and window state.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

multiAction(value)

- - - - - - -
-

A multi-action chain.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
value - - -Object - - - -

A nested array where the inner array represents eache vent, - the middle array represents a collection of events for each - finger, and the outer array represents all fingers.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

newSession(sessionIdopt, capabilitiesopt) → {Object}

- - - - - - -
-

Create a new WebDriver session.

-

It is expected that the caller performs the necessary checks on -the requested capabilities to be WebDriver conforming. The WebDriver -service offered by Marionette does not match or negotiate capabilities -beyond type- and bounds checks.

-

Capabilities

- -
-
pageLoadStrategy (string) -
The page load strategy to use for the current session. Must be - one of "none", "eager", and "normal". - -
acceptInsecureCerts (boolean) -
Indicates whether untrusted and self-signed TLS certificates - are implicitly trusted on navigation for the duration of the session. - -
timeouts (Timeouts object) -
Describes the timeouts imposed on certian session operations. - -
proxy (Proxy object) -
Defines the proxy configuration. - -
moz:accessibilityChecks (boolean) -
Run a11y checks when clicking elements. - -
moz:webdriverClick (boolean) -
Use a WebDriver conforming WebDriver::ElementClick. -
- -

Timeouts object

- -
-
script (number) -
Determines when to interrupt a script that is being evaluates. - -
pageLoad (number) -
Provides the timeout limit used to interrupt navigation of the - browsing context. - -
implicit (number) -
Gives the timeout of when to abort when locating an element. -
- -

Proxy object

- -
-
proxyType (string) -
Indicates the type of proxy configuration. Must be one - of "pac", "direct", "autodetect", - "system", or "manual". - -
proxyAutoconfigUrl (string) -
Defines the URL for a proxy auto-config file if - proxyType is equal to "pac". - -
ftpProxy (string) -
Defines the proxy host for FTP traffic when the - proxyType is "manual". - -
httpProxy (string) -
Defines the proxy host for HTTP traffic when the - proxyType is "manual". - -
noProxy (string) -
Lists the adress for which the proxy should be bypassed when - the proxyType is "manual". Must be a JSON - List containing any number of any of domains, IPv4 addresses, or IPv6 - addresses. - -
sslProxy (string) -
Defines the proxy host for encrypted TLS traffic when the - proxyType is "manual". - -
socksProxy (string) -
Defines the proxy host for a SOCKS proxy traffic when the - proxyType is "manual". - -
socksVersion (string) -
Defines the SOCKS proxy version when the proxyType is - "manual". It must be any integer between 0 and 255 - inclusive. -
- -

Example

- -

Input:

-

-    {"capabilities": {"acceptInsecureCerts": true}}
-
-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
sessionId - - -string - - - - - - <optional>
- - - - - -

Normally a unique ID is given to a new session, however this can - be overriden by providing this field.

capabilities - - -Object.<string, *> - - - - - - <optional>
- - - - - -

JSON Object containing any of the recognised capabilities listed - above.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If, for whatever reason, a session could not be created.

-
-
-
-
-
-
- Type -
-
- -SessionNotCreatedError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Session ID and capabilities offered by the WebDriver service.

-
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

performActions(actions)

- - - - - - -
-

Perform a series of grouped actions at the specified points in time.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
actions - - -Array.<?> - - - -

Array of objects that each represent an action sequence.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not yet available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

quit(flagsopt) → {string}

- - - - - - -
-

Quits the application with the provided flags.

-

Marionette will stop accepting new connections before ending the -current session, and finally attempting to quit the application.

-

Optional nsIAppStartup flags may be provided as -an array of masks, and these will be combined by ORing -them with a bitmask. The available masks are defined in -https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAppStartup.

-

Crucially, only one of the Quit flags can be specified. The |eRestart| -flag may be bit-wise combined with one of the Quit flags to cause -the application to restart after it quits.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
flags - - -Array.<string> - - - - - - <optional>
- - - - - -

Constant name of masks to pass to |Services.startup.quit|. - If empty or undefined, |nsIAppStartup.eAttemptQuit| is used.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If flags contains unknown or incompatible flags, - for example multiple Quit flags.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Explaining the reason why the application quit. This can be - in response to a normal shutdown or restart, yielding "shutdown" - or "restart", respectively.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

refresh()

- - - - - - -
-

Causes the browser to reload the page in current top-level browsing -context.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

registerBrowser()

- - - - - - -
-

Handles registration of new content listener browsers. Depending on -their type they are either accepted or ignored.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

releaseActions()

- - - - - - -
-

Release all the keys and pointer buttons that are currently depressed.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not available in current context.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

runReftest()

- - - - - - -
-

Run a reftest.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

sendAsync(name, msgopt, commandIDopt)

- - - - - - -
-

Helper method to send async messages to the content listener. -Correct usage is to pass in the name of a function in listener.js, -a serialisable object, and optionally the current command's ID -when not using the modern dispatching technique.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
name - - -string - - - - - - - - - -

Suffix of the targetted message listener - Marionette:SUFFIX.

msg - - -Object - - - - - - <optional>
- - - - - -

Optional JSON serialisable object to send to the listener.

commandID - - -number - - - - - - <optional>
- - - - - -

Optional command ID to ensure synchronisity.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

sendKeysToDialog(text)

- - - - - - -
-

Set the user prompt's value field.

-

Sends keys to the input field of a currently displayed modal, or -returns a no such alert error if no modal is currently displayed. If -a tab modal is currently displayed but has no means for text input, -an element not visible error is returned.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
text - - -string - - - -

Input to the user prompt's value field.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If the current user prompt is an alert or confirm.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -ElementNotInteractableError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If there is no current user prompt.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchAlertError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If the current user prompt is something other than an alert, - confirm, or a prompt.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

sendKeysToElement(id, value)

- - - - - - -
-

Send key presses to element after focusing on it.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Reference ID to the element that will be checked.

value - - -string - - - -

Value to send to the element.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

setContext(value)

- - - - - - -
-

Sets the context of the subsequent commands to be either "chrome" or -"content".

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
value - - -string - - - -

Name of the context to be switched to. Must be one of "chrome" or - "content".

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

setScreenOrientation()

- - - - - - -
-

Set the current browser orientation.

-

The supplied orientation should be given as one of the valid -orientation values. If the orientation is unknown, an error will -be raised.

-

Valid orientations are "portrait" and "landscape", which fall -back to "portrait-primary" and "landscape-primary" respectively, -and "portrait-secondary" as well as "landscape-secondary".

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

setTimeouts(Dictionary)

- - - - - - -
-

Set timeout for page loading, searching, and scripts.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
Dictionary - - -Object.<string, number> - - - -

of timeout types and their new value, where all timeout - types are optional.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If timeout type key is unknown, or the value provided with it is - not an integer.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

setupReftest()

- - - - - - -
-

Initialize the reftest mode

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

setWindowHandle(winProperties, focusopt)

- - - - - - -
-

Switch the marionette window to a given window. If the browser in -the window is unregistered, registers that browser and waits for -the registration is complete. If |focus| is true then set the focus -on the window.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
winProperties - - -Object - - - - - - - - - -

Object containing window properties such as returned from - GeckoDriver#findWindow

focus - - -boolean - - - - - - <optional>
- - - - - -

A boolean value which determines whether to focus the window. - Defaults to true.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

setWindowRect(x, y, width, height) → {Object.<string, number>}

- - - - - - -
-

Set the window position and size of the browser on the operating -system window manager.

-

The supplied |width| and |height| values refer to the window outerWidth -and outerHeight values, which include browser chrome and OS-level -window borders.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
x - - -number - - - -

X coordinate of the top/left of the window that it will be - moved to.

y - - -number - - - -

Y coordinate of the top/left of the window that it will be - moved to.

width - - -number - - - -

Width to resize the window to.

height - - -number - - - -

Height to resize the window to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Not applicable to application.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Object with |x| and |y| coordinates and |width| and |height| - dimensions.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

singleTap()

- - - - - - -
-

Single tap.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

startBrowser(win, falseopt)

- - - - - - -
-

Registers a new browser, win, with Marionette.

-

If we have not seen the browser content window before, the listener -frame script will be loaded into it. If isNewSession is true, we will -switch focus to the start frame when it registers.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
win - - -ChromeWindow - - - - - - - - - -

Window whose browser we need to access.

false - - -boolean - - - - - - <optional>
- - - - - -

isNewSession - True if this is the first time we're talking to this browser.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

switchToFrame(element, id)

- - - - - - -
-

Switch to a given frame within the current window.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
element - - -Object - - - -

A web element reference to the element to switch to.

id - - -string -| - -number - - - -

If element is not defined, then this holds either the id, name, - or index of the frame to switch to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

switchToGlobalMessageManager()

- - - - - - -
-

Switches to the global ChromeMessageBroadcaster, potentially replacing -a frame-specific ChromeMessageSender. Has no effect if the global -ChromeMessageBroadcaster is already in use. If this replaces a -frame-specific ChromeMessageSender, it removes the message listeners -from that sender, and then puts the corresponding frame script "to -sleep", which removes most of the message listeners from it as well.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

switchToParentFrame()

- - - - - - -
-

Set the current browsing context for future commands to the parent -of the current browsing context.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    Top-level browsing context has been discarded.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchWindowError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    A modal dialog is open, blocking this operation.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnexpectedAlertOpenError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

switchToShadowRoot(id)

- - - - - - -
-

Switch to shadow root of the given host element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

element id.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

switchToWindow(name, focusopt)

- - - - - - -
-

Switch current top-level browsing context by name or server-assigned -ID. Searches for windows by name, then ID. Content windows take -precedence.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
name - - -string - - - - - - - - - -

Target name or ID of the window to switch to.

focus - - -boolean - - - - - - <optional>
- - - - - -

A boolean value which determines whether to focus - the window. Defaults to true.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

takeScreenshot(idopt, highlightsopt, full, hashopt, scrollopt) → {string}

- - - - - - -
-

Takes a screenshot of a web element, current frame, or viewport.

-

The screen capture is returned as a lossless PNG image encoded as -a base 64 string.

-

If called in the content context, the |id| argument is not null and -refers to a present and visible web element's ID, the capture area will -be limited to the bounding box of that element. Otherwise, the capture -area will be the bounding box of the current frame.

-

If called in the chrome context, the screenshot will always represent -the entire viewport.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
id - - -string - - - - - - <optional>
- - - - - -

Optional web element reference to take a screenshot of. - If undefined, a screenshot will be taken of the document element.

highlights - - -Array.<string> - - - - - - <optional>
- - - - - -

List of web elements to highlight.

full - - -boolean - - - - - - - - - -

True to take a screenshot of the entire document element. Is not - considered if id is not defined. Defaults to true.

hash - - -boolean - - - - - - <optional>
- - - - - -

True if the user requests a hash of the image data.

scroll - - -boolean - - - - - - <optional>
- - - - - -

Scroll to element if |id| is provided. If undefined, it will - scroll to the element.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

If hash is false, PNG image encoded as Base64 encoded - string. If hash is true, hex digest of the SHA-256 - hash of the Base64 encoded string.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

teardownReftest()

- - - - - - -
-

End a reftest run.

-

Closes the reftest window (without changing the current window handle), -and removes cached canvases.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

updateIdForBrowser()

- - - - - - -
-

Forces an update for the given browser's id.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

whenBrowserStarted(window, isNewSession)

- - - - - - -
-

Callback invoked after a new session has been started in a browser. -Loads the Marionette frame script into the browser if needed.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
window - - -ChromeWindow - - - -

Window whose browser we need to access.

isNewSession - - -boolean - - - -

True if this is the first time we're talking to this browser.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/InputState.html b/testing/marionette/doc/api/InputState.html deleted file mode 100644 --- a/testing/marionette/doc/api/InputState.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - JSDoc: Class: InputState - - - - - - - - - - -
- -

Class: InputState

- - - - - - -
- -
- -

InputState()

- -

Represents device state for an input source.

- - -
- -
-
- - - - -

Constructor

- - - -

new InputState()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(obj) → {action.InputState}

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
obj - - -Object.<string, ?> - - - -

Object with property type and optionally - parameters or pointerType, - representing an action sequence or an action item.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If actionSequence.type is not valid.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

An InputState object for the type of the - actionSequence.

-
- - - -
-
- Type -
-
- -action.InputState - - -
-
- - - - - - - - - - - - - -

is(other) → {boolean}

- - - - - - -
-

Check equality of this InputState object with another.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
other - - -InputState - - - -

Object representing an input state.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if this has the same type - as other.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/InsecureCertificateError.html b/testing/marionette/doc/api/InsecureCertificateError.html deleted file mode 100644 --- a/testing/marionette/doc/api/InsecureCertificateError.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - JSDoc: Class: InsecureCertificateError - - - - - - - - - - -
- -

Class: InsecureCertificateError

- - - - - - -
- -
- -

InsecureCertificateError()

- -

Navigation caused the user agent to hit a certificate warning, which -is usually the result of an expired or invalid TLS certificate.

- - -
- -
-
- - - - -

Constructor

- - - -

new InsecureCertificateError()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/InvalidArgumentError.html b/testing/marionette/doc/api/InvalidArgumentError.html deleted file mode 100644 --- a/testing/marionette/doc/api/InvalidArgumentError.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - JSDoc: Class: InvalidArgumentError - - - - - - - - - - -
- -

Class: InvalidArgumentError

- - - - - - -
- -
- -

InvalidArgumentError()

- -

The arguments passed to a command are either invalid or malformed.

- - -
- -
-
- - - - -

Constructor

- - - -

new InvalidArgumentError()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/JavaScriptError.html b/testing/marionette/doc/api/JavaScriptError.html deleted file mode 100644 --- a/testing/marionette/doc/api/JavaScriptError.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - JSDoc: Class: JavaScriptError - - - - - - - - - - -
- -

Class: JavaScriptError

- - - - - - -
- -
- -

JavaScriptError(x, fnNameopt, fileopt, lineopt, scriptopt)

- -

Creates a richly annotated error for an error situation that occurred -whilst evaluating injected scripts.

- - -
- -
-
- - - - -

Constructor

- - - -

new JavaScriptError(x, fnNameopt, fileopt, lineopt, scriptopt)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
x - - -string -| - -Error - - - - - - - - - -

An Error object instance or a string describing the error - situation.

fnName - - -string - - - - - - <optional>
- - - - - -

Name of the function to use in the stack trace message.

file - - -string - - - - - - <optional>
- - - - - -

Filename of the test file on the client.

line - - -number - - - - - - <optional>
- - - - - -

Line number of |file|.

script - - -string - - - - - - <optional>
- - - - - -

Script being executed, in text form.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/Message.html b/testing/marionette/doc/api/Message.html deleted file mode 100644 --- a/testing/marionette/doc/api/Message.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - JSDoc: Class: Message - - - - - - - - - - -
- -

Class: Message

- - - - - - -
- -
- -

Message()

- - -
- -
-
- - - - - - -

new Message()

- - - - - - -
-

Representation of the packets transproted over the wire.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromMsg(data) → {Message}

- - - - - - -
-

Converts a data packet into a Command or Response type.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
data - - -Array.<number, number, ?, ?> - - - -

A four element array where the elements, in sequence, signifies - message type, message ID, method name or error, and parameters - or result.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If the message type is not recognised.

-
-
-
-
-
-
- Type -
-
- -TypeError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Based on the message type, a Command or Response - instance.

-
- - - -
-
- Type -
-
- -Message - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/Packet.html b/testing/marionette/doc/api/Packet.html deleted file mode 100644 --- a/testing/marionette/doc/api/Packet.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - JSDoc: Class: Packet - - - - - - - - - - -
- -

Class: Packet

- - - - - - -
- -
- -

Packet()

- - -
- -
-
- - - - - - -

new Packet()

- - - - - - -
-

A generic Packet processing object (extended by two subtypes below).

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromHeader(header, transport) → {Packet}

- - - - - - -
-

Attempt to initialize a new Packet based on the incoming packet header -we've received so far. We try each of the types in succession, trying -JSON packets first since they are much more common.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
header - - -string - - - -

Packet header string to attempt parsing.

transport - - -DebuggerTransport - - - -

Transport instance that will own the packet.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Parsed packet of the matching type, or null if no types matched.

-
- - - -
-
- Type -
-
- -Packet - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/Response.html b/testing/marionette/doc/api/Response.html deleted file mode 100644 --- a/testing/marionette/doc/api/Response.html +++ /dev/null @@ -1,671 +0,0 @@ - - - - - JSDoc: Class: Response - - - - - - - - - - -
- -

Class: Response

- - - - - - -
- -
- -

Response(msgID, respHandler)

- -

Represents the response returned from the remote end after execution -of its corresponding command.

-

The response is a mutable object passed to each command for -modification through the available setters. To send data in a response, -you modify the body property on the response. The body property can -also be replaced completely.

-

The response is sent implicitly by CommandProcessor when a command -has finished executing, and any modifications made subsequent to that -will have no effect.

- - -
- -
-
- - - - -

Constructor

- - - -

new Response(msgID, respHandler)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
msgID - - -number - - - -

Message ID tied to the corresponding command request this is a - response for.

respHandler - - -ResponseHandler - - - -

Function callback called on sending the response.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

send()

- - - - - - -
-

Sends response using the response handler provided on construction.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If the response has already been sent.

-
-
-
-
-
-
- Type -
-
- -RangeError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

sendConditionally(predicate)

- - - - - - -
-

Sends response conditionally, given a predicate.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
predicate - - -function - - - -

A predicate taking a Response object and returning a boolean.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

sendError(err)

- - - - - - -
-

Send given Error to client.

-

Turns the response into an error response, clears any previously -set body data, and sends it using the response handler provided -on construction.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
err - - -Error - - - -

The Error instance to send.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If the {@code error} is not a WebDriverError, the error is - propagated.

-
-
-
-
-
-
- Type -
-
- -Error - - -
-
-
-
-
- - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/StreamCopier.html b/testing/marionette/doc/api/StreamCopier.html deleted file mode 100644 --- a/testing/marionette/doc/api/StreamCopier.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - JSDoc: Class: StreamCopier - - - - - - - - - - -
- -

Class: StreamCopier

- - - - - - -
- -
- -

StreamCopier()

- - -
- -
-
- - - - - - -

new StreamCopier()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/WebDriverError.html b/testing/marionette/doc/api/WebDriverError.html deleted file mode 100644 --- a/testing/marionette/doc/api/WebDriverError.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - - JSDoc: Class: WebDriverError - - - - - - - - - - -
- -

Class: WebDriverError

- - - - - - -
- -
- -

WebDriverError(xopt)

- -

WebDriverError is the prototypal parent of all WebDriver errors. -It should not be used directly, as it does not correspond to a real -error in the specification.

- - -
- -
-
- - - - -

Constructor

- - - -

new WebDriverError(xopt)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
x - - -string -| - -Error - - - - - - <optional>
- - - - - -

Optional string describing error situation or Error instance - to propagate.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(json) → {Error}

- - - - - - -
-

Unmarshals a JSON error representation to the appropriate Marionette -error type.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
json - - -Object.<string, string> - - - -

Error object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Error prototype.

-
- - - -
-
- Type -
-
- -Error - - -
-
- - - - - - - - - - - - - -

toJSON() → {Object.<string, string>}

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

JSON serialisation of error prototype.

-
- - - -
-
- Type -
-
- -Object.<string, string> - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/WebElementEventTarget.html b/testing/marionette/doc/api/WebElementEventTarget.html deleted file mode 100644 --- a/testing/marionette/doc/api/WebElementEventTarget.html +++ /dev/null @@ -1,607 +0,0 @@ - - - - - JSDoc: Class: WebElementEventTarget - - - - - - - - - - -
- -

Class: WebElementEventTarget

- - - - - - -
- -
- -

WebElementEventTarget(messageManagerFn)

- -

The EventTarget for web elements can be used to observe DOM -events in the content document.

-

A caveat of the current implementation is that it is only possible -to listen for top-level window global events.

-

It needs to be backed by a ContentEventObserverService in a -content frame script.

-

Usage:

-

-    let observer = new WebElementEventTarget(messageManager);
-    await new Promise(resolve => {
-      observer.addEventListener("visibilitychange", resolve, {once: true});
-      chromeWindow.minimize();
-    });
-
- - -
- -
-
- - - - -

Constructor

- - - -

new WebElementEventTarget(messageManagerFn)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
messageManagerFn - - -function - - - -

Message manager to the current browser.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

addEventListener(type, listener, onceopt)

- - - - - - -
-

Register an event handler of a specific event type from the content -frame.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
type - - -string - - - - - - - - - -

Event type to listen for.

listener - - -EventListener - - - - - - - - - -

Object which receives a notification (a BareEvent) - when an event of the specified type occurs. This must be - an object implementing the EventListener interface, - or a JavaScript function.

once - - -boolean - - - - - - <optional>
- - - - - -

Indicates that the listener should be invoked at - most once after being added. If true, the listener - would automatically be removed when invoked.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

removeEventListener(type, listener)

- - - - - - -
-

Removes an event listener.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
type - - -string - - - -

Type of event to cease listening for.

listener - - -EventListener - - - -

Event handler to remove from the event target.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/accessibility.Checks.html b/testing/marionette/doc/api/accessibility.Checks.html deleted file mode 100644 --- a/testing/marionette/doc/api/accessibility.Checks.html +++ /dev/null @@ -1,2359 +0,0 @@ - - - - - JSDoc: Class: Checks - - - - - - - - - - -
- -

Class: Checks

- - - - - - -
- -
- -

- accessibility.Checks(strict)

- -

Component responsible for interacting with platform accessibility -API.

-

Its methods serve as wrappers for testing content and chrome -accessibility as well as accessibility of user interactions.

- - -
- -
-
- - - - -

Constructor

- - - -

new Checks(strict)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
strict - - -boolean - - - -

Flag indicating whether the accessibility issue should be logged - or cause an error to be thrown. Default is to log to stdout.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

assertActionable(accessible, element)

- - - - - - -
-

Test if it is possible to activate an element with the accessibility -API.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

element - - -DOMElement -| - -XULElement - - - -

Element associated with |accessible|.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

ElementNotAccessibleError - If it is impossible to activate |element| with |accessible|.

- -
- - - - - - - - - - - - - - - - -

assertEnabled(accessible, element, enabled)

- - - - - - -
-

Test if the element's unavailable accessibility state matches the -enabled state.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

element - - -DOMElement -| - -XULElement - - - -

Element associated with |accessible|.

enabled - - -boolean - - - -

Enabled state of |element|.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

ElementNotAccessibleError - If |element|'s enabled state does not match |accessible|'s.

- -
- - - - - - - - - - - - - - - - -

assertSelected(accessible, Element, selected)

- - - - - - -
-

Test that an element's selected state corresponds to its -accessibility API selected state.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

Element - - -DOMElement -| - -XULElement - - - -

associated with |accessible|.

selected - - -boolean - - - -

The |element|s selected state.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

ElementNotAccessibleError - If |element|'s selected state does not correspond to - |accessible|'s.

- -
- - - - - - - - - - - - - - - - -

assertVisible(accessible, element, visible)

- - - - - - -
-

Test if the element's visible state corresponds to its accessibility -API visibility.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

element - - -DOMElement -| - -XULElement - - - -

Element associated with |accessible|.

visible - - -boolean - - - -

Visibility state of |element|.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

ElementNotAccessibleError - If |element|'s visibility state does not correspond to - |accessible|'s.

- -
- - - - - - - - - - - - - - - - -

error(message, element)

- - - - - - -
-

Throw an error if strict accessibility checks are enforced and log -the error to the log.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
message - - -string - - - -
element - - -DOMElement -| - -XULElement - - - -

Element that caused an error.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

ElementNotAccessibleError - If |strict| is true.

- -
- - - - - - - - - - - - - - - - -

getAccessible(element, mustHaveAccessibleopt) → {Promise.<nsIAccessible>}

- - - - - - -
-

Get an accessible object for an element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
element - - -DOMElement -| - -XULElement - - - - - - - - - - - -

Element to get the accessible object for.

mustHaveAccessible - - -boolean - - - - - - <optional>
- - - - - -
- - false - -

Flag indicating that the element must have an accessible object. - Defaults to not require this.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Promise with an accessibility object for the given element.

-
- - - -
-
- Type -
-
- -Promise.<nsIAccessible> - - -
-
- - - - - - - - - - - - - -

hasActionCount(accessible) → {boolean}

- - - - - - -
-

Test if an accessible has at least one action that it supports.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if the accessible has at least one supported action, - false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

hasHiddenAttribute(accessible) → {boolean}

- - - - - - -
-

Test if an accessible has a {@code hidden} attribute.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if the accessible object has a {@code hidden} attribute, - false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

hasValidName(accessible) → {boolean}

- - - - - - -
-

Test if an accessible has a valid name.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if the accessible has a non-empty valid name, or false if - this is not the case.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

isActionableRole(accessible) → {boolean}

- - - - - - -
-

Test if the accessible has a role that supports some arbitrary -action.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if an actionable role is found on the accessible, false - otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

isHidden(accessible) → {boolean}

- - - - - - -
-

Test if an accessible is hidden from the user.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if element is hidden from user, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

matchState(accessible, stateToMatch) → {boolean}

- - - - - - -
-

Verify if an accessible has a given state. -Test if an accessible has a given state.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
accessible - - -nsIAccessible - - - -

Accessible object to test.

stateToMatch - - -number - - - -

State to match.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |accessible| has |stateToMatch|, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/accessibility.html b/testing/marionette/doc/api/accessibility.html deleted file mode 100644 --- a/testing/marionette/doc/api/accessibility.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - JSDoc: Namespace: accessibility - - - - - - - - - - -
- -

Namespace: accessibility

- - - - - - -
- -
- -

accessibility

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Checks
-
-
- - - - - - - - - -

Members

- - - -

(static) ActionableRoles

- - - - -
-

Accessible object roles that support some action.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

(static) State

- - - - -
-

Accessible states used to check element"s state from the accessiblity API -perspective.

-

Note: if gecko is built with --disable-accessibility, the interfaces -are not defined. This is why we use getters instead to be able to use -these statically.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -

Methods

- - - - - - - -

(static) get()

- - - - - - -
-

Factory function that constructs a new {@code accessibility.Checks} -object with enforced strictness or not.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/accessibility.js.html b/testing/marionette/doc/api/accessibility.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/accessibility.js.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - - JSDoc: Source: accessibility.js - - - - - - - - - - -
- -

Source: accessibility.js

- - - - - - -
-
-
/* 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";
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-
-const logger = Log.repository.getLogger("Marionette");
-
-const {ElementNotAccessibleError} =
-    Cu.import("chrome://marionette/content/error.js", {});
-
-XPCOMUtils.defineLazyModuleGetter(
-    this, "setInterval", "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(
-    this, "clearInterval", "resource://gre/modules/Timer.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "service", () => {
-  try {
-    return Cc["@mozilla.org/accessibilityService;1"]
-        .getService(Ci.nsIAccessibilityService);
-  } catch (e) {
-    logger.warn("Accessibility module is not present");
-    return undefined;
-  }
-});
-
-this.EXPORTED_SYMBOLS = ["accessibility"];
-
-/** @namespace */
-this.accessibility = {
-  get service() {
-    return service;
-  },
-};
-
-/**
- * Accessible states used to check element"s state from the accessiblity API
- * perspective.
- *
- * Note: if gecko is built with --disable-accessibility, the interfaces
- * are not defined. This is why we use getters instead to be able to use
- * these statically.
- */
-accessibility.State = {
-  get Unavailable() {
-    return Ci.nsIAccessibleStates.STATE_UNAVAILABLE;
-  },
-  get Focusable() {
-    return Ci.nsIAccessibleStates.STATE_FOCUSABLE;
-  },
-  get Selectable() {
-    return Ci.nsIAccessibleStates.STATE_SELECTABLE;
-  },
-  get Selected() {
-    return Ci.nsIAccessibleStates.STATE_SELECTED;
-  },
-};
-
-/**
- * Accessible object roles that support some action.
- */
-accessibility.ActionableRoles = new Set([
-  "checkbutton",
-  "check menu item",
-  "check rich option",
-  "combobox",
-  "combobox option",
-  "entry",
-  "key",
-  "link",
-  "listbox option",
-  "listbox rich option",
-  "menuitem",
-  "option",
-  "outlineitem",
-  "pagetab",
-  "pushbutton",
-  "radiobutton",
-  "radio menu item",
-  "rowheader",
-  "slider",
-  "spinbutton",
-  "switch",
-]);
-
-
-/**
- * Factory function that constructs a new {@code accessibility.Checks}
- * object with enforced strictness or not.
- */
-accessibility.get = function(strict = false) {
-  return new accessibility.Checks(!!strict);
-};
-
-/**
- * Component responsible for interacting with platform accessibility
- * API.
- *
- * Its methods serve as wrappers for testing content and chrome
- * accessibility as well as accessibility of user interactions.
- */
-accessibility.Checks = class {
-
-  /**
-   * @param {boolean} strict
-   *     Flag indicating whether the accessibility issue should be logged
-   *     or cause an error to be thrown.  Default is to log to stdout.
-   */
-  constructor(strict) {
-    this.strict = strict;
-  }
-
-  /**
-   * Get an accessible object for an element.
-   *
-   * @param {DOMElement|XULElement} element
-   *     Element to get the accessible object for.
-   * @param {boolean=} mustHaveAccessible
-   *     Flag indicating that the element must have an accessible object.
-   *     Defaults to not require this.
-   *
-   * @return {Promise.<nsIAccessible>}
-   *     Promise with an accessibility object for the given element.
-   */
-  getAccessible(element, mustHaveAccessible = false) {
-    if (!this.strict) {
-      return Promise.resolve();
-    }
-
-    return new Promise((resolve, reject) => {
-      if (!accessibility.service) {
-        reject();
-        return;
-      }
-
-      // First, check if accessibility is ready.
-      let docAcc = accessibility.service
-          .getAccessibleFor(element.ownerDocument);
-      let state = {};
-      docAcc.getState(state, {});
-      if ((state.value & Ci.nsIAccessibleStates.STATE_BUSY) == 0) {
-        // Accessibility is ready, resolve immediately.
-        let acc = accessibility.service.getAccessibleFor(element);
-        if (mustHaveAccessible && !acc) {
-          reject();
-        } else {
-          resolve(acc);
-        }
-        return;
-      }
-      // Accessibility for the doc is busy, so wait for the state to change.
-      let eventObserver = {
-        observe(subject, topic, data) {
-          if (topic !== "accessible-event") {
-            return;
-          }
-
-          // If event type does not match expected type, skip the event.
-          let event = subject.QueryInterface(Ci.nsIAccessibleEvent);
-          if (event.eventType !== Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE) {
-            return;
-          }
-
-          // If event's accessible does not match expected accessible,
-          // skip the event.
-          if (event.accessible !== docAcc) {
-            return;
-          }
-
-          Services.obs.removeObserver(this, "accessible-event");
-          let acc = accessibility.service.getAccessibleFor(element);
-          if (mustHaveAccessible && !acc) {
-            reject();
-          } else {
-            resolve(acc);
-          }
-        },
-      };
-      Services.obs.addObserver(eventObserver, "accessible-event");
-    }).catch(() => this.error(
-        "Element does not have an accessible object", element));
-  }
-
-  /**
-   * Test if the accessible has a role that supports some arbitrary
-   * action.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   *
-   * @return {boolean}
-   *     True if an actionable role is found on the accessible, false
-   *     otherwise.
-   */
-  isActionableRole(accessible) {
-    return accessibility.ActionableRoles.has(
-        accessibility.service.getStringRole(accessible.role));
-  }
-
-  /**
-   * Test if an accessible has at least one action that it supports.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   *
-   * @return {boolean}
-   *     True if the accessible has at least one supported action,
-   *     false otherwise.
-   */
-  hasActionCount(accessible) {
-    return accessible.actionCount > 0;
-  }
-
-  /**
-   * Test if an accessible has a valid name.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   *
-   * @return {boolean}
-   *     True if the accessible has a non-empty valid name, or false if
-   *     this is not the case.
-   */
-  hasValidName(accessible) {
-    return accessible.name && accessible.name.trim();
-  }
-
-  /**
-   * Test if an accessible has a {@code hidden} attribute.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   *
-   * @return {boolean}
-   *     True if the accessible object has a {@code hidden} attribute,
-   *     false otherwise.
-   */
-  hasHiddenAttribute(accessible) {
-    let hidden = false;
-    try {
-      hidden = accessible.attributes.getStringProperty("hidden");
-    } catch (e) {}
-    // if the property is missing, error will be thrown
-    return hidden && hidden === "true";
-  }
-
-  /**
-   * Verify if an accessible has a given state.
-   * Test if an accessible has a given state.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object to test.
-   * @param {number} stateToMatch
-   *     State to match.
-   *
-   * @return {boolean}
-   *     True if |accessible| has |stateToMatch|, false otherwise.
-   */
-  matchState(accessible, stateToMatch) {
-    let state = {};
-    accessible.getState(state, {});
-    return !!(state.value & stateToMatch);
-  }
-
-  /**
-   * Test if an accessible is hidden from the user.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   *
-   * @return {boolean}
-   *     True if element is hidden from user, false otherwise.
-   */
-  isHidden(accessible) {
-    while (accessible) {
-      if (this.hasHiddenAttribute(accessible)) {
-        return true;
-      }
-      accessible = accessible.parent;
-    }
-    return false;
-  }
-
-  /**
-   * Test if the element's visible state corresponds to its accessibility
-   * API visibility.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   * @param {DOMElement|XULElement} element
-   *     Element associated with |accessible|.
-   * @param {boolean} visible
-   *     Visibility state of |element|.
-   *
-   * @throws ElementNotAccessibleError
-   *     If |element|'s visibility state does not correspond to
-   *     |accessible|'s.
-   */
-  assertVisible(accessible, element, visible) {
-    if (!accessible) {
-      return;
-    }
-
-    let hiddenAccessibility = this.isHidden(accessible);
-
-    let message;
-    if (visible && hiddenAccessibility) {
-      message = "Element is not currently visible via the accessibility API " +
-          "and may not be manipulated by it";
-    } else if (!visible && !hiddenAccessibility) {
-      message = "Element is currently only visible via the accessibility API " +
-          "and can be manipulated by it";
-    }
-    this.error(message, element);
-  }
-
-  /**
-   * Test if the element's unavailable accessibility state matches the
-   * enabled state.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   * @param {DOMElement|XULElement} element
-   *     Element associated with |accessible|.
-   * @param {boolean} enabled
-   *     Enabled state of |element|.
-   *
-   * @throws ElementNotAccessibleError
-   *     If |element|'s enabled state does not match |accessible|'s.
-   */
-  assertEnabled(accessible, element, enabled) {
-    if (!accessible) {
-      return;
-    }
-
-    let win = element.ownerGlobal;
-    let disabledAccessibility = this.matchState(
-        accessible, accessibility.State.Unavailable);
-    let explorable = win.getComputedStyle(element)
-        .getPropertyValue("pointer-events") !== "none";
-
-    let message;
-    if (!explorable && !disabledAccessibility) {
-      message = "Element is enabled but is not explorable via the " +
-          "accessibility API";
-    } else if (enabled && disabledAccessibility) {
-      message = "Element is enabled but disabled via the accessibility API";
-    } else if (!enabled && !disabledAccessibility) {
-      message = "Element is disabled but enabled via the accessibility API";
-    }
-    this.error(message, element);
-  }
-
-  /**
-   * Test if it is possible to activate an element with the accessibility
-   * API.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   * @param {DOMElement|XULElement} element
-   *     Element associated with |accessible|.
-   *
-   * @throws ElementNotAccessibleError
-   *     If it is impossible to activate |element| with |accessible|.
-   */
-  assertActionable(accessible, element) {
-    if (!accessible) {
-      return;
-    }
-
-    let message;
-    if (!this.hasActionCount(accessible)) {
-      message = "Element does not support any accessible actions";
-    } else if (!this.isActionableRole(accessible)) {
-      message = "Element does not have a correct accessibility role " +
-          "and may not be manipulated via the accessibility API";
-    } else if (!this.hasValidName(accessible)) {
-      message = "Element is missing an accessible name";
-    } else if (!this.matchState(accessible, accessibility.State.Focusable)) {
-      message = "Element is not focusable via the accessibility API";
-    }
-
-    this.error(message, element);
-  }
-
-  /**
-   * Test that an element's selected state corresponds to its
-   * accessibility API selected state.
-   *
-   * @param {nsIAccessible} accessible
-   *     Accessible object.
-   * @param {DOMElement|XULElement}
-   *     Element associated with |accessible|.
-   * @param {boolean} selected
-   *     The |element|s selected state.
-   *
-   * @throws ElementNotAccessibleError
-   *     If |element|'s selected state does not correspond to
-   *     |accessible|'s.
-   */
-  assertSelected(accessible, element, selected) {
-    if (!accessible) {
-      return;
-    }
-
-    // element is not selectable via the accessibility API
-    if (!this.matchState(accessible, accessibility.State.Selectable)) {
-      return;
-    }
-
-    let selectedAccessibility =
-        this.matchState(accessible, accessibility.State.Selected);
-
-    let message;
-    if (selected && !selectedAccessibility) {
-      message = "Element is selected but not selected via the accessibility API";
-    } else if (!selected && selectedAccessibility) {
-      message = "Element is not selected but selected via the accessibility API";
-    }
-    this.error(message, element);
-  }
-
-  /**
-   * Throw an error if strict accessibility checks are enforced and log
-   * the error to the log.
-   *
-   * @param {string} message
-   * @param {DOMElement|XULElement} element
-   *     Element that caused an error.
-   *
-   * @throws ElementNotAccessibleError
-   *     If |strict| is true.
-   */
-  error(message, element) {
-    if (!message || !this.strict) {
-      return;
-    }
-    if (element) {
-      let {id, tagName, className} = element;
-      message += `: id: ${id}, tagName: ${tagName}, className: ${className}`;
-    }
-
-    throw new ElementNotAccessibleError(message);
-  }
-
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/action.Action.html b/testing/marionette/doc/api/action.Action.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.Action.html +++ /dev/null @@ -1,534 +0,0 @@ - - - - - JSDoc: Class: Action - - - - - - - - - - -
- -

Class: Action

- - - - - - -
- -
- -

- action.Action(id, type, subtype)

- -

Repesents an action for dispatch. Used in |action.Chain| and -|action.Sequence|.

- - -
- -
-
- - - - -

Constructor

- - - -

new Action(id, type, subtype)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Input source ID.

type - - -string - - - -

Action type: none, key, pointer.

subtype - - -string - - - -

Action subtype: action.Pause, action.KeyUp, - action.KeyDown, action.PointerUp, - action.PointerDown, action.PointerMove, or - action.PointerCancel.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If any parameters are undefined.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(actionSequence, actionItem) → {action.Action}

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
actionSequence - - -action.Sequence - - - -

Object representing sequence of actions from one input source.

actionItem - - -action.Action - - - -

Object representing a single action from |actionSequence|.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If any actionSequence or actionItem - attributes are invalid.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -InvalidArgumentError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If actionItem.type is action.PointerCancel.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -UnsupportedOperationError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

An action that can be dispatched; corresponds to |actionItem|.

-
- - - -
-
- Type -
-
- -action.Action - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.InputState.Key.html b/testing/marionette/doc/api/action.InputState.Key.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.InputState.Key.html +++ /dev/null @@ -1,831 +0,0 @@ - - - - - JSDoc: Class: Key - - - - - - - - - - -
- -

Class: Key

- - - - - - -
- -
- -

- action.InputState.Key()

- -

Input state associated with a keyboard-type device.

- - -
- -
-
- - - - -

Constructor

- - - -

new Key()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

isPressed(key) → {boolean}

- - - - - - -
-

Check whether |key| is pressed.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - -

Normalized key value.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |key| is in set of pressed keys.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

press(key) → {boolean}

- - - - - - -
-

Add |key| to the set of pressed keys.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - -

Normalized key value.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |key| is in list of pressed keys.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

release(key) → {boolean}

- - - - - - -
-

Remove |key| from the set of pressed keys.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - -

Normalized key value.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |key| was present before removal, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

setModState(key, value)

- - - - - - -
-

Update modifier state according to |key|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - -string - - - -

Normalized key value of a modifier key.

value - - -boolean - - - -

Value to set the modifier attribute to.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |key| is not a modifier.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.InputState.Null.html b/testing/marionette/doc/api/action.InputState.Null.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.InputState.Null.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - JSDoc: Class: Null - - - - - - - - - - -
- -

Class: Null

- - - - - - -
- -
- -

- action.InputState.Null()

- -

Input state not associated with a specific physical device.

- - -
- -
-
- - - - -

Constructor

- - - -

new Null()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.InputState.Pointer.html b/testing/marionette/doc/api/action.InputState.Pointer.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.InputState.Pointer.html +++ /dev/null @@ -1,722 +0,0 @@ - - - - - JSDoc: Class: Pointer - - - - - - - - - - -
- -

Class: Pointer

- - - - - - -
- -
- -

- action.InputState.Pointer(subtype)

- -

Input state associated with a pointer-type input device.

- - -
- -
-
- - - - -

Constructor

- - - -

new Pointer(subtype)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
subtype - - -string - - - -

Kind of pointing device: mouse, pen, touch.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If subtype is undefined or an invalid pointer type.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

isPressed(button) → {boolean}

- - - - - - -
-

Check whether |button| is pressed.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
button - - -number - - - -

Positive integer that refers to a mouse button.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |button| is in set of pressed buttons.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

press(button) → {Set}

- - - - - - -
-

Add |button| to the set of pressed keys.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
button - - -number - - - -

Positive integer that refers to a mouse button.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Set of pressed buttons.

-
- - - -
-
- Type -
-
- -Set - - -
-
- - - - - - - - - - - - - -

release(button) → {boolean}

- - - - - - -
-

Remove |button| from the set of pressed buttons.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
button - - -number - - - -

A positive integer that refers to a mouse button.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if |button| was present before removals, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.Key.html b/testing/marionette/doc/api/action.Key.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.Key.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - JSDoc: Class: Key - - - - - - - - - - -
- -

Class: Key

- - - - - - -
- -
- -

- action.Key()

- -

Collect properties associated with KeyboardEvent

- - -
- -
-
- - - - -

Constructor

- - - -

new Key()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.Mouse.html b/testing/marionette/doc/api/action.Mouse.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.Mouse.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - JSDoc: Class: Mouse - - - - - - - - - - -
- -

Class: Mouse

- - - - - - -
- -
- -

- action.Mouse()

- -

Collect properties associated with MouseEvent

- - -
- -
-
- - - - -

Constructor

- - - -

new Mouse()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.PointerParameters.html b/testing/marionette/doc/api/action.PointerParameters.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.PointerParameters.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - JSDoc: Class: PointerParameters - - - - - - - - - - -
- -

Class: PointerParameters

- - - - - - -
- -
- -

- action.PointerParameters(pointerTypeopt)

- -

Represents parameters in an action for a pointer input source.

- - -
- -
-
- - - - -

Constructor

- - - -

new PointerParameters(pointerTypeopt)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
pointerType - - -string - - - - - - <optional>
- - - - - -

Type of pointing device. If the parameter is undefined, "mouse" - is used.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(parametersData) → {action.PointerParameters}

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
parametersData - - -Object.<string, ?> - - - -

Object that represents pointer parameters.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Validated pointer paramters.

-
- - - -
-
- Type -
-
- -action.PointerParameters - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.Sequence.html b/testing/marionette/doc/api/action.Sequence.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.Sequence.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - JSDoc: Class: Sequence - - - - - - - - - - -
- -

Class: Sequence

- - - - - - -
- -
- -

- action.Sequence()

- -

Represents one input source action sequence; this is essentially an -|Array.|.

- - -
- -
-
- - - - -

Constructor

- - - -

new Sequence()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(actionSequence) → {action.Sequence}

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
actionSequence - - -Object.<string, ?> - - - -

Object that represents a sequence action items for one input source.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If actionSequence.id is not a - string or it's aleady mapped to an |action.InputState} - incompatible with actionSequence.type, or if - actionSequence.actions is not an Array.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Sequence of actions that can be dispatched.

-
- - - -
-
- Type -
-
- -action.Sequence - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.html b/testing/marionette/doc/api/action.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.html +++ /dev/null @@ -1,1607 +0,0 @@ - - - - - JSDoc: Namespace: action - - - - - - - - - - -
- -

Namespace: action

- - - - - - -
- -
- -

action

- - -
- -
-
- - -

Implements WebDriver Actions API: a low-level interface for providing -virtualised device input to the web browser.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Action
-
- -
Chain
-
- -
Key
-
- -
Mouse
-
- -
PointerParameters
-
- -
Sequence
-
-
- - - - - - - - - -

Members

- - - -

(static) InputState

- - - - -
-

Possible kinds of |InputState| for supported input sources.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

(static) inputStateMap

- - - - -
-

Input state associated with current session. This is a map between -input ID and the device state for that input source, with one entry -for each active input source.

-

Initialized in listener.js.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

(static) inputsToCancel

- - - - -
-

List of action.Action associated with current session. Used to -manage dispatching events when resetting the state of the input sources. -Reset operations are assumed to be idempotent.

-

Initialized in listener.js

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

(static) PointerOrigin

- - - - -
-

Represents possible values for a pointer-move origin.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

(static) PointerType

- - - - -
-

Represents possible subtypes for a pointer input source.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -

Methods

- - - - - - - -

(static) Chain()

- - - - - - -
-

Functionality for (single finger) action chains.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

(static) computePointerDestination(a, inputState, centeropt) → {Map.<string, number>}

- - - - - - -
-

Compute viewport coordinates of pointer target based on given origin.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
a - - -action.Action - - - - - - - - - -

Action that specifies pointer origin and x and y coordinates of target.

inputState - - -action.InputState - - - - - - - - - -

Input state that specifies current x and y coordinates of pointer.

center - - -Map.<string, number> - - - - - - <optional>
- - - - - -

Object representing x and y coordinates of an element center-point. - This is only used if |a.origin| is a web element reference.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

x and y coordinates of pointer destination.

-
- - - -
-
- Type -
-
- -Map.<string, number> - - -
-
- - - - - - - - - - - - - -

(static) computeTickDuration(tickActions) → {number}

- - - - - - -
-

Compute tick duration in milliseconds for a collection of actions.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
tickActions - - -Array.<action.Action> - - - -

List of actions for one tick.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Longest action duration in |tickActions| if any, or 0.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

(static) dispatch(chain, seenEls, window) → {Promise}

- - - - - - -
-

Dispatch a chain of actions over |chain.length| ticks.

-

This is done by creating a Promise for each tick that resolves once -all the Promises for individual tick-actions are resolved. The next -tick's actions are not dispatched until the Promise for the current -tick is resolved.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chain - - -action.Chain - - - -

Actions grouped by tick; each element in |chain| is a sequence of - actions for one tick.

seenEls - - -element.Store - - - -

Element store.

window - - -WindowProxy - - - -

Current window global.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Promise for dispatching all actions in |chain|.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -

(static) dispatchTickActions(tickActions, tickDuration, seenEls, window) → {Promise}

- - - - - - -
-

Dispatch sequence of actions for one tick.

-

This creates a Promise for one tick that resolves once the Promise -for each tick-action is resolved, which takes at least |tickDuration| -milliseconds. The resolved set of events for each tick is followed by -firing of pending DOM events.

-

Note that the tick-actions are dispatched in order, but they may have -different durations and therefore may not end in the same order.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
tickActions - - -Array.<action.Action> - - - -

List of actions for one tick.

tickDuration - - -number - - - -

Duration in milliseconds of this tick.

seenEls - - -element.Store - - - -

Element store.

window - - -WindowProxy - - - -

Current window global.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Promise for dispatching all tick-actions and pending DOM events.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -

(static) processPointerAction(id, pointerParams, act)

- - - - - - -
-

Adds pointerType attribute to Action act.

-

Helper function for action.Action.fromJSON.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Input source ID.

pointerParams - - -action.PointerParams - - - -

Input source pointer parameters.

act - - -action.Action - - - -

Action to be updated.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If id is already mapped to an - action.InputState that is not compatible with - act.type or pointerParams.pointerType.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.html#.Chain b/testing/marionette/doc/api/action.html#.Chain deleted file mode 100644 --- a/testing/marionette/doc/api/action.html#.Chain +++ /dev/null @@ -1,1187 +0,0 @@ - - - - - JSDoc: Class: Chain - - - - - - - - - - -
- -

Class: Chain

- - - - - - -
- -
- -

- action.Chain()

- -

Represents a series of ticks, specifying which actions to perform at -each tick.

- - -
- -
-
- - - - -

Constructor

- - - -

new Chain()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) fromJSON(actions) → {action.Chain}

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
actions - - -Array.<?> - - - -

Array of objects that each represent an action sequence.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If actions is not an Array.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Transpose of actions such that actions to be performed - in a single tick are grouped together.

-
- - - -
-
- Type -
-
- -action.Chain - - -
-
- - - - - - - - - - - - - -

actions(chain, touchId, i, keyModifiers, cb) → {Object.<string, number>}

- - - - - - -
-

Emit events for each action in the provided chain.

-

To emit touch events for each finger, one might send a [["press", id], -["wait", 5], ["release"]] chain.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
chain - - -Array.<Array.<?>> - - - -

A multi-dimensional array of actions.

touchId - - -Object.<string, number> - - - -

Represents the finger ID.

i - - -number - - - -

Keeps track of the current action of the chain.

keyModifiers - - -Object.<string, boolean> - - - -

Keeps track of keyDown/keyUp pairs through an action chain.

cb - - -function - - - -

Called on success.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Last finger ID, or an empty object.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

emitMouseEvent(doc, type, clickCount, elClientX, elClientY, modifiers)

- - - - - - -
-

This function emit mouse event.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
doc - - -Document - - - -

Current document.

type - - -string - - - -

Type of event to dispatch.

clickCount - - -number - - - -

Number of clicks, button notes the mouse button.

elClientX - - -number - - - -

X coordinate of the mouse relative to the viewport.

elClientY - - -number - - - -

Y coordinate of the mouse relative to the viewport.

modifiers - - -Object - - - -

An object of modifier keys present.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

generateEvents(x, y)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
x - - -number - - - -

X coordinate of the location to generate the event that is relative - to the viewport.

y - - -number - - - -

Y coordinate of the location to generate the event that is relative - to the viewport.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getCoordinateInfo()

- - - - - - -
-

Given an element and a pair of coordinates, returns an array of the -form [clientX, clientY, pageX, pageY, screenX, screenY].

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

resetValues()

- - - - - - -
-

Reset any persisted values after a command completes.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/action.js.html b/testing/marionette/doc/api/action.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/action.js.html +++ /dev/null @@ -1,1490 +0,0 @@ - - - - - JSDoc: Source: action.js - - - - - - - - - - -
- -

Source: action.js

- - - - - - -
-
-
/* 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/. */
-
-/* eslint no-dupe-keys:off */
-
-"use strict";
-
-Cu.import("chrome://marionette/content/assert.js");
-Cu.import("chrome://marionette/content/element.js");
-const {
-  pprint,
-  InvalidArgumentError,
-  MoveTargetOutOfBoundsError,
-  UnsupportedOperationError,
-} = Cu.import("chrome://marionette/content/error.js", {});
-Cu.import("chrome://marionette/content/event.js");
-Cu.import("chrome://marionette/content/interaction.js");
-
-this.EXPORTED_SYMBOLS = ["action"];
-
-// TODO? With ES 2016 and Symbol you can make a safer approximation
-// to an enum e.g. https://gist.github.com/xmlking/e86e4f15ec32b12c4689
-/**
- * Implements WebDriver Actions API: a low-level interface for providing
- * virtualised device input to the web browser.
- *
- * @namespace
- */
-this.action = {
-  Pause: "pause",
-  KeyDown: "keyDown",
-  KeyUp: "keyUp",
-  PointerDown: "pointerDown",
-  PointerUp: "pointerUp",
-  PointerMove: "pointerMove",
-  PointerCancel: "pointerCancel",
-};
-
-const ACTIONS = {
-  none: new Set([action.Pause]),
-  key: new Set([action.Pause, action.KeyDown, action.KeyUp]),
-  pointer: new Set([
-    action.Pause,
-    action.PointerDown,
-    action.PointerUp,
-    action.PointerMove,
-    action.PointerCancel,
-  ]),
-};
-
-/** Map from normalized key value to UI Events modifier key name */
-const MODIFIER_NAME_LOOKUP = {
-  "Alt": "alt",
-  "Shift": "shift",
-  "Control": "ctrl",
-  "Meta": "meta",
-};
-
-/** Map from raw key (codepoint) to normalized key value */
-const NORMALIZED_KEY_LOOKUP = {
-  "\uE000": "Unidentified",
-  "\uE001": "Cancel",
-  "\uE002": "Help",
-  "\uE003": "Backspace",
-  "\uE004": "Tab",
-  "\uE005": "Clear",
-  "\uE006": "Enter",
-  "\uE007": "Enter",
-  "\uE008": "Shift",
-  "\uE009": "Control",
-  "\uE00A": "Alt",
-  "\uE00B": "Pause",
-  "\uE00C": "Escape",
-  "\uE00D": " ",
-  "\uE00E": "PageUp",
-  "\uE00F": "PageDown",
-  "\uE010": "End",
-  "\uE011": "Home",
-  "\uE012": "ArrowLeft",
-  "\uE013": "ArrowUp",
-  "\uE014": "ArrowRight",
-  "\uE015": "ArrowDown",
-  "\uE016": "Insert",
-  "\uE017": "Delete",
-  "\uE018": ";",
-  "\uE019": "=",
-  "\uE01A": "0",
-  "\uE01B": "1",
-  "\uE01C": "2",
-  "\uE01D": "3",
-  "\uE01E": "4",
-  "\uE01F": "5",
-  "\uE020": "6",
-  "\uE021": "7",
-  "\uE022": "8",
-  "\uE023": "9",
-  "\uE024": "*",
-  "\uE025": "+",
-  "\uE026": ",",
-  "\uE027": "-",
-  "\uE028": ".",
-  "\uE029": "/",
-  "\uE031": "F1",
-  "\uE032": "F2",
-  "\uE033": "F3",
-  "\uE034": "F4",
-  "\uE035": "F5",
-  "\uE036": "F6",
-  "\uE037": "F7",
-  "\uE038": "F8",
-  "\uE039": "F9",
-  "\uE03A": "F10",
-  "\uE03B": "F11",
-  "\uE03C": "F12",
-  "\uE03D": "Meta",
-  "\uE040": "ZenkakuHankaku",
-  "\uE050": "Shift",
-  "\uE051": "Control",
-  "\uE052": "Alt",
-  "\uE053": "Meta",
-  "\uE054": "PageUp",
-  "\uE055": "PageDown",
-  "\uE056": "End",
-  "\uE057": "Home",
-  "\uE058": "ArrowLeft",
-  "\uE059": "ArrowUp",
-  "\uE05A": "ArrowRight",
-  "\uE05B": "ArrowDown",
-  "\uE05C": "Insert",
-  "\uE05D": "Delete",
-};
-
-/** Map from raw key (codepoint) to key location */
-const KEY_LOCATION_LOOKUP = {
-  "\uE007": 1,
-  "\uE008": 1,
-  "\uE009": 1,
-  "\uE00A": 1,
-  "\uE01A": 3,
-  "\uE01B": 3,
-  "\uE01C": 3,
-  "\uE01D": 3,
-  "\uE01E": 3,
-  "\uE01F": 3,
-  "\uE020": 3,
-  "\uE021": 3,
-  "\uE022": 3,
-  "\uE023": 3,
-  "\uE024": 3,
-  "\uE025": 3,
-  "\uE026": 3,
-  "\uE027": 3,
-  "\uE028": 3,
-  "\uE029": 3,
-  "\uE03D": 1,
-  "\uE050": 2,
-  "\uE051": 2,
-  "\uE052": 2,
-  "\uE053": 2,
-  "\uE054": 3,
-  "\uE055": 3,
-  "\uE056": 3,
-  "\uE057": 3,
-  "\uE058": 3,
-  "\uE059": 3,
-  "\uE05A": 3,
-  "\uE05B": 3,
-  "\uE05C": 3,
-  "\uE05D": 3,
-};
-
-const KEY_CODE_LOOKUP = {
-  "\uE00A": "AltLeft",
-  "\uE052": "AltRight",
-  "\uE015": "ArrowDown",
-  "\uE012": "ArrowLeft",
-  "\uE014": "ArrowRight",
-  "\uE013": "ArrowUp",
-  "`": "Backquote",
-  "~": "Backquote",
-  "\\": "Backslash",
-  "|": "Backslash",
-  "\uE003": "Backspace",
-  "[": "BracketLeft",
-  "{": "BracketLeft",
-  "]": "BracketRight",
-  "}": "BracketRight",
-  ",": "Comma",
-  "<": "Comma",
-  "\uE009": "ControlLeft",
-  "\uE051": "ControlRight",
-  "\uE017": "Delete",
-  ")": "Digit0",
-  "0": "Digit0",
-  "!": "Digit1",
-  "1": "Digit1",
-  "2": "Digit2",
-  "@": "Digit2",
-  "#": "Digit3",
-  "3": "Digit3",
-  "$": "Digit4",
-  "4": "Digit4",
-  "%": "Digit5",
-  "5": "Digit5",
-  "6": "Digit6",
-  "^": "Digit6",
-  "&": "Digit7",
-  "7": "Digit7",
-  "*": "Digit8",
-  "8": "Digit8",
-  "(": "Digit9",
-  "9": "Digit9",
-  "\uE010": "End",
-  "\uE006": "Enter",
-  "+": "Equal",
-  "=": "Equal",
-  "\uE00C": "Escape",
-  "\uE031": "F1",
-  "\uE03A": "F10",
-  "\uE03B": "F11",
-  "\uE03C": "F12",
-  "\uE032": "F2",
-  "\uE033": "F3",
-  "\uE034": "F4",
-  "\uE035": "F5",
-  "\uE036": "F6",
-  "\uE037": "F7",
-  "\uE038": "F8",
-  "\uE039": "F9",
-  "\uE002": "Help",
-  "\uE011": "Home",
-  "\uE016": "Insert",
-  "<": "IntlBackslash",
-  ">": "IntlBackslash",
-  "A": "KeyA",
-  "a": "KeyA",
-  "B": "KeyB",
-  "b": "KeyB",
-  "C": "KeyC",
-  "c": "KeyC",
-  "D": "KeyD",
-  "d": "KeyD",
-  "E": "KeyE",
-  "e": "KeyE",
-  "F": "KeyF",
-  "f": "KeyF",
-  "G": "KeyG",
-  "g": "KeyG",
-  "H": "KeyH",
-  "h": "KeyH",
-  "I": "KeyI",
-  "i": "KeyI",
-  "J": "KeyJ",
-  "j": "KeyJ",
-  "K": "KeyK",
-  "k": "KeyK",
-  "L": "KeyL",
-  "l": "KeyL",
-  "M": "KeyM",
-  "m": "KeyM",
-  "N": "KeyN",
-  "n": "KeyN",
-  "O": "KeyO",
-  "o": "KeyO",
-  "P": "KeyP",
-  "p": "KeyP",
-  "Q": "KeyQ",
-  "q": "KeyQ",
-  "R": "KeyR",
-  "r": "KeyR",
-  "S": "KeyS",
-  "s": "KeyS",
-  "T": "KeyT",
-  "t": "KeyT",
-  "U": "KeyU",
-  "u": "KeyU",
-  "V": "KeyV",
-  "v": "KeyV",
-  "W": "KeyW",
-  "w": "KeyW",
-  "X": "KeyX",
-  "x": "KeyX",
-  "Y": "KeyY",
-  "y": "KeyY",
-  "Z": "KeyZ",
-  "z": "KeyZ",
-  "-": "Minus",
-  "_": "Minus",
-  "\uE01A": "Numpad0",
-  "\uE05C": "Numpad0",
-  "\uE01B": "Numpad1",
-  "\uE056": "Numpad1",
-  "\uE01C": "Numpad2",
-  "\uE05B": "Numpad2",
-  "\uE01D": "Numpad3",
-  "\uE055": "Numpad3",
-  "\uE01E": "Numpad4",
-  "\uE058": "Numpad4",
-  "\uE01F": "Numpad5",
-  "\uE020": "Numpad6",
-  "\uE05A": "Numpad6",
-  "\uE021": "Numpad7",
-  "\uE057": "Numpad7",
-  "\uE022": "Numpad8",
-  "\uE059": "Numpad8",
-  "\uE023": "Numpad9",
-  "\uE054": "Numpad9",
-  "\uE024": "NumpadAdd",
-  "\uE026": "NumpadComma",
-  "\uE028": "NumpadDecimal",
-  "\uE05D": "NumpadDecimal",
-  "\uE029": "NumpadDivide",
-  "\uE007": "NumpadEnter",
-  "\uE024": "NumpadMultiply",
-  "\uE026": "NumpadSubtract",
-  "\uE03D": "OSLeft",
-  "\uE053": "OSRight",
-  "\uE01E": "PageDown",
-  "\uE01F": "PageUp",
-  ".": "Period",
-  ">": "Period",
-  "\"": "Quote",
-  "'": "Quote",
-  ":": "Semicolon",
-  ";": "Semicolon",
-  "\uE008": "ShiftLeft",
-  "\uE050": "ShiftRight",
-  "/": "Slash",
-  "?": "Slash",
-  "\uE00D": "Space",
-  "  ": "Space",
-  "\uE004": "Tab",
-};
-
-/** Represents possible values for a pointer-move origin. */
-action.PointerOrigin = {
-  Viewport: "viewport",
-  Pointer: "pointer",
-};
-
-/**
- * Look up a PointerOrigin.
- *
- * @param {(undefined|string|WebElement)} obj
- *     Origin for a pointerMove action.
- *
- * @return {action.PointerOrigin}
- *     A pointer origin that is either "viewport" (default), "pointer", or a
- *     web-element reference.
- *
- * @throws {InvalidArgumentError}
- *     If <code>obj</code> is not a valid origin.
- */
-action.PointerOrigin.get = function(obj) {
-  let origin = obj;
-  if (typeof obj == "undefined") {
-    origin = this.Viewport;
-  } else if (typeof obj == "string") {
-    let name = capitalize(obj);
-    assert.in(name, this, pprint`Unknown pointer-move origin: ${obj}`);
-    origin = this[name];
-  } else if (!element.isWebElementReference(obj)) {
-    throw new InvalidArgumentError("Expected 'origin' to be a string or a " +
-      pprint`web element reference, got ${obj}`);
-  }
-  return origin;
-};
-
-/** Represents possible subtypes for a pointer input source. */
-action.PointerType = {
-  Mouse: "mouse",
-  // TODO For now, only mouse is supported
-  //Pen: "pen",
-  //Touch: "touch",
-};
-
-/**
- * Look up a PointerType.
- *
- * @param {string} str
- *     Name of pointer type.
- *
- * @return {string}
- *     A pointer type for processing pointer parameters.
- *
- * @throws {InvalidArgumentError}
- *     If <code>str</code> is not a valid pointer type.
- */
-action.PointerType.get = function(str) {
-  let name = capitalize(str);
-  assert.in(name, this, pprint`Unknown pointerType: ${str}`);
-  return this[name];
-};
-
-/**
- * Input state associated with current session.  This is a map between
- * input ID and the device state for that input source, with one entry
- * for each active input source.
- *
- * Initialized in listener.js.
- */
-action.inputStateMap = undefined;
-
-/**
- * List of {@link action.Action} associated with current session.  Used to
- * manage dispatching events when resetting the state of the input sources.
- * Reset operations are assumed to be idempotent.
- *
- * Initialized in listener.js
- */
-action.inputsToCancel = undefined;
-
-/**
- * Represents device state for an input source.
- */
-class InputState {
-  constructor() {
-    this.type = this.constructor.name.toLowerCase();
-  }
-
-  /**
-   * Check equality of this InputState object with another.
-   *
-   * @param {InputState} other
-   *     Object representing an input state.
-   *
-   * @return {boolean}
-   *     True if <code>this</code> has the same <code>type</code>
-   *     as <code>other</code>.
-   */
-  is(other) {
-    if (typeof other == "undefined") {
-      return false;
-    }
-    return this.type === other.type;
-  }
-
-  toString() {
-    return `[object ${this.constructor.name}InputState]`;
-  }
-
-  /**
-   * @param {Object.<string, ?>} obj
-   *     Object with property <code>type</code> and optionally
-   *     <code>parameters</code> or <code>pointerType</code>,
-   *     representing an action sequence or an action item.
-   *
-   * @return {action.InputState}
-   *     An {@link InputState} object for the type of the
-   *     {@link actionSequence}.
-   *
-   * @throws {InvalidArgumentError}
-   *     If {@link actionSequence.type} is not valid.
-   */
-  static fromJSON(obj) {
-    let type = obj.type;
-    assert.in(type, ACTIONS, pprint`Unknown action type: ${type}`);
-    let name = type == "none" ? "Null" : capitalize(type);
-    if (name == "Pointer") {
-      if (!obj.pointerType &&
-          (!obj.parameters || !obj.parameters.pointerType)) {
-        throw new InvalidArgumentError(
-            pprint`Expected obj to have pointerType, got ${obj}`);
-      }
-      let pointerType = obj.pointerType || obj.parameters.pointerType;
-      return new action.InputState[name](pointerType);
-    }
-    return new action.InputState[name]();
-  }
-}
-
-/** Possible kinds of |InputState| for supported input sources. */
-action.InputState = {};
-
-/**
- * Input state associated with a keyboard-type device.
- */
-action.InputState.Key = class Key extends InputState {
-  constructor() {
-    super();
-    this.pressed = new Set();
-    this.alt = false;
-    this.shift = false;
-    this.ctrl = false;
-    this.meta = false;
-  }
-
-  /**
-   * Update modifier state according to |key|.
-   *
-   * @param {string} key
-   *     Normalized key value of a modifier key.
-   * @param {boolean} value
-   *     Value to set the modifier attribute to.
-   *
-   * @throws {InvalidArgumentError}
-   *     If |key| is not a modifier.
-   */
-  setModState(key, value) {
-    if (key in MODIFIER_NAME_LOOKUP) {
-      this[MODIFIER_NAME_LOOKUP[key]] = value;
-    } else {
-      throw new InvalidArgumentError(
-          "Expected 'key' to be one of " +
-          Object.keys(MODIFIER_NAME_LOOKUP) +
-          pprint`, got ${key}`);
-    }
-  }
-
-  /**
-   * Check whether |key| is pressed.
-   *
-   * @param {string} key
-   *     Normalized key value.
-   *
-   * @return {boolean}
-   *     True if |key| is in set of pressed keys.
-   */
-  isPressed(key) {
-    return this.pressed.has(key);
-  }
-
-  /**
-   * Add |key| to the set of pressed keys.
-   *
-   * @param {string} key
-   *     Normalized key value.
-   *
-   * @return {boolean}
-   *     True if |key| is in list of pressed keys.
-   */
-  press(key) {
-    return this.pressed.add(key);
-  }
-
-  /**
-   * Remove |key| from the set of pressed keys.
-   *
-   * @param {string} key
-   *     Normalized key value.
-   *
-   * @return {boolean}
-   *     True if |key| was present before removal, false otherwise.
-   */
-  release(key) {
-    return this.pressed.delete(key);
-  }
-};
-
-/**
- * Input state not associated with a specific physical device.
- */
-action.InputState.Null = class Null extends InputState {
-  constructor() {
-    super();
-    this.type = "none";
-  }
-};
-
-/**
- * Input state associated with a pointer-type input device.
- *
- * @param {string} subtype
- *     Kind of pointing device: mouse, pen, touch.
- *
- * @throws {InvalidArgumentError}
- *     If subtype is undefined or an invalid pointer type.
- */
-action.InputState.Pointer = class Pointer extends InputState {
-  constructor(subtype) {
-    super();
-    this.pressed = new Set();
-    assert.defined(subtype,
-        pprint`Expected subtype to be defined, got ${subtype}`);
-    this.subtype = action.PointerType.get(subtype);
-    this.x = 0;
-    this.y = 0;
-  }
-
-  /**
-   * Check whether |button| is pressed.
-   *
-   * @param {number} button
-   *     Positive integer that refers to a mouse button.
-   *
-   * @return {boolean}
-   *     True if |button| is in set of pressed buttons.
-   */
-  isPressed(button) {
-    assert.positiveInteger(button);
-    return this.pressed.has(button);
-  }
-
-  /**
-   * Add |button| to the set of pressed keys.
-   *
-   * @param {number} button
-   *     Positive integer that refers to a mouse button.
-   *
-   * @return {Set}
-   *     Set of pressed buttons.
-   */
-  press(button) {
-    assert.positiveInteger(button);
-    return this.pressed.add(button);
-  }
-
-   /**
-   * Remove |button| from the set of pressed buttons.
-   *
-   * @param {number} button
-   *     A positive integer that refers to a mouse button.
-   *
-   * @return {boolean}
-   *     True if |button| was present before removals, false otherwise.
-   */
-  release(button) {
-    assert.positiveInteger(button);
-    return this.pressed.delete(button);
-  }
-};
-
-/**
- * Repesents an action for dispatch. Used in |action.Chain| and
- * |action.Sequence|.
- *
- * @param {string} id
- *     Input source ID.
- * @param {string} type
- *     Action type: none, key, pointer.
- * @param {string} subtype
- *     Action subtype: {@link action.Pause}, {@link action.KeyUp},
- *     {@link action.KeyDown}, {@link action.PointerUp},
- *     {@link action.PointerDown}, {@link action.PointerMove}, or
- *     {@link action.PointerCancel}.
- *
- * @throws {InvalidArgumentError}
- *      If any parameters are undefined.
- */
-action.Action = class {
-  constructor(id, type, subtype) {
-    if ([id, type, subtype].includes(undefined)) {
-      throw new InvalidArgumentError("Missing id, type or subtype");
-    }
-    for (let attr of [id, type, subtype]) {
-      assert.string(attr, pprint`Expected string, got ${attr}`);
-    }
-    this.id = id;
-    this.type = type;
-    this.subtype = subtype;
-  }
-
-  toString() {
-    return `[action ${this.type}]`;
-  }
-
-  /**
-   * @param {action.Sequence} actionSequence
-   *     Object representing sequence of actions from one input source.
-   * @param {action.Action} actionItem
-   *     Object representing a single action from |actionSequence|.
-   *
-   * @return {action.Action}
-   *     An action that can be dispatched; corresponds to |actionItem|.
-   *
-   * @throws {InvalidArgumentError}
-   *     If any <code>actionSequence</code> or <code>actionItem</code>
-   *     attributes are invalid.
-   * @throws {UnsupportedOperationError}
-   *     If <code>actionItem.type</code> is {@link action.PointerCancel}.
-   */
-  static fromJSON(actionSequence, actionItem) {
-    let type = actionSequence.type;
-    let id = actionSequence.id;
-    let subtypes = ACTIONS[type];
-    if (!subtypes) {
-      throw new InvalidArgumentError("Unknown type: " + type);
-    }
-    let subtype = actionItem.type;
-    if (!subtypes.has(subtype)) {
-      throw new InvalidArgumentError(
-          `Unknown subtype for ${type} action: ${subtype}`);
-    }
-
-    let item = new action.Action(id, type, subtype);
-    if (type === "pointer") {
-      action.processPointerAction(id,
-          action.PointerParameters.fromJSON(actionSequence.parameters), item);
-    }
-
-    switch (item.subtype) {
-      case action.KeyUp:
-      case action.KeyDown:
-        let key = actionItem.value;
-        // TODO countGraphemes
-        // TODO key.value could be a single code point like "\uE012"
-        // (see rawKey) or "grapheme cluster"
-        assert.string(key,
-            "Expected 'value' to be a string that represents single code point " +
-            pprint`or grapheme cluster, got ${key}`);
-        item.value = key;
-        break;
-
-      case action.PointerDown:
-      case action.PointerUp:
-        assert.positiveInteger(actionItem.button,
-            pprint`Expected 'button' (${actionItem.button}) to be >= 0`);
-        item.button = actionItem.button;
-        break;
-
-      case action.PointerMove:
-        item.duration = actionItem.duration;
-        if (typeof item.duration != "undefined") {
-          assert.positiveInteger(item.duration,
-              pprint`Expected 'duration' (${item.duration}) to be >= 0`);
-        }
-        item.origin = action.PointerOrigin.get(actionItem.origin);
-        item.x = actionItem.x;
-        if (typeof item.x != "undefined") {
-          assert.integer(item.x,
-              pprint`Expected 'x' (${item.x}) to be an Integer`);
-        }
-        item.y = actionItem.y;
-        if (typeof item.y != "undefined") {
-          assert.integer(item.y,
-              pprint`Expected 'y' (${item.y}) to be an Integer`);
-        }
-        break;
-
-      case action.PointerCancel:
-        throw new UnsupportedOperationError();
-
-      case action.Pause:
-        item.duration = actionItem.duration;
-        if (typeof item.duration != "undefined") {
-          // eslint-disable-next-line
-          assert.positiveInteger(item.duration,
-              pprint`Expected 'duration' (${item.duration}) to be >= 0`);
-        }
-        break;
-    }
-
-    return item;
-  }
-};
-
-/**
- * Represents a series of ticks, specifying which actions to perform at
- * each tick.
- */
-action.Chain = class extends Array {
-  toString() {
-    return `[chain ${super.toString()}]`;
-  }
-
-  /**
-   * @param {Array.<?>} actions
-   *     Array of objects that each represent an action sequence.
-   *
-   * @return {action.Chain}
-   *     Transpose of <var>actions</var> such that actions to be performed
-   *     in a single tick are grouped together.
-   *
-   * @throws {InvalidArgumentError}
-   *     If <var>actions</var> is not an Array.
-   */
-  static fromJSON(actions) {
-    assert.array(actions,
-        pprint`Expected 'actions' to be an array, got ${actions}`);
-
-    let actionsByTick = new action.Chain();
-    for (let actionSequence of actions) {
-      // TODO(maja_zf): Check that each actionSequence in actions refers
-      // to a different input ID.
-      let inputSourceActions = action.Sequence.fromJSON(actionSequence);
-      for (let i = 0; i < inputSourceActions.length; i++) {
-        // new tick
-        if (actionsByTick.length < (i + 1)) {
-          actionsByTick.push([]);
-        }
-        actionsByTick[i].push(inputSourceActions[i]);
-      }
-    }
-    return actionsByTick;
-  }
-};
-
-/**
- * Represents one input source action sequence; this is essentially an
- * |Array.<action.Action>|.
- */
-action.Sequence = class extends Array {
-  toString() {
-    return `[sequence ${super.toString()}]`;
-  }
-
-  /**
-   * @param {Object.<string, ?>} actionSequence
-   *     Object that represents a sequence action items for one input source.
-   *
-   * @return {action.Sequence}
-   *     Sequence of actions that can be dispatched.
-   *
-   * @throws {InvalidArgumentError}
-   *     If <code>actionSequence.id</code> is not a
-   *     string or it's aleady mapped to an |action.InputState}
-   *     incompatible with <code>actionSequence.type</code>, or if
-   *     <code>actionSequence.actions</code> is not an <code>Array</code>.
-   */
-  static fromJSON(actionSequence) {
-    // used here to validate 'type' in addition to InputState type below
-    let inputSourceState = InputState.fromJSON(actionSequence);
-    let id = actionSequence.id;
-    assert.defined(id, "Expected 'id' to be defined");
-    assert.string(id, pprint`Expected 'id' to be a string, got ${id}`);
-    let actionItems = actionSequence.actions;
-    assert.array(
-        actionItems,
-        "Expected 'actionSequence.actions' to be an array, " +
-        pprint`got ${actionSequence.actions}`);
-
-    if (!action.inputStateMap.has(id)) {
-      action.inputStateMap.set(id, inputSourceState);
-    } else if (!action.inputStateMap.get(id).is(inputSourceState)) {
-      throw new InvalidArgumentError(
-          `Expected ${id} to be mapped to ${inputSourceState}, ` +
-          `got ${action.inputStateMap.get(id)}`);
-    }
-
-    let actions = new action.Sequence();
-    for (let actionItem of actionItems) {
-      actions.push(action.Action.fromJSON(actionSequence, actionItem));
-    }
-
-    return actions;
-  }
-};
-
-/**
- * Represents parameters in an action for a pointer input source.
- *
- * @param {string=} pointerType
- *     Type of pointing device.  If the parameter is undefined, "mouse"
- *     is used.
- */
-action.PointerParameters = class {
-  constructor(pointerType = "mouse") {
-    this.pointerType = action.PointerType.get(pointerType);
-  }
-
-  toString() {
-    return `[pointerParameters ${this.pointerType}]`;
-  }
-
-  /**
-   * @param {Object.<string, ?>} parametersData
-   *     Object that represents pointer parameters.
-   *
-   * @return {action.PointerParameters}
-   *     Validated pointer paramters.
-   */
-  static fromJSON(parametersData) {
-    if (typeof parametersData == "undefined") {
-      return new action.PointerParameters();
-    }
-    return new action.PointerParameters(parametersData.pointerType);
-  }
-};
-
-/**
- * Adds <var>pointerType</var> attribute to Action <var>act</var>.
- *
- * Helper function for {@link action.Action.fromJSON}.
- *
- * @param {string} id
- *     Input source ID.
- * @param {action.PointerParams} pointerParams
- *     Input source pointer parameters.
- * @param {action.Action} act
- *     Action to be updated.
- *
- * @throws {InvalidArgumentError}
- *     If <var>id</var> is already mapped to an
- *     {@link action.InputState} that is not compatible with
- *     <code>act.type</code> or <code>pointerParams.pointerType</code>.
- */
-action.processPointerAction = function(id, pointerParams, act) {
-  if (action.inputStateMap.has(id) &&
-      action.inputStateMap.get(id).type !== act.type) {
-    throw new InvalidArgumentError(
-        `Expected 'id' ${id} to be mapped to InputState whose type is ` +
-        action.inputStateMap.get(id).type +
-        pprint` , got ${act.type}`);
-  }
-  let pointerType = pointerParams.pointerType;
-  if (action.inputStateMap.has(id) &&
-      action.inputStateMap.get(id).subtype !== pointerType) {
-    throw new InvalidArgumentError(
-        `Expected 'id' ${id} to be mapped to InputState whose subtype is ` +
-        action.inputStateMap.get(id).subtype +
-        pprint` , got ${pointerType}`);
-  }
-  act.pointerType = pointerParams.pointerType;
-};
-
-/** Collect properties associated with KeyboardEvent */
-action.Key = class {
-  constructor(rawKey) {
-    this.key = NORMALIZED_KEY_LOOKUP[rawKey] || rawKey;
-    this.code =  KEY_CODE_LOOKUP[rawKey];
-    this.location = KEY_LOCATION_LOOKUP[rawKey] || 0;
-    this.altKey = false;
-    this.shiftKey = false;
-    this.ctrlKey = false;
-    this.metaKey = false;
-    this.repeat = false;
-    this.isComposing = false;
-    // keyCode will be computed by event.sendKeyDown
-  }
-
-  update(inputState) {
-    this.altKey = inputState.alt;
-    this.shiftKey = inputState.shift;
-    this.ctrlKey = inputState.ctrl;
-    this.metaKey = inputState.meta;
-  }
-};
-
-/** Collect properties associated with MouseEvent */
-action.Mouse = class {
-  constructor(type, button = 0) {
-    this.type = type;
-    assert.positiveInteger(button);
-    this.button = button;
-    this.buttons = 0;
-    this.altKey = false;
-    this.shiftKey = false;
-    this.metaKey = false;
-    this.ctrlKey = false;
-    // set modifier properties based on whether any corresponding keys are
-    // pressed on any key input source
-    for (let inputState of action.inputStateMap.values()) {
-      if (inputState.type == "key") {
-        this.altKey = inputState.alt || this.altKey;
-        this.ctrlKey = inputState.ctrl || this.ctrlKey;
-        this.metaKey = inputState.meta || this.metaKey;
-        this.shiftKey = inputState.shift || this.shiftKey;
-      }
-    }
-  }
-
-  update(inputState) {
-    let allButtons = Array.from(inputState.pressed);
-    this.buttons = allButtons.reduce((a, i) => a + Math.pow(2, i), 0);
-  }
-};
-
-/**
- * Dispatch a chain of actions over |chain.length| ticks.
- *
- * This is done by creating a Promise for each tick that resolves once
- * all the Promises for individual tick-actions are resolved.  The next
- * tick's actions are not dispatched until the Promise for the current
- * tick is resolved.
- *
- * @param {action.Chain} chain
- *     Actions grouped by tick; each element in |chain| is a sequence of
- *     actions for one tick.
- * @param {element.Store} seenEls
- *     Element store.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise for dispatching all actions in |chain|.
- */
-action.dispatch = function(chain, seenEls, window) {
-  let chainEvents = (async () => {
-    for (let tickActions of chain) {
-      await action.dispatchTickActions(
-          tickActions,
-          action.computeTickDuration(tickActions),
-          seenEls,
-          window);
-    }
-  })();
-  return chainEvents;
-};
-
-/**
- * Dispatch sequence of actions for one tick.
- *
- * This creates a Promise for one tick that resolves once the Promise
- * for each tick-action is resolved, which takes at least |tickDuration|
- * milliseconds.  The resolved set of events for each tick is followed by
- * firing of pending DOM events.
- *
- * Note that the tick-actions are dispatched in order, but they may have
- * different durations and therefore may not end in the same order.
- *
- * @param {Array.<action.Action>} tickActions
- *     List of actions for one tick.
- * @param {number} tickDuration
- *     Duration in milliseconds of this tick.
- * @param {element.Store} seenEls
- *     Element store.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise for dispatching all tick-actions and pending DOM events.
- */
-action.dispatchTickActions = function(
-    tickActions, tickDuration, seenEls, window) {
-  let pendingEvents = tickActions.map(
-      toEvents(tickDuration, seenEls, window));
-  return Promise.all(pendingEvents).then(
-      () => interaction.flushEventLoop(window));
-};
-
-/**
- * Compute tick duration in milliseconds for a collection of actions.
- *
- * @param {Array.<action.Action>} tickActions
- *     List of actions for one tick.
- *
- * @return {number}
- *     Longest action duration in |tickActions| if any, or 0.
- */
-action.computeTickDuration = function(tickActions) {
-  let max = 0;
-  for (let a of tickActions) {
-    let affectsWallClockTime = a.subtype == action.Pause ||
-        (a.type == "pointer" && a.subtype == action.PointerMove);
-    if (affectsWallClockTime && a.duration) {
-      max = Math.max(a.duration, max);
-    }
-  }
-  return max;
-};
-
-/**
- * Compute viewport coordinates of pointer target based on given origin.
- *
- * @param {action.Action} a
- *     Action that specifies pointer origin and x and y coordinates of target.
- * @param {action.InputState} inputState
- *     Input state that specifies current x and y coordinates of pointer.
- * @param {Map.<string, number>=} center
- *     Object representing x and y coordinates of an element center-point.
- *     This is only used if |a.origin| is a web element reference.
- *
- * @return {Map.<string, number>}
- *     x and y coordinates of pointer destination.
- */
-action.computePointerDestination = function(
-    a, inputState, center = undefined) {
-  let {x, y} = a;
-  switch (a.origin) {
-    case action.PointerOrigin.Viewport:
-      break;
-    case action.PointerOrigin.Pointer:
-      x += inputState.x;
-      y += inputState.y;
-      break;
-    default:
-      // origin represents web element
-      assert.defined(center);
-      assert.in("x", center);
-      assert.in("y", center);
-      x += center.x;
-      y += center.y;
-  }
-  return {"x": x, "y": y};
-};
-
-/**
- * Create a closure to use as a map from action definitions to Promise events.
- *
- * @param {number} tickDuration
- *     Duration in milliseconds of this tick.
- * @param {element.Store} seenEls
- *     Element store.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {function(action.Action): Promise}
- *     Function that takes an action and returns a Promise for dispatching
- *     the event that corresponds to that action.
- */
-function toEvents(tickDuration, seenEls, window) {
-  return a => {
-    let inputState = action.inputStateMap.get(a.id);
-
-    switch (a.subtype) {
-      case action.KeyUp:
-        return dispatchKeyUp(a, inputState, window);
-
-      case action.KeyDown:
-        return dispatchKeyDown(a, inputState, window);
-
-      case action.PointerDown:
-        return dispatchPointerDown(a, inputState, window);
-
-      case action.PointerUp:
-        return dispatchPointerUp(a, inputState, window);
-
-      case action.PointerMove:
-        return dispatchPointerMove(
-            a, inputState, tickDuration, seenEls, window);
-
-      case action.PointerCancel:
-        throw new UnsupportedOperationError();
-
-      case action.Pause:
-        return dispatchPause(a, tickDuration);
-    }
-
-    return undefined;
-  };
-}
-
-/**
- * Dispatch a keyDown action equivalent to pressing a key on a keyboard.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {action.InputState} inputState
- *     Input state for this action's input source.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise to dispatch at least a keydown event, and keypress if
- *     appropriate.
- */
-function dispatchKeyDown(a, inputState, window) {
-  return new Promise(resolve => {
-    let keyEvent = new action.Key(a.value);
-    keyEvent.repeat = inputState.isPressed(keyEvent.key);
-    inputState.press(keyEvent.key);
-    if (keyEvent.key in MODIFIER_NAME_LOOKUP) {
-      inputState.setModState(keyEvent.key, true);
-    }
-
-    // Append a copy of |a| with keyUp subtype
-    action.inputsToCancel.push(Object.assign({}, a, {subtype: action.KeyUp}));
-    keyEvent.update(inputState);
-    event.sendKeyDown(a.value, keyEvent, window);
-
-    resolve();
-  });
-}
-
-/**
- * Dispatch a keyUp action equivalent to releasing a key on a keyboard.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {action.InputState} inputState
- *     Input state for this action's input source.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise to dispatch a keyup event.
- */
-function dispatchKeyUp(a, inputState, window) {
-  return new Promise(resolve => {
-    let keyEvent = new action.Key(a.value);
-
-    if (!inputState.isPressed(keyEvent.key)) {
-      resolve();
-      return;
-    }
-
-    if (keyEvent.key in MODIFIER_NAME_LOOKUP) {
-      inputState.setModState(keyEvent.key, false);
-    }
-    inputState.release(keyEvent.key);
-    keyEvent.update(inputState);
-
-    event.sendKeyUp(a.value, keyEvent, window);
-    resolve();
-  });
-}
-
-/**
- * Dispatch a pointerDown action equivalent to pressing a pointer-device
- * button.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {action.InputState} inputState
- *     Input state for this action's input source.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise to dispatch at least a pointerdown event.
- */
-function dispatchPointerDown(a, inputState, window) {
-  return new Promise(resolve => {
-    if (inputState.isPressed(a.button)) {
-      resolve();
-      return;
-    }
-
-    inputState.press(a.button);
-    // Append a copy of |a| with pointerUp subtype
-    let copy = Object.assign({}, a, {subtype: action.PointerUp});
-    action.inputsToCancel.push(copy);
-
-    switch (inputState.subtype) {
-      case action.PointerType.Mouse:
-        let mouseEvent = new action.Mouse("mousedown", a.button);
-        mouseEvent.update(inputState);
-        event.synthesizeMouseAtPoint(
-            inputState.x,
-            inputState.y,
-            mouseEvent,
-            window);
-        if (event.MouseButton.isSecondary(a.button)) {
-          let contextMenuEvent = Object.assign({},
-              mouseEvent, {type: "contextmenu"});
-          event.synthesizeMouseAtPoint(
-              inputState.x,
-              inputState.y,
-              contextMenuEvent,
-              window);
-        }
-        break;
-
-      case action.PointerType.Pen:
-      case action.PointerType.Touch:
-        throw new UnsupportedOperationError("Only 'mouse' pointer type is supported");
-
-      default:
-        throw new TypeError(`Unknown pointer type: ${inputState.subtype}`);
-    }
-
-    resolve();
-  });
-}
-
-/**
- * Dispatch a pointerUp action equivalent to releasing a pointer-device
- * button.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {action.InputState} inputState
- *     Input state for this action's input source.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise to dispatch at least a pointerup event.
- */
-function dispatchPointerUp(a, inputState, window) {
-  return new Promise(resolve => {
-    if (!inputState.isPressed(a.button)) {
-      resolve();
-      return;
-    }
-
-    inputState.release(a.button);
-
-    switch (inputState.subtype) {
-      case action.PointerType.Mouse:
-        let mouseEvent = new action.Mouse("mouseup", a.button);
-        mouseEvent.update(inputState);
-        event.synthesizeMouseAtPoint(
-            inputState.x, inputState.y, mouseEvent, window);
-        break;
-
-      case action.PointerType.Pen:
-      case action.PointerType.Touch:
-        throw new UnsupportedOperationError("Only 'mouse' pointer type is supported");
-
-      default:
-        throw new TypeError(`Unknown pointer type: ${inputState.subtype}`);
-    }
-
-    resolve();
-  });
-}
-
-/**
- * Dispatch a pointerMove action equivalent to moving pointer device in
- * a line.
- *
- * If the action duration is 0, the pointer jumps immediately to the
- * target coordinates.  Otherwise, events are synthesized to mimic a
- * pointer travelling in a discontinuous, approximately straight line,
- * with the pointer coordinates being updated around 60 times per second.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {action.InputState} inputState
- *     Input state for this action's input source.
- * @param {element.Store} seenEls
- *     Element store.
- * @param {WindowProxy} window
- *     Current window global.
- *
- * @return {Promise}
- *     Promise to dispatch at least one pointermove event, as well as
- *     mousemove events as appropriate.
- */
-function dispatchPointerMove(a, inputState, tickDuration, seenEls, window) {
-  const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-  // interval between pointermove increments in ms, based on common vsync
-  const fps60 = 17;
-
-  return new Promise(resolve => {
-    const start = Date.now();
-    const [startX, startY] = [inputState.x, inputState.y];
-
-    let target = action.computePointerDestination(a, inputState,
-        getElementCenter(a.origin, seenEls));
-    const [targetX, targetY] = [target.x, target.y];
-
-    if (!inViewPort(targetX, targetY, window)) {
-      throw new MoveTargetOutOfBoundsError(
-          `(${targetX}, ${targetY}) is out of bounds of viewport ` +
-          `width (${window.innerWidth}) ` +
-          `and height (${window.innerHeight})`);
-    }
-
-    const duration = typeof a.duration == "undefined" ? tickDuration : a.duration;
-    if (duration === 0) {
-      // move pointer to destination in one step
-      performOnePointerMove(inputState, targetX, targetY, window);
-      resolve();
-      return;
-    }
-
-    const distanceX = targetX - startX;
-    const distanceY = targetY - startY;
-    const ONE_SHOT = Ci.nsITimer.TYPE_ONE_SHOT;
-    let intermediatePointerEvents = (async () => {
-      // wait |fps60| ms before performing first incremental pointer move
-      await new Promise(resolveTimer =>
-          timer.initWithCallback(resolveTimer, fps60, ONE_SHOT));
-
-      let durationRatio = Math.floor(Date.now() - start) / duration;
-      const epsilon = fps60 / duration / 10;
-      while ((1 - durationRatio) > epsilon) {
-        let x = Math.floor(durationRatio * distanceX + startX);
-        let y = Math.floor(durationRatio * distanceY + startY);
-        performOnePointerMove(inputState, x, y, window);
-        // wait |fps60| ms before performing next pointer move
-        await new Promise(resolveTimer =>
-            timer.initWithCallback(resolveTimer, fps60, ONE_SHOT));
-
-        durationRatio = Math.floor(Date.now() - start) / duration;
-      }
-    })();
-
-    // perform last pointer move after all incremental moves are resolved and
-    // durationRatio is close enough to 1
-    intermediatePointerEvents.then(() => {
-      performOnePointerMove(inputState, targetX, targetY, window);
-      resolve();
-    });
-
-  });
-}
-
-function performOnePointerMove(inputState, targetX, targetY, win) {
-  if (targetX == inputState.x && targetY == inputState.y) {
-    return;
-  }
-
-  switch (inputState.subtype) {
-    case action.PointerType.Mouse:
-      let mouseEvent = new action.Mouse("mousemove");
-      mouseEvent.update(inputState);
-      // TODO both pointermove (if available) and mousemove
-      event.synthesizeMouseAtPoint(targetX, targetY, mouseEvent, win);
-      break;
-
-    case action.PointerType.Pen:
-    case action.PointerType.Touch:
-      throw new UnsupportedOperationError("Only 'mouse' pointer type is supported");
-
-    default:
-      throw new TypeError(`Unknown pointer type: ${inputState.subtype}`);
-  }
-
-  inputState.x = targetX;
-  inputState.y = targetY;
-}
-
-/**
- * Dispatch a pause action equivalent waiting for |a.duration|
- * milliseconds, or a default time interval of |tickDuration|.
- *
- * @param {action.Action} a
- *     Action to dispatch.
- * @param {number} tickDuration
- *     Duration in milliseconds of this tick.
- *
- * @return {Promise}
- *     Promise that is resolved after the specified time interval.
- */
-function dispatchPause(a, tickDuration) {
-  const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-  let duration = typeof a.duration == "undefined" ? tickDuration : a.duration;
-  return new Promise(resolve =>
-      timer.initWithCallback(resolve, duration, Ci.nsITimer.TYPE_ONE_SHOT)
-  );
-}
-
-// helpers
-
-function capitalize(str) {
-  assert.string(str);
-  return str.charAt(0).toUpperCase() + str.slice(1);
-}
-
-function inViewPort(x, y, win) {
-  assert.number(x, `Expected x to be finite number`);
-  assert.number(y, `Expected y to be finite number`);
-  // Viewport includes scrollbars if rendered.
-  return !(x < 0 || y < 0 || x > win.innerWidth || y > win.innerHeight);
-}
-
-function getElementCenter(elementReference, seenEls) {
-  if (element.isWebElementReference(elementReference)) {
-    let uuid = elementReference[element.Key] ||
-        elementReference[element.LegacyKey];
-    let el = seenEls.get(uuid);
-    return element.coordinates(el);
-  }
-  return {};
-}
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/addon.html b/testing/marionette/doc/api/addon.html deleted file mode 100644 --- a/testing/marionette/doc/api/addon.html +++ /dev/null @@ -1,551 +0,0 @@ - - - - - JSDoc: Namespace: addon - - - - - - - - - - -
- -

Namespace: addon

- - - - - - -
- -
- -

addon

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) install(path, temporaryopt) → {Promise.<string>}

- - - - - - -
-

Install a Firefox addon.

-

If the addon is restartless, it can be used right away. Otherwise a -restart is required.

-

Temporary addons will automatically be uninstalled on shutdown and -do not need to be signed, though they must be restartless.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
path - - -string - - - - - - - - - -

Full path to the extension package archive.

temporary - - -boolean - - - - - - <optional>
- - - - - -

True to install the addon temporarily, false (default) otherwise.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If there is a problem installing the addon.

-
-
-
-
-
-
- Type -
-
- -UnknownError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Addon ID.

-
- - - -
-
- Type -
-
- -Promise.<string> - - -
-
- - - - - - - - - - - - - -

(static) uninstall(id) → {Promise}

- - - - - - -
-

Uninstall a Firefox addon.

-

If the addon is restartless it will be uninstalled right away. -Otherwise, Firefox must be restarted for the change to take effect.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

ID of the addon to uninstall.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If there is a problem uninstalling the addon.

-
-
-
-
-
-
- Type -
-
- -UnknownError - - -
-
-
-
-
- - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/addon.js.html b/testing/marionette/doc/api/addon.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/addon.js.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - JSDoc: Source: addon.js - - - - - - - - - - -
- -

Source: addon.js

- - - - - - -
-
-
/* 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";
-
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-
-const {UnknownError} = Cu.import("chrome://marionette/content/error.js", {});
-
-this.EXPORTED_SYMBOLS = ["addon"];
-
-/** @namespace */
-this.addon = {};
-
-// from https://developer.mozilla.org/en-US/Add-ons/Add-on_Manager/AddonManager#AddonInstall_errors
-addon.Errors = {
-  [-1]: "ERROR_NETWORK_FAILURE: A network error occured.",
-  [-2]: "ERROR_INCORECT_HASH: The downloaded file did not match the expected hash.",
-  [-3]: "ERROR_CORRUPT_FILE: The file appears to be corrupt.",
-  [-4]: "ERROR_FILE_ACCESS: There was an error accessing the filesystem.",
-  [-5]: "ERROR_SIGNEDSTATE_REQUIRED: The addon must be signed and isn't.",
-};
-
-function lookupError(code) {
-  let msg = addon.Errors[code];
-  return new UnknownError(msg);
-}
-
-async function installAddon(file) {
-  let install = await AddonManager.getInstallForFile(file);
-
-  return new Promise((resolve, reject) => {
-    if (install.error != 0) {
-      reject(new UnknownError(lookupError(install.error)));
-    }
-
-    let addonId = install.addon.id;
-
-    let success = install => {
-      if (install.addon.id === addonId) {
-        install.removeListener(listener);
-        resolve(install.addon);
-      }
-    };
-
-    let fail = install => {
-      if (install.addon.id === addonId) {
-        install.removeListener(listener);
-        reject(new UnknownError(lookupError(install.error)));
-      }
-    };
-
-    let listener = {
-      onDownloadCancelled: fail,
-      onDownloadFailed: fail,
-      onInstallCancelled: fail,
-      onInstallFailed: fail,
-      onInstallEnded: success,
-    };
-
-    install.addListener(listener);
-    install.install();
-  });
-}
-
-/**
- * Install a Firefox addon.
- *
- * If the addon is restartless, it can be used right away.  Otherwise a
- * restart is required.
- *
- * Temporary addons will automatically be uninstalled on shutdown and
- * do not need to be signed, though they must be restartless.
- *
- * @param {string} path
- *     Full path to the extension package archive.
- * @param {boolean=} temporary
- *     True to install the addon temporarily, false (default) otherwise.
- *
- * @return {Promise.<string>}
- *     Addon ID.
- *
- * @throws {UnknownError}
- *     If there is a problem installing the addon.
- */
-addon.install = async function(path, temporary = false) {
-  let file = new FileUtils.File(path);
-  let addon;
-
-  if (!file.exists()) {
-    throw new UnknownError(`Could not find add-on at '${path}'`);
-  }
-
-  try {
-    if (temporary) {
-      addon = await AddonManager.installTemporaryAddon(file);
-    } else {
-      addon = await installAddon(file);
-    }
-  } catch (e) {
-    throw new UnknownError(
-        `Could not install add-on at '${path}': ${e.message}`);
-  }
-
-  return addon.id;
-};
-
-/**
- * Uninstall a Firefox addon.
- *
- * If the addon is restartless it will be uninstalled right away.
- * Otherwise, Firefox must be restarted for the change to take effect.
- *
- * @param {string} id
- *     ID of the addon to uninstall.
- *
- * @return {Promise}
- *
- * @throws {UnknownError}
- *     If there is a problem uninstalling the addon.
- */
-addon.uninstall = async function(id) {
-  return AddonManager.getAddonByID(id).then(addon => {
-    let listener = {
-      onOperationCancelled: addon => {
-        if (addon.id === id) {
-          AddonManager.removeAddonListener(listener);
-          throw new UnknownError(`Uninstall of ${id} has been canceled`);
-        }
-      },
-      onUninstalled: addon => {
-        if (addon.id === id) {
-          AddonManager.removeAddonListener(listener);
-          Promise.resolve();
-        }
-      },
-    };
-
-    AddonManager.addAddonListener(listener);
-    addon.uninstall();
-  });
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/assert.html b/testing/marionette/doc/api/assert.html deleted file mode 100644 --- a/testing/marionette/doc/api/assert.html +++ /dev/null @@ -1,4147 +0,0 @@ - - - - - JSDoc: Namespace: assert - - - - - - - - - - -
- -

Namespace: assert

- - - - - - -
- -
- -

assert

- - -
- -
-
- - -

Shorthands for common assertions made in Marionette.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) array(obj, msgopt) → {Object}

- - - - - - -
-

Asserts that |obj| is an Array.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not an Array.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(static) boolean(obj, msgopt) → {boolean}

- - - - - - -
-

Asserts that |obj| is a boolean.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not a boolean.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -

(static) callable(obj, msgopt) → {function}

- - - - - - -
-

Asserts that |obj| is callable.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not callable.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -function - - -
-
- - - - - - - - - - - - - -

(static) content(context, msgopt) → {string}

- - - - - - -
-

Asserts that the current |context| is content.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
context - - -string - - - - - - - - - -

Context to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |context| is not content.

-
-
-
-
-
-
- Type -
-
- -UnsupportedOperationError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|context| is returned unaltered.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

(static) contentBrowser(context, msgopt)

- - - - - - -
-

Asserts that |context| is a valid browsing context.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
context - - -browser.Context - - - - - - - - - -

Browsing context to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |context| is invalid.

-
-
-
-
-
-
- Type -
-
- -NoSuchWindowError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) defined(obj, msgopt) → {?}

- - - - - - -
-

Asserts that |obj| is defined.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not defined.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -? - - -
-
- - - - - - - - - - - - - -

(static) fennec(msgopt)

- - - - - - -
-

Asserts that the current browser is Fennec, or Firefox for Android.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If current browser is not Fennec.

-
-
-
-
-
-
- Type -
-
- -UnsupportedOperationError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) firefox(msgopt)

- - - - - - -
-

Asserts that the current browser is Firefox Desktop.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If current browser is not Firefox.

-
-
-
-
-
-
- Type -
-
- -UnsupportedOperationError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) in(prop, obj, msgopt) → {?}

- - - - - - -
-

Asserts that |prop| is in |obj|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
prop - - -? - - - - - - - - - -

Own property to test if is in |obj|.

obj - - -? - - - - - - - - - -

Object.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |prop| is not in |obj|, or |obj| is not an object.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Value of |obj|'s own property |prop|.

-
- - - -
-
- Type -
-
- -? - - -
-
- - - - - - - - - - - - - -

(static) integer(obj, msgopt) → {number}

- - - - - - -
-

Asserts that |obj| is an integer.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not an integer.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

(static) noUserPrompt(dialog, msgopt)

- - - - - - -
-

Asserts that there is no current user prompt.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
dialog - - -modal.Dialog - - - - - - - - - -

Reference to current dialogue.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If there is a user prompt.

-
-
-
-
-
-
- Type -
-
- -UnexpectedAlertOpenError - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) number(obj, msgopt) → {number}

- - - - - - -
-

Asserts that |obj| is a finite number.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not a number.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

(static) object(obj, msgopt) → {Object}

- - - - - - -
-

Asserts that |obj| is an object.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not an object.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -Object - - -
-
- - - - - - - - - - - - - -

(static) positiveInteger(obj, msgopt) → {number}

- - - - - - -
-

Asserts that |obj| is a positive integer.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not a positive integer.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

(static) session(driver, msgopt) → {string}

- - - - - - -
-

Asserts that Marionette has a session.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
driver - - -GeckoDriver - - - - - - - - - -

Marionette driver instance.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If driver does not have a session ID.

-
-
-
-
-
-
- Type -
-
- -InvalidSessionIDError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Current session's ID.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

(static) string(obj, msgopt) → {string}

- - - - - - -
-

Asserts that |obj| is a string.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
obj - - -? - - - - - - - - - -

Value to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |obj| is not a string.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|obj| is returned unaltered.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

(static) that(predicate, messageopt, erroropt) → {function}

- - - - - - -
-

Returns a function that is used to assert the |predicate|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
predicate - - -function - - - - - - - - - -

Evaluated on calling the return value of this function. If its - return value of the inner function is false, |error| is thrown - with |message|.

message - - -string - - - - - - <optional>
- - - - - -

Custom error message.

error - - -Error - - - - - - <optional>
- - - - - -

Custom error type by its class.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Function that takes and returns the passed in value unaltered, and - which may throw |error| with |message| if |predicate| evaluates - to false.

-
- - - -
-
- Type -
-
- -function - - -
-
- - - - - - - - - - - - - -

(static) window(win, msgopt) → {ChromeWindow}

- - - - - - -
-

Asserts that |win| is open.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
win - - -ChromeWindow - - - - - - - - - -

Chrome window to test.

msg - - -string - - - - - - <optional>
- - - - - -

Custom error message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |win| has been closed.

-
-
-
-
-
-
- Type -
-
- -NoSuchWindowError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

|win| is returned unaltered.

-
- - - -
-
- Type -
-
- -ChromeWindow - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/assert.js.html b/testing/marionette/doc/api/assert.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/assert.js.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - - JSDoc: Source: assert.js - - - - - - - - - - -
- -

Source: assert.js

- - - - - - -
-
-
/* 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";
-
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-const {
-  InvalidArgumentError,
-  InvalidSessionIDError,
-  NoSuchWindowError,
-  pprint,
-  UnexpectedAlertOpenError,
-  UnsupportedOperationError,
-} = Cu.import("chrome://marionette/content/error.js", {});
-
-this.EXPORTED_SYMBOLS = ["assert"];
-
-const isFennec = () => AppConstants.platform == "android";
-const isFirefox = () => Services.appinfo.name == "Firefox";
-
-/**
- * Shorthands for common assertions made in Marionette.
- *
- * @namespace
- */
-this.assert = {};
-
-/**
- * Asserts that Marionette has a session.
- *
- * @param {GeckoDriver} driver
- *     Marionette driver instance.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {string}
- *     Current session's ID.
- *
- * @throws {InvalidSessionIDError}
- *     If <var>driver</var> does not have a session ID.
- */
-assert.session = function(driver, msg = "") {
-  assert.that(sessionID => sessionID,
-      msg, InvalidSessionIDError)(driver.sessionID);
-  return driver.sessionID;
-};
-
-/**
- * Asserts that the current browser is Firefox Desktop.
- *
- * @param {string=} msg
- *     Custom error message.
- *
- * @throws {UnsupportedOperationError}
- *     If current browser is not Firefox.
- */
-assert.firefox = function(msg = "") {
-  msg = msg || "Only supported in Firefox";
-  assert.that(isFirefox, msg, UnsupportedOperationError)();
-};
-
-/**
- * Asserts that the current browser is Fennec, or Firefox for Android.
- *
- * @param {string=} msg
- *     Custom error message.
- *
- * @throws {UnsupportedOperationError}
- *     If current browser is not Fennec.
- */
-assert.fennec = function(msg = "") {
-  msg = msg || "Only supported in Fennec";
-  assert.that(isFennec, msg, UnsupportedOperationError)();
-};
-
-/**
- * Asserts that the current |context| is content.
- *
- * @param {string} context
- *     Context to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {string}
- *     |context| is returned unaltered.
- *
- * @throws {UnsupportedOperationError}
- *     If |context| is not content.
- */
-assert.content = function(context, msg = "") {
-  msg = msg || "Only supported in content context";
-  assert.that(c => c.toString() == "content", msg, UnsupportedOperationError)(context);
-};
-
-/**
- * Asserts that |win| is open.
- *
- * @param {ChromeWindow} win
- *     Chrome window to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {ChromeWindow}
- *     |win| is returned unaltered.
- *
- * @throws {NoSuchWindowError}
- *     If |win| has been closed.
- */
-assert.window = function(win, msg = "") {
-  msg = msg || "Unable to locate window";
-  return assert.that(w => w && !w.closed,
-      msg,
-      NoSuchWindowError)(win);
-};
-
-/**
- * Asserts that |context| is a valid browsing context.
- *
- * @param {browser.Context} context
- *     Browsing context to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @throws {NoSuchWindowError}
- *     If |context| is invalid.
- */
-assert.contentBrowser = function(context, msg = "") {
-  // TODO: The contentBrowser uses a cached tab, which is only updated when
-  // switchToTab is called. Because of that an additional check is needed to
-  // make sure that the chrome window has not already been closed.
-  assert.window(context && context.window);
-
-  msg = msg || "Current window does not have a content browser";
-  assert.that(c => c.contentBrowser,
-      msg,
-      NoSuchWindowError)(context);
-};
-
-/**
- * Asserts that there is no current user prompt.
- *
- * @param {modal.Dialog} dialog
- *     Reference to current dialogue.
- * @param {string=} msg
- *     Custom error message.
- *
- * @throws {UnexpectedAlertOpenError}
- *     If there is a user prompt.
- */
-assert.noUserPrompt = function(dialog, msg = "") {
-  assert.that(d => d === null || typeof d == "undefined",
-      msg,
-      UnexpectedAlertOpenError)(dialog);
-};
-
-/**
- * Asserts that |obj| is defined.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {?}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not defined.
- */
-assert.defined = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be defined`;
-  return assert.that(o => typeof o != "undefined", msg)(obj);
-};
-
-/**
- * Asserts that |obj| is a finite number.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {number}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not a number.
- */
-assert.number = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be finite number`;
-  return assert.that(Number.isFinite, msg)(obj);
-};
-
-/**
- * Asserts that |obj| is callable.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {Function}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not callable.
- */
-assert.callable = function(obj, msg = "") {
-  msg = msg || pprint`${obj} is not callable`;
-  return assert.that(o => typeof o == "function", msg)(obj);
-};
-
-/**
- * Asserts that |obj| is an integer.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {number}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not an integer.
- */
-assert.integer = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be an integer`;
-  return assert.that(Number.isInteger, msg)(obj);
-};
-
-/**
- * Asserts that |obj| is a positive integer.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {number}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not a positive integer.
- */
-assert.positiveInteger = function(obj, msg = "") {
-  assert.integer(obj, msg);
-  msg = msg || pprint`Expected ${obj} to be >= 0`;
-  return assert.that(n => n >= 0, msg)(obj);
-};
-
-/**
- * Asserts that |obj| is a boolean.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {boolean}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not a boolean.
- */
-assert.boolean = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be boolean`;
-  return assert.that(b => typeof b == "boolean", msg)(obj);
-};
-
-/**
- * Asserts that |obj| is a string.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {string}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not a string.
- */
-assert.string = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be a string`;
-  return assert.that(s => typeof s == "string", msg)(obj);
-};
-
-/**
- * Asserts that |obj| is an object.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {Object}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not an object.
- */
-assert.object = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be an object`;
-  return assert.that(o => {
-    // unable to use instanceof because LHS and RHS may come from
-    // different globals
-    let s = Object.prototype.toString.call(o);
-    return s == "[object Object]" || s == "[object nsJSIID]";
-  }, msg)(obj);
-};
-
-/**
- * Asserts that |prop| is in |obj|.
- *
- * @param {?} prop
- *     Own property to test if is in |obj|.
- * @param {?} obj
- *     Object.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {?}
- *     Value of |obj|'s own property |prop|.
- *
- * @throws {InvalidArgumentError}
- *     If |prop| is not in |obj|, or |obj| is not an object.
- */
-assert.in = function(prop, obj, msg = "") {
-  assert.object(obj, msg);
-  msg = msg || pprint`Expected ${prop} in ${obj}`;
-  assert.that(p => obj.hasOwnProperty(p), msg)(prop);
-  return obj[prop];
-};
-
-/**
- * Asserts that |obj| is an Array.
- *
- * @param {?} obj
- *     Value to test.
- * @param {string=} msg
- *     Custom error message.
- *
- * @return {Object}
- *     |obj| is returned unaltered.
- *
- * @throws {InvalidArgumentError}
- *     If |obj| is not an Array.
- */
-assert.array = function(obj, msg = "") {
-  msg = msg || pprint`Expected ${obj} to be an Array`;
-  return assert.that(Array.isArray, msg)(obj);
-};
-
-/**
- * Returns a function that is used to assert the |predicate|.
- *
- * @param {function(?): boolean} predicate
- *     Evaluated on calling the return value of this function.  If its
- *     return value of the inner function is false, |error| is thrown
- *     with |message|.
- * @param {string=} message
- *     Custom error message.
- * @param {Error=} error
- *     Custom error type by its class.
- *
- * @return {function(?): ?}
- *     Function that takes and returns the passed in value unaltered, and
- *     which may throw |error| with |message| if |predicate| evaluates
- *     to false.
- */
-assert.that = function(
-    predicate, message = "", error = InvalidArgumentError) {
-  return obj => {
-    if (!predicate(obj)) {
-      throw new error(message);
-    }
-    return obj;
-  };
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/atom.html b/testing/marionette/doc/api/atom.html deleted file mode 100644 --- a/testing/marionette/doc/api/atom.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - JSDoc: Namespace: atom - - - - - - - - - - -
- -

Namespace: atom

- - - - - - -
- -
- -

atom

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/atom.js.html b/testing/marionette/doc/api/atom.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/atom.js.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - JSDoc: Source: atom.js - - - - - - - - - - -
- -

Source: atom.js

- - - - - - -
-
-
// Copyright 2011-2014 Software Freedom Conservancy
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-this.EXPORTED_SYMBOLS = ["atom"];
-
-/** @namespace */
-this.atom = {};
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/action.js#L83
-atom.clearElement = function (element, window){return function(){function g(a){throw a;}var h=void 0,i=!0,k=null,l=!1;function n(a){return function(){return this[a]}}function o(a){return function(){return a}}var p,q=this;
-function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
-else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function r(a){return a!==h}function ba(a){var b=aa(a);return"array"==b||"object"==b&&"number"==typeof a.length}function t(a){return"string"==typeof a}function w(a){return"function"==aa(a)}function ca(a){a=aa(a);return"object"==a||"array"==a||"function"==a}var da="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),ea=0,fa=Date.now||function(){return+new Date};
-function x(a,b){function c(){}c.prototype=b.prototype;a.$=b.prototype;a.prototype=new c};function ga(a,b){for(var c=1;c<arguments.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function ha(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}function ia(a){if(!ja.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(ka,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(la,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(ma,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(na,"&quot;"));return a}var ka=/&/g,la=/</g,ma=/>/g,na=/\"/g,ja=/[&<>\"]/;
-function oa(a,b){for(var c=0,d=ha(""+a).split("."),e=ha(""+b).split("."),f=Math.max(d.length,e.length),j=0;0==c&&j<f;j++){var m=d[j]||"",s=e[j]||"",O=RegExp("(\\d*)(\\D*)","g"),E=RegExp("(\\d*)(\\D*)","g");do{var u=O.exec(m)||["","",""],v=E.exec(s)||["","",""];if(0==u[0].length&&0==v[0].length)break;c=((0==u[1].length?0:parseInt(u[1],10))<(0==v[1].length?0:parseInt(v[1],10))?-1:(0==u[1].length?0:parseInt(u[1],10))>(0==v[1].length?0:parseInt(v[1],10))?1:0)||((0==u[2].length)<(0==v[2].length)?-1:(0==
-u[2].length)>(0==v[2].length)?1:0)||(u[2]<v[2]?-1:u[2]>v[2]?1:0)}while(0==c)}return c}var pa=2147483648*Math.random()|0,qa={};function ra(a){return qa[a]||(qa[a]=(""+a).replace(/\-([a-z])/g,function (a,c){return c.toUpperCase()}))};var sa,ta;function ua(){return q.navigator?q.navigator.userAgent:k}var va,wa=q.navigator;va=wa&&wa.platform||"";sa=-1!=va.indexOf("Mac");ta=-1!=va.indexOf("Win");var xa=-1!=va.indexOf("Linux"),ya,za="",Aa=/rv\:([^\);]+)(\)|;)/.exec(ua());ya=za=Aa?Aa[1]:"";var Ba={};var Ca=window;function Da(a,b){for(var c in a)b.call(h,a[c],c,a)}function Ea(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};function y(a,b){this.code=a;this.message=b||"";this.name=Fa[a]||Fa[13];var c=Error(this.message);c.name=this.name;this.stack=c.stack||""}x(y,Error);
-var Fa={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",33:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
-y.prototype.toString=function(){return"["+this.name+"] "+this.message};function Ga(a){this.stack=Error().stack||"";a&&(this.message=""+a)}x(Ga,Error);Ga.prototype.name="CustomError";function Ha(a,b){b.unshift(a);Ga.call(this,ga.apply(k,b));b.shift()}x(Ha,Ga);Ha.prototype.name="AssertionError";function Ia(a,b,c){if(!a){var d=Array.prototype.slice.call(arguments,2),e="Assertion failed";if(b)var e=e+(": "+b),f=d;g(new Ha(""+e,f||[]))}}function Ja(a,b){g(new Ha("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1)))};function z(a){return a[a.length-1]}var Ka=Array.prototype;function A(a,b){if(t(a))return!t(b)||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function La(a,b){for(var c=a.length,d=t(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(h,d[e],e,a)}function Ma(a,b){for(var c=a.length,d=Array(c),e=t(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(h,e[f],f,a));return d}
-function Na(a,b,c){for(var d=a.length,e=t(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return i;return l}function Oa(a,b,c){for(var d=a.length,e=t(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return l;return i}function Pa(a,b){var c;a:{c=a.length;for(var d=t(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(h,d[e],e,a)){c=e;break a}c=-1}return 0>c?k:t(a)?a.charAt(c):a[c]}function Qa(a){return Ka.concat.apply(Ka,arguments)}
-function Ra(a){if("array"==aa(a))return Qa(a);for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}function Sa(a,b,c){Ia(a.length!=k);return 2>=arguments.length?Ka.slice.call(a,b):Ka.slice.call(a,b,c)};var Ta;Ba["1.9.1"]||(Ba["1.9.1"]=0<=oa(ya,"1.9.1"));function Ua(a,b){var c;c=(c=a.className)&&"function"==typeof c.split?c.split(/\s+/):[];var d=Sa(arguments,1),e;e=c;for(var f=0,j=0;j<d.length;j++)0<=A(e,d[j])||(e.push(d[j]),f++);e=f==d.length;a.className=c.join(" ");return e};function B(a,b){this.x=r(a)?a:0;this.y=r(b)?b:0}B.prototype.toString=function(){return"("+this.x+", "+this.y+")"};function Va(a,b){this.width=a;this.height=b}Va.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};Va.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Va.prototype.scale=function (a){this.width*=a;this.height*=a;return this};var C=3;function Wa(a){return a?new Xa(D(a)):Ta||(Ta=new Xa)}function Ya(a,b){Da(b,function (b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in Za?a.setAttribute(Za[d],b):0==d.lastIndexOf("aria-",0)?a.setAttribute(d,b):a[d]=b})}var Za={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",maxlength:"maxLength",type:"type"};
-function F(a){return a?a.parentWindow||a.defaultView:window}function $a(a,b,c){function d(c){c&&b.appendChild(t(c)?a.createTextNode(c):c)}for(var e=2;e<c.length;e++){var f=c[e];ba(f)&&!(ca(f)&&0<f.nodeType)?La(ab(f)?Ra(f):f,d):d(f)}}function bb(a){return a&&a.parentNode?a.parentNode.removeChild(a):k}
-function G(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
-function cb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?db(a,b):!c&&G(e,b)?-1*eb(a,b):!d&&G(f,a)?eb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=D(a);c=d.createRange();c.selectNode(a);c.collapse(i);d=d.createRange();d.selectNode(b);d.collapse(i);
-return c.compareBoundaryPoints(q.Range.START_TO_END,d)}function eb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return db(d,a)}function db(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}
-function fb(a){var b,c=arguments.length;if(c){if(1==c)return arguments[0]}else return k;var d=[],e=Infinity;for(b=0;b<c;b++){for(var f=[],j=arguments[b];j;)f.unshift(j),j=j.parentNode;d.push(f);e=Math.min(e,f.length)}f=k;for(b=0;b<e;b++){for(var j=d[0][b],m=1;m<c;m++)if(j!=d[m][b])return f;f=j}return f}function D(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function gb(a,b){var c=[];return hb(a,b,c,i)?c[0]:h}
-function hb(a,b,c,d){if(a!=k)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||hb(a,b,c,d))return i;a=a.nextSibling}return l}var ib={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},jb={IMG:" ",BR:"\n"};function kb(a,b,c){if(!(a.nodeName in ib))if(a.nodeType==C)c?b.push((""+a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in jb)b.push(jb[a.nodeName]);else for(a=a.firstChild;a;)kb(a,b,c),a=a.nextSibling}
-function ab(a){if(a&&"number"==typeof a.length){if(ca(a))return"function"==typeof a.item||"string"==typeof a.item;if(w(a))return"function"==typeof a.item}return l}function lb(a,b){for(var a=a.parentNode,c=0;a;){if(b(a))return a;a=a.parentNode;c++}return k}function Xa(a){this.v=a||q.document||document}p=Xa.prototype;p.ea=n("v");p.z=function (a){return t(a)?this.v.getElementById(a):a};
-p.da=function (a,b,c){var d=this.v,e=arguments,f=e[1],j=d.createElement(e[0]);f&&(t(f)?j.className=f:"array"==aa(f)?Ua.apply(k,[j].concat(f)):Ya(j,f));2<e.length&&$a(d,j,e);return j};p.createElement=function (a){return this.v.createElement(a)};p.createTextNode=function (a){return this.v.createTextNode(a)};p.qa=function(){return this.v.parentWindow||this.v.defaultView};
-function mb(a){var b=a.v,a="CSS1Compat"==b.compatMode?b.documentElement:b.body,b=b.parentWindow||b.defaultView;return new B(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}p.appendChild=function (a,b){a.appendChild(b)};p.removeNode=bb;p.contains=G;var H={};H.ya=function(){var a={Oa:"http://www.w3.org/2000/svg"};return function (b){return a[b]||k}}();H.ma=function (a,b,c){var d=D(a);if(!d.implementation.hasFeature("XPath","3.0"))return k;try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):H.ya;return d.evaluate(b,a,e,c,k)}catch(f){"NS_ERROR_ILLEGAL_VALUE"!=f.name&&g(new y(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+f))}};
-H.ka=function (a,b){(!a||1!=a.nodeType)&&g(new y(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element."))};H.Ia=function (a,b){var c=function(){var c=H.ma(b,a,9);return c?c.singleNodeValue||k:b.selectSingleNode?(c=D(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):k}();c===k||H.ka(c,a);return c};
-H.Na=function (a,b){var c=function(){var c=H.ma(b,a,7);if(c){for(var e=c.snapshotLength,f=[],j=0;j<e;++j)f.push(c.snapshotItem(j));return f}return b.selectNodes?(c=D(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();La(c,function (b){H.ka(b,a)});return c};var nb,ob="",pb=/Firefox\/([0-9.]+)/.exec(ua());nb=ob=pb?pb[2]||pb[1]:"";var qb=k,rb=function(){var a=q.Components;if(!a)return l;try{if(!a.classes)return l}catch(b){return l}var c=a.classes,a=a.interfaces,d=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),e=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;qb=function (a){return 0<=d.Ka(e,""+a)};return i}();var I="StopIteration"in q?q.StopIteration:Error("StopIteration");function J(){}J.prototype.next=function(){g(I)};J.prototype.r=function(){return this};function sb(a){if(a instanceof J)return a;if("function"==typeof a.r)return a.r(l);if(ba(a)){var b=0,c=new J;c.next=function(){for(;;){b>=a.length&&g(I);if(b in a)return a[b++];b++}};return c}g(Error("Not implemented"))};function K(a,b,c,d,e){this.o=!!b;a&&L(this,a,d);this.depth=e!=h?e:this.q||0;this.o&&(this.depth*=-1);this.za=!c}x(K,J);p=K.prototype;p.p=k;p.q=0;p.ha=l;function L(a,b,c,d){if(a.p=b)a.q="number"==typeof c?c:1!=a.p.nodeType?0:a.o?-1:1;"number"==typeof d&&(a.depth=d)}
-p.next=function(){var a;if(this.ha){(!this.p||this.za&&0==this.depth)&&g(I);a=this.p;var b=this.o?-1:1;if(this.q==b){var c=this.o?a.lastChild:a.firstChild;c?L(this,c):L(this,a,-1*b)}else(c=this.o?a.previousSibling:a.nextSibling)?L(this,c):L(this,a.parentNode,-1*b);this.depth+=this.q*(this.o?-1:1)}else this.ha=i;(a=this.p)||g(I);return a};
-p.splice=function (a){var b=this.p,c=this.o?1:-1;this.q==c&&(this.q=-1*c,this.depth+=this.q*(this.o?-1:1));this.o=!this.o;K.prototype.next.call(this);this.o=!this.o;for(var c=ba(arguments[0])?arguments[0]:arguments,d=c.length-1;0<=d;d--)b.parentNode&&b.parentNode.insertBefore(c[d],b.nextSibling);bb(b)};function tb(a,b,c,d){K.call(this,a,b,c,k,d)}x(tb,K);tb.prototype.next=function(){do tb.$.next.call(this);while(-1==this.q);return this.p};function ub(a,b){var c=D(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,k))?c[b]||c.getPropertyValue(b):""}function vb(a,b){return ub(a,b)||(a.currentStyle?a.currentStyle[b]:k)||a.style&&a.style[b]}
-function wb(a){for(var b=D(a),c=vb(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=vb(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return k}
-function xb(a){var b=new B;if(1==a.nodeType)if(a.getBoundingClientRect)a=a.getBoundingClientRect(),b.x=a.left,b.y=a.top;else{var c=mb(Wa(a));var d,e=D(a),f=vb(a,"position"),j=e.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==f&&(d=e.getBoxObjectFor(a))&&(0>d.screenX||0>d.screenY),f=new B(0,0),m=(e?9==e.nodeType?e:D(e):document).documentElement;if(a!=m)if(a.getBoundingClientRect)d=a.getBoundingClientRect(),a=mb(Wa(e)),f.x=d.left+a.x,f.y=d.top+a.y;else if(e.getBoxObjectFor&&!j)d=e.getBoxObjectFor(a),
-a=e.getBoxObjectFor(m),f.x=d.screenX-a.screenX,f.y=d.screenY-a.screenY;else{d=a;do f.x+=d.offsetLeft,f.y+=d.offsetTop,d!=a&&(f.x+=d.clientLeft||0,f.y+=d.clientTop||0),d=d.offsetParent;while(d&&d!=a);for(d=a;(d=wb(d))&&d!=e.body&&d!=m;)f.x-=d.scrollLeft,f.y-=d.scrollTop}b.x=f.x-c.x;b.y=f.y-c.y}else c=w(a.pa),d=a,a.targetTouches?d=a.targetTouches[0]:c&&a.pa().targetTouches&&(d=a.pa().targetTouches[0]),b.x=d.clientX,b.y=d.clientY;return b}
-function yb(a){var b=a.offsetWidth,c=a.offsetHeight;return!r(b)&&a.getBoundingClientRect?(a=a.getBoundingClientRect(),new Va(a.right-a.left,a.bottom-a.top)):new Va(b,c)};function M(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var zb={"class":"className",readonly:"readOnly"},Ab=["checked","disabled","draggable","hidden"];function Bb(a,b){var c=zb[b]||b,d=a[c];if(!r(d)&&0<=A(Ab,c))return l;if(c="value"==b)if(c=M(a,"OPTION")){var e;c=b.toLowerCase();if(a.hasAttribute)e=a.hasAttribute(c);else try{e=a.attributes[c].specified}catch(f){e=l}c=!e}c&&(d=[],kb(a,d,l),d=d.join(""));return d}
-var Cb="async,autofocus,autoplay,checked,compact,complete,controls,declare,defaultchecked,defaultselected,defer,disabled,draggable,ended,formnovalidate,hidden,indeterminate,iscontenteditable,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,paused,pubdate,readonly,required,reversed,scoped,seamless,seeking,selected,spellcheck,truespeed,willvalidate".split(","),Db="BUTTON,INPUT,OPTGROUP,OPTION,SELECT,TEXTAREA".split(",");
-function Eb(a){var b=a.tagName.toUpperCase();return!(0<=A(Db,b))?i:Bb(a,"disabled")?l:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?Eb(a.parentNode):i}var Fb="text,search,tel,url,email,password,number".split(",");function Gb(a){return M(a,"TEXTAREA")?i:M(a,"INPUT")?0<=A(Fb,a.type.toLowerCase()):Hb(a)?i:l}
-function Hb(a){function b(a){return"inherit"==a.contentEditable?(a=Ib(a))?b(a):l:"true"==a.contentEditable}return!r(a.contentEditable)?l:r(a.isContentEditable)?a.isContentEditable:b(a)}function Ib(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return M(a)?a:k}function Jb(a,b){b=ra(b);return ub(a,b)||Kb(a,b)}
-function Kb(a,b){var c=a.currentStyle||a.style,d=c[b];!r(d)&&w(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?r(d)?d:k:(c=Ib(a))?Kb(c,b):k}function Lb(a){if(w(a.getBBox))try{var b=a.getBBox();if(b)return b}catch(c){}if("none"!=vb(a,"display"))a=yb(a);else{var b=a.style,d=b.display,e=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=yb(a);b.display=d;b.position=f;b.visibility=e}return a}
-function Mb(a,b){function c(a){if("none"==Jb(a,"display"))return l;a=Ib(a);return!a||c(a)}function d(a){var b=Lb(a);return 0<b.height&&0<b.width?i:Na(a.childNodes,function (a){return a.nodeType==C||M(a)&&d(a)})}function e(a){var b=Ib(a);if(b&&"hidden"==Jb(b,"overflow")){var c=Lb(b),d=xb(b),a=xb(a);return d.x+c.width<a.x||d.y+c.height<a.y?l:e(b)}return i}M(a)||g(Error("Argument to isShown must be of type Element"));if(M(a,"OPTION")||M(a,"OPTGROUP")){var f=lb(a,function (a){return M(a,"SELECT")});return!!f&&
-Mb(f,i)}if(M(a,"MAP")){if(!a.name)return l;f=D(a);f=f.evaluate?H.Ia('/descendant::*[@usemap = "#'+a.name+'"]',f):gb(f,function (b){var c;if(c=M(b))8==b.nodeType?b=k:(c="usemap","style"==c?(b=ha(b.style.cssText).toLowerCase(),b=";"==b.charAt(b.length-1)?b:b+";"):(b=b.getAttributeNode(c),b=!b?k:0<=A(Cb,c)?"true":b.specified?b.value:k)),c=b=="#"+a.name;return c});return!!f&&Mb(f,b)}return M(a,"AREA")?(f=lb(a,function (a){return M(a,"MAP")}),!!f&&Mb(f,b)):M(a,"INPUT")&&"hidden"==a.type.toLowerCase()||M(a,
-"NOSCRIPT")||"hidden"==Jb(a,"visibility")||!c(a)||!b&&0==Nb(a)||!d(a)||!e(a)?l:i}function Nb(a){var b=1,c=Jb(a,"opacity");c&&(b=Number(c));(a=Ib(a))&&(b*=Nb(a));return b};function N(){this.w=Ca.document.documentElement;this.ua=k;var a=D(this.w).activeElement;a&&Ob(this,a)}N.prototype.z=n("w");function Ob(a,b){a.w=b;a.ua=M(b,"OPTION")?lb(b,function (a){return M(a,"SELECT")}):k}
-function Pb(a,b,c,d,e,f){function j(a,c){var d={identifier:a,screenX:c.x,screenY:c.y,clientX:c.x,clientY:c.y,pageX:c.x,pageY:c.y};m.changedTouches.push(d);if(b==Qb||b==Rb)m.touches.push(d),m.targetTouches.push(d)}var m={touches:[],targetTouches:[],changedTouches:[],altKey:l,ctrlKey:l,shiftKey:l,metaKey:l,relatedTarget:k,scale:0,rotation:0};j(c,d);r(e)&&j(e,f);Sb(a.w,b,m)}rb&&rb&&(rb?qb(4):oa(nb,4));rb&&(rb?qb(4):oa(nb,4));function P(a,b,c){this.J=a;this.S=b;this.T=c}P.prototype.create=function (a){a=D(a).createEvent("HTMLEvents");a.initEvent(this.J,this.S,this.T);return a};P.prototype.toString=n("J");function Q(a,b,c){P.call(this,a,b,c)}x(Q,P);
-Q.prototype.create=function (a,b){var c=D(a),d=F(c),c=c.createEvent("MouseEvents"),e=1;this==Tb&&(e=b.wheelDelta/-40);this==Ub&&(e=b.wheelDelta);c.initMouseEvent(this.J,this.S,this.T,d,e,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);return c};function Vb(a,b,c){P.call(this,a,b,c)}x(Vb,P);
-Vb.prototype.create=function (a,b){var c=D(a),d=F(c),e=b.charCode?0:b.keyCode,c=c.createEvent("KeyboardEvent");c.initKeyEvent(this.J,this.S,this.T,d,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,e,b.charCode);this.J==Wb&&b.preventDefault&&c.preventDefault();return c};function Xb(a,b,c){P.call(this,a,b,c)}x(Xb,P);
-Xb.prototype.create=function (a,b){function c(b){var c=Ma(b,function (b){return{identifier:b.identifier,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY,target:a}});c.item=function (a){return c[a]};return c}var d=D(a),e=F(d),f=c(b.changedTouches),j=b.touches==b.changedTouches?f:c(b.touches),m=b.targetTouches==b.changedTouches?f:c(b.targetTouches),d=d.createEvent("MouseEvents");d.initMouseEvent(this.J,this.S,this.T,e,1,0,0,b.clientX,b.clientY,b.ctrlKey,
-b.altKey,b.shiftKey,b.metaKey,0,b.relatedTarget);d.touches=j;d.targetTouches=m;d.changedTouches=f;d.scale=b.scale;d.rotation=b.rotation;return d};
-var Yb=new P("change",i,l),Zb=new Q("click",i,i),$b=new Q("contextmenu",i,i),ac=new Q("dblclick",i,i),bc=new Q("mousedown",i,i),cc=new Q("mousemove",i,l),dc=new Q("mouseout",i,i),ec=new Q("mouseover",i,i),fc=new Q("mouseup",i,i),Tb=new Q("DOMMouseScroll",i,i),Ub=new Q("MozMousePixelScroll",i,i),Wb=new Vb("keypress",i,i),Rb=new Xb("touchmove",i,i),Qb=new Xb("touchstart",i,i);function Sb(a,b,c){b=b.create(a,c);"isTrusted"in b||(b.La=l);a.dispatchEvent(b)};function gc(a){if("function"==typeof a.L)return a.L();if(t(a))return a.split("");if(ba(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Ea(a)};function hc(a,b){this.n={};this.ta={};var c=arguments.length;if(1<c){c%2&&g(Error("Uneven number of arguments"));for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.aa(a)}p=hc.prototype;p.ia=0;p.L=function(){var a=[],b;for(b in this.n)":"==b.charAt(0)&&a.push(this.n[b]);return a};function ic(a){var b=[],c;for(c in a.n)if(":"==c.charAt(0)){var d=c.substring(1);b.push(a.ta[c]?Number(d):d)}return b}
-p.set=function (a,b){var c=":"+a;c in this.n||(this.ia++,"number"==typeof a&&(this.ta[c]=i));this.n[c]=b};p.aa=function (a){var b;if(a instanceof hc)b=ic(a),a=a.L();else{b=[];var c=0,d;for(d in a)b[c++]=d;a=Ea(a)}for(c=0;c<b.length;c++)this.set(b[c],a[c])};p.r=function (a){var b=0,c=ic(this),d=this.n,e=this.ia,f=this,j=new J;j.next=function(){for(;;){e!=f.ia&&g(Error("The map has changed since the iterator was created"));b>=c.length&&g(I);var j=c[b++];return a?j:d[":"+j]}};return j};function jc(a){this.n=new hc;a&&this.aa(a)}function kc(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[da]||(a[da]=++ea)):b.substr(0,1)+a}p=jc.prototype;p.add=function (a){this.n.set(kc(a),a)};p.aa=function (a){for(var a=gc(a),b=a.length,c=0;c<b;c++)this.add(a[c])};p.contains=function (a){return":"+kc(a)in this.n.n};p.L=function(){return this.n.L()};p.r=function(){return this.n.r(l)};function lc(){N.call(this);Gb(this.z())&&Bb(this.z(),"readOnly");this.Ha=new jc}x(lc,N);var mc={};function R(a,b,c){ca(a)&&(a=a.c);a=new nc(a);if(b&&(!(b in mc)||c))mc[b]={key:a,shift:l},c&&(mc[c]={key:a,shift:i})}function nc(a){this.code=a}R(8);R(9);R(13);R(16);R(17);R(18);R(19);R(20);R(27);R(32," ");R(33);R(34);R(35);R(36);R(37);R(38);R(39);R(40);R(44);R(45);R(46);R(48,"0",")");R(49,"1","!");R(50,"2","@");R(51,"3","#");R(52,"4","$");R(53,"5","%");R(54,"6","^");R(55,"7","&");R(56,"8","*");
-R(57,"9","(");R(65,"a","A");R(66,"b","B");R(67,"c","C");R(68,"d","D");R(69,"e","E");R(70,"f","F");R(71,"g","G");R(72,"h","H");R(73,"i","I");R(74,"j","J");R(75,"k","K");R(76,"l","L");R(77,"m","M");R(78,"n","N");R(79,"o","O");R(80,"p","P");R(81,"q","Q");R(82,"r","R");R(83,"s","S");R(84,"t","T");R(85,"u","U");R(86,"v","V");R(87,"w","W");R(88,"x","X");R(89,"y","Y");R(90,"z","Z");R(ta?{c:91,e:91,opera:219}:sa?{c:224,e:91,opera:17}:{c:0,e:91,opera:k});
-R(ta?{c:92,e:92,opera:220}:sa?{c:224,e:93,opera:17}:{c:0,e:92,opera:k});R(ta?{c:93,e:93,opera:0}:sa?{c:0,e:0,opera:16}:{c:93,e:k,opera:0});R({c:96,e:96,opera:48},"0");R({c:97,e:97,opera:49},"1");R({c:98,e:98,opera:50},"2");R({c:99,e:99,opera:51},"3");R({c:100,e:100,opera:52},"4");R({c:101,e:101,opera:53},"5");R({c:102,e:102,opera:54},"6");R({c:103,e:103,opera:55},"7");R({c:104,e:104,opera:56},"8");R({c:105,e:105,opera:57},"9");R({c:106,e:106,opera:xa?56:42},"*");R({c:107,e:107,opera:xa?61:43},"+");
-R({c:109,e:109,opera:xa?109:45},"-");R({c:110,e:110,opera:xa?190:78},".");R({c:111,e:111,opera:xa?191:47},"/");R(144);R(112);R(113);R(114);R(115);R(116);R(117);R(118);R(119);R(120);R(121);R(122);R(123);R({c:107,e:187,opera:61},"=","+");R({c:109,e:189,opera:109},"-","_");R(188,",","<");R(190,".",">");R(191,"/","?");R(192,"`","~");R(219,"[","{");R(220,"\\","|");R(221,"]","}");R({c:59,e:186,opera:59},";",":");R(222,"'",'"');lc.prototype.X=function (a){return this.Ha.contains(a)};function oc(a){return pc(a||arguments.callee.caller,[])}
-function pc(a,b){var c=[];if(0<=A(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(qc(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){0<e&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":break;case "number":f=""+f;break;case "boolean":f=f?"true":"false";break;case "function":f=(f=qc(f))?f:"[fn]";break;default:f=typeof f}40<f.length&&(f=f.substr(0,40)+"...");c.push(f)}b.push(a);c.push(")\n");try{c.push(pc(a.caller,b))}catch(j){c.push("[exception trying to get caller]\n")}}else a?
-c.push("[...long stack...]"):c.push("[end]");return c.join("")}function qc(a){if(rc[a])return rc[a];a=""+a;if(!rc[a]){var b=/function ([^\(]+)/.exec(a);rc[a]=b?b[1]:"[Anonymous]"}return rc[a]}var rc={};function sc(a,b,c,d,e){this.reset(a,b,c,d,e)}sc.prototype.oa=k;sc.prototype.na=k;var tc=0;sc.prototype.reset=function (a,b,c,d,e){"number"==typeof e||tc++;d||fa();this.N=a;this.Fa=b;delete this.oa;delete this.na};sc.prototype.va=function (a){this.N=a};function S(a){this.Ga=a}S.prototype.Y=k;S.prototype.N=k;S.prototype.ba=k;S.prototype.ra=k;function uc(a,b){this.name=a;this.value=b}uc.prototype.toString=n("name");var vc=new uc("WARNING",900),wc=new uc("CONFIG",700);S.prototype.getParent=n("Y");S.prototype.va=function (a){this.N=a};function xc(a){if(a.N)return a.N;if(a.Y)return xc(a.Y);Ja("Root logger has no level set.");return k}
-S.prototype.log=function (a,b,c){if(a.value>=xc(this).value){a=this.Ca(a,b,c);b="log:"+a.Fa;q.console&&q.console.timeStamp&&q.console.timeStamp(b);q.msWriteProfilerMark&&q.msWriteProfilerMark(b);for(b=this;b;){var c=b,d=a;if(c.ra)for(var e=0,f=h;f=c.ra[e];e++)f(d);b=b.getParent()}}};
-S.prototype.Ca=function (a,b,c){var d=new sc(a,""+b,this.Ga);if(c){d.oa=c;var e;var f=arguments.callee.caller;try{var j;var m;c:{for(var s=["window","location","href"],O=q,E;E=s.shift();)if(O[E]!=k)O=O[E];else{m=k;break c}m=O}if(t(c))j={message:c,name:"Unknown error",lineNumber:"Not available",fileName:m,stack:"Not available"};else{var u,v,s=l;try{u=c.lineNumber||c.Ma||"Not available"}catch(md){u="Not available",s=i}try{v=c.fileName||c.filename||c.sourceURL||m}catch(nd){v="Not available",s=i}j=s||
-!c.lineNumber||!c.fileName||!c.stack?{message:c.message,name:c.name,lineNumber:u,fileName:v,stack:c.stack||"Not available"}:c}e="Message: "+ia(j.message)+'\nUrl: <a href="view-source:'+j.fileName+'" target="_new">'+j.fileName+"</a>\nLine: "+j.lineNumber+"\n\nBrowser stack:\n"+ia(j.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+ia(oc(f)+"-> ")}catch(kd){e="Exception trying to expose exception! You win, we lose. "+kd}d.na=e}return d};var yc={},zc=k;
-function Ac(a){zc||(zc=new S(""),yc[""]=zc,zc.va(wc));var b;if(!(b=yc[a])){b=new S(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Ac(a.substr(0,c));c.ba||(c.ba={});c.ba[d]=b;b.Y=c;yc[a]=b}return b};function Bc(){}x(Bc,function(){});Ac("goog.dom.SavedRange");x(function (a){this.Ja="goog_"+pa++;this.Aa="goog_"+pa++;this.la=Wa(a.ea());a.R(this.la.da("SPAN",{id:this.Ja}),this.la.da("SPAN",{id:this.Aa}))},Bc);function T(){}function Cc(a){if(a.getSelection)return a.getSelection();var a=a.document,b=a.selection;if(b){try{var c=b.createRange();if(c.parentElement){if(c.parentElement().document!=a)return k}else if(!c.length||c.item(0).document!=a)return k}catch(d){return k}return b}return k}function Dc(a){for(var b=[],c=0,d=a.D();c<d;c++)b.push(a.A(c));return b}T.prototype.F=o(l);T.prototype.ea=function(){return D(this.b())};T.prototype.qa=function(){return F(this.ea())};
-T.prototype.containsNode=function (a,b){return this.u(Ec(Fc(a),h),b)};function U(a,b){K.call(this,a,b,i)}x(U,K);function V(){}x(V,T);V.prototype.u=function (a,b){var c=Dc(this),d=Dc(a);return(b?Na:Oa)(d,function (a){return Na(c,function (c){return c.u(a,b)})})};V.prototype.insertNode=function (a,b){if(b){var c=this.b();c.parentNode&&c.parentNode.insertBefore(a,c)}else c=this.g(),c.parentNode&&c.parentNode.insertBefore(a,c.nextSibling);return a};V.prototype.R=function (a,b){this.insertNode(a,i);this.insertNode(b,l)};function Gc(a,b,c,d,e){var f;if(a&&(this.f=a,this.i=b,this.d=c,this.h=d,1==a.nodeType&&"BR"!=a.tagName&&(a=a.childNodes,(b=a[b])?(this.f=b,this.i=0):(a.length&&(this.f=z(a)),f=i)),1==c.nodeType))(this.d=c.childNodes[d])?this.h=0:this.d=c;U.call(this,e?this.d:this.f,e);if(f)try{this.next()}catch(j){j!=I&&g(j)}}x(Gc,U);p=Gc.prototype;p.f=k;p.d=k;p.i=0;p.h=0;p.b=n("f");p.g=n("d");p.M=function(){return this.ha&&this.p==this.d&&(!this.h||1!=this.q)};p.next=function(){this.M()&&g(I);return Gc.$.next.call(this)};"ScriptEngine"in q&&"JScript"==q.ScriptEngine()&&(q.ScriptEngineMajorVersion(),q.ScriptEngineMinorVersion(),q.ScriptEngineBuildVersion());function Hc(){}Hc.prototype.u=function (a,b){var c=b&&!a.isCollapsed(),d=a.a;try{return c?0<=this.l(d,0,1)&&0>=this.l(d,1,0):0<=this.l(d,0,0)&&0>=this.l(d,1,1)}catch(e){g(e)}};Hc.prototype.containsNode=function (a,b){return this.u(Fc(a),b)};Hc.prototype.r=function(){return new Gc(this.b(),this.j(),this.g(),this.k())};function Ic(a){this.a=a}x(Ic,Hc);p=Ic.prototype;p.C=function(){return this.a.commonAncestorContainer};p.b=function(){return this.a.startContainer};p.j=function(){return this.a.startOffset};p.g=function(){return this.a.endContainer};p.k=function(){return this.a.endOffset};p.l=function (a,b,c){return this.a.compareBoundaryPoints(1==c?1==b?q.Range.START_TO_START:q.Range.START_TO_END:1==b?q.Range.END_TO_START:q.Range.END_TO_END,a)};p.isCollapsed=function(){return this.a.collapsed};
-p.select=function (a){this.Z(F(D(this.b())).getSelection(),a)};p.Z=function (a){a.removeAllRanges();a.addRange(this.a)};p.insertNode=function (a,b){var c=this.a.cloneRange();c.collapse(b);c.insertNode(a);c.detach();return a};
-p.R=function (a,b){var c=F(D(this.b()));if(c=(c=Cc(c||window))&&Jc(c))var d=c.b(),e=c.g(),f=c.j(),j=c.k();var m=this.a.cloneRange(),s=this.a.cloneRange();m.collapse(l);s.collapse(i);m.insertNode(b);s.insertNode(a);m.detach();s.detach();if(c){if(d.nodeType==C)for(;f>d.length;){f-=d.length;do d=d.nextSibling;while(d==a||d==b)}if(e.nodeType==C)for(;j>e.length;){j-=e.length;do e=e.nextSibling;while(e==a||e==b)}c=new Kc;c.G=Lc(d,f,e,j);"BR"==d.tagName&&(m=d.parentNode,f=A(m.childNodes,d),d=m);"BR"==e.tagName&&
-(m=e.parentNode,j=A(m.childNodes,e),e=m);c.G?(c.f=e,c.i=j,c.d=d,c.h=f):(c.f=d,c.i=f,c.d=e,c.h=j);c.select()}};p.collapse=function (a){this.a.collapse(a)};function W(a){this.a=a}x(W,Ic);function Fc(a){var b=D(a).createRange();if(a.nodeType==C)b.setStart(a,0),b.setEnd(a,a.length);else if(X(a)){for(var c,d=a;(c=d.firstChild)&&X(c);)d=c;b.setStart(d,0);for(d=a;(c=d.lastChild)&&X(c);)d=c;b.setEnd(d,1==d.nodeType?d.childNodes.length:d.length)}else c=a.parentNode,a=A(c.childNodes,a),b.setStart(c,a),b.setEnd(c,a+1);return new W(b)}
-W.prototype.Z=function (a,b){var c=b?this.g():this.b(),d=b?this.k():this.j(),e=b?this.b():this.g(),f=b?this.j():this.k();a.collapse(c,d);(c!=e||d!=f)&&a.extend(e,f)};function Mc(a){this.a=a}x(Mc,Hc);Ac("goog.dom.browserrange.IeRange");function Nc(a){var b=D(a).body.createTextRange();if(1==a.nodeType)b.moveToElementText(a),X(a)&&!a.childNodes.length&&b.collapse(l);else{for(var c=0,d=a;d=d.previousSibling;){var e=d.nodeType;if(e==C)c+=d.length;else if(1==e){b.moveToElementText(d);break}}d||b.moveToElementText(a.parentNode);b.collapse(!d);c&&b.move("character",c);b.moveEnd("character",a.length)}return b}p=Mc.prototype;p.O=k;p.f=k;p.d=k;p.i=-1;p.h=-1;
-p.s=function(){this.O=this.f=this.d=k;this.i=this.h=-1};
-p.C=function(){if(!this.O){var a=this.a.text,b=this.a.duplicate(),c=a.replace(/ +$/,"");(c=a.length-c.length)&&b.moveEnd("character",-c);c=b.parentElement();b=b.htmlText.replace(/(\r\n|\r|\n)+/g," ").length;if(this.isCollapsed()&&0<b)return this.O=c;for(;b>c.outerHTML.replace(/(\r\n|\r|\n)+/g," ").length;)c=c.parentNode;for(;1==c.childNodes.length&&c.innerText==(c.firstChild.nodeType==C?c.firstChild.nodeValue:c.firstChild.innerText)&&X(c.firstChild);)c=c.firstChild;0==a.length&&(c=Oc(this,c));this.O=
-c}return this.O};function Oc(a,b){for(var c=b.childNodes,d=0,e=c.length;d<e;d++){var f=c[d];if(X(f)){var j=Nc(f),m=j.htmlText!=f.outerHTML;if(a.isCollapsed()&&m?0<=a.l(j,1,1)&&0>=a.l(j,1,0):a.a.inRange(j))return Oc(a,f)}}return b}p.b=function(){this.f||(this.f=Pc(this,1),this.isCollapsed()&&(this.d=this.f));return this.f};p.j=function(){0>this.i&&(this.i=Qc(this,1),this.isCollapsed()&&(this.h=this.i));return this.i};
-p.g=function(){if(this.isCollapsed())return this.b();this.d||(this.d=Pc(this,0));return this.d};p.k=function(){if(this.isCollapsed())return this.j();0>this.h&&(this.h=Qc(this,0),this.isCollapsed()&&(this.i=this.h));return this.h};p.l=function (a,b,c){return this.a.compareEndPoints((1==b?"Start":"End")+"To"+(1==c?"Start":"End"),a)};
-function Pc(a,b,c){c=c||a.C();if(!c||!c.firstChild)return c;for(var d=1==b,e=0,f=c.childNodes.length;e<f;e++){var j=d?e:f-e-1,m=c.childNodes[j],s;try{s=Fc(m)}catch(O){continue}var E=s.a;if(a.isCollapsed())if(X(m)){if(s.u(a))return Pc(a,b,m)}else{if(0==a.l(E,1,1)){a.i=a.h=j;break}}else{if(a.u(s)){if(!X(m)){d?a.i=j:a.h=j+1;break}return Pc(a,b,m)}if(0>a.l(E,1,0)&&0<a.l(E,0,1))return Pc(a,b,m)}}return c}
-function Qc(a,b){var c=1==b,d=c?a.b():a.g();if(1==d.nodeType){for(var d=d.childNodes,e=d.length,f=c?1:-1,j=c?0:e-1;0<=j&&j<e;j+=f){var m=d[j];if(!X(m)&&0==a.a.compareEndPoints((1==b?"Start":"End")+"To"+(1==b?"Start":"End"),Fc(m).a))return c?j:j+1}return-1==j?0:j}e=a.a.duplicate();f=Nc(d);e.setEndPoint(c?"EndToEnd":"StartToStart",f);e=e.text.length;return c?d.length-e:e}p.isCollapsed=function(){return 0==this.a.compareEndPoints("StartToEnd",this.a)};p.select=function(){this.a.select()};
-function Rc(a,b,c){var d;d=d||Wa(a.parentElement());var e;1!=b.nodeType&&(e=i,b=d.da("DIV",k,b));a.collapse(c);d=d||Wa(a.parentElement());var f=c=b.id;c||(c=b.id="goog_"+pa++);a.pasteHTML(b.outerHTML);(b=d.z(c))&&(f||b.removeAttribute("id"));if(e){a=b.firstChild;e=b;if((d=e.parentNode)&&11!=d.nodeType)if(e.removeNode)e.removeNode(l);else{for(;b=e.firstChild;)d.insertBefore(b,e);bb(e)}b=a}return b}p.insertNode=function (a,b){var c=Rc(this.a.duplicate(),a,b);this.s();return c};
-p.R=function (a,b){var c=this.a.duplicate(),d=this.a.duplicate();Rc(c,a,i);Rc(d,b,l);this.s()};p.collapse=function (a){this.a.collapse(a);a?(this.d=this.f,this.h=this.i):(this.f=this.d,this.i=this.h)};function Sc(a){this.a=a}x(Sc,Ic);Sc.prototype.Z=function (a){a.collapse(this.b(),this.j());(this.g()!=this.b()||this.k()!=this.j())&&a.extend(this.g(),this.k());0==a.rangeCount&&a.addRange(this.a)};function Tc(a){this.a=a}x(Tc,Ic);Tc.prototype.l=function (a,b,c){return Ba["528"]||(Ba["528"]=0<=oa(ya,"528"))?Tc.$.l.call(this,a,b,c):this.a.compareBoundaryPoints(1==c?1==b?q.Range.START_TO_START:q.Range.END_TO_START:1==b?q.Range.START_TO_END:q.Range.END_TO_END,a)};Tc.prototype.Z=function (a,b){a.removeAllRanges();b?a.setBaseAndExtent(this.g(),this.k(),this.b(),this.j()):a.setBaseAndExtent(this.b(),this.j(),this.g(),this.k())};function X(a){var b;a:if(1!=a.nodeType)b=l;else{switch(a.tagName){case "APPLET":case "AREA":case "BASE":case "BR":case "COL":case "FRAME":case "HR":case "IMG":case "INPUT":case "IFRAME":case "ISINDEX":case "LINK":case "NOFRAMES":case "NOSCRIPT":case "META":case "OBJECT":case "PARAM":case "SCRIPT":case "STYLE":b=l;break a}b=i}return b||a.nodeType==C};function Kc(){}x(Kc,T);function Ec(a,b){var c=new Kc;c.K=a;c.G=!!b;return c}p=Kc.prototype;p.K=k;p.f=k;p.i=k;p.d=k;p.h=k;p.G=l;p.fa=o("text");p.W=function(){return Y(this).a};p.s=function(){this.f=this.i=this.d=this.h=k};p.D=o(1);p.A=function(){return this};function Y(a){var b;if(!(b=a.K)){b=a.b();var c=a.j(),d=a.g(),e=a.k(),f=D(b).createRange();f.setStart(b,c);f.setEnd(d,e);b=a.K=new W(f)}return b}p.C=function(){return Y(this).C()};p.b=function(){return this.f||(this.f=Y(this).b())};
-p.j=function(){return this.i!=k?this.i:this.i=Y(this).j()};p.g=function(){return this.d||(this.d=Y(this).g())};p.k=function(){return this.h!=k?this.h:this.h=Y(this).k()};p.F=n("G");p.u=function (a,b){var c=a.fa();return"text"==c?Y(this).u(Y(a),b):"control"==c?(c=Uc(a),(b?Na:Oa)(c,function (a){return this.containsNode(a,b)},this)):l};p.isCollapsed=function(){return Y(this).isCollapsed()};p.r=function(){return new Gc(this.b(),this.j(),this.g(),this.k())};p.select=function(){Y(this).select(this.G)};
-p.insertNode=function (a,b){var c=Y(this).insertNode(a,b);this.s();return c};p.R=function (a,b){Y(this).R(a,b);this.s()};p.ga=function(){return new Vc(this)};p.collapse=function (a){a=this.F()?!a:a;this.K&&this.K.collapse(a);a?(this.d=this.f,this.h=this.i):(this.f=this.d,this.i=this.h);this.G=l};function Vc(a){a.F()?a.g():a.b();a.F()?a.k():a.j();a.F()?a.b():a.g();a.F()?a.j():a.k()}x(Vc,Bc);function Wc(){}x(Wc,V);p=Wc.prototype;p.a=k;p.m=k;p.Q=k;p.s=function(){this.Q=this.m=k};p.fa=o("control");p.W=function(){return this.a||document.body.createControlRange()};p.D=function(){return this.a?this.a.length:0};p.A=function (a){a=this.a.item(a);return Ec(Fc(a),h)};p.C=function(){return fb.apply(k,Uc(this))};p.b=function(){return Xc(this)[0]};p.j=o(0);p.g=function(){var a=Xc(this),b=z(a);return Pa(a,function (a){return G(a,b)})};p.k=function(){return this.g().childNodes.length};
-function Uc(a){if(!a.m&&(a.m=[],a.a))for(var b=0;b<a.a.length;b++)a.m.push(a.a.item(b));return a.m}function Xc(a){a.Q||(a.Q=Uc(a).concat(),a.Q.sort(function (a,c){return a.sourceIndex-c.sourceIndex}));return a.Q}p.isCollapsed=function(){return!this.a||!this.a.length};p.r=function(){return new Yc(this)};p.select=function(){this.a&&this.a.select()};p.ga=function(){return new Zc(this)};p.collapse=function(){this.a=k;this.s()};function Zc(a){this.m=Uc(a)}x(Zc,Bc);
-function Yc(a){a&&(this.m=Xc(a),this.f=this.m.shift(),this.d=z(this.m)||this.f);U.call(this,this.f,l)}x(Yc,U);p=Yc.prototype;p.f=k;p.d=k;p.m=k;p.b=n("f");p.g=n("d");p.M=function(){return!this.depth&&!this.m.length};p.next=function(){this.M()&&g(I);if(!this.depth){var a=this.m.shift();L(this,a,1,1);return a}return Yc.$.next.call(this)};function $c(){this.t=[];this.P=[];this.U=this.I=k}x($c,V);p=$c.prototype;p.Ea=Ac("goog.dom.MultiRange");p.s=function(){this.P=[];this.U=this.I=k};p.fa=o("mutli");p.W=function(){1<this.t.length&&this.Ea.log(vc,"getBrowserRangeObject called on MultiRange with more than 1 range",h);return this.t[0]};p.D=function(){return this.t.length};p.A=function (a){this.P[a]||(this.P[a]=Ec(new W(this.t[a]),h));return this.P[a]};
-p.C=function(){if(!this.U){for(var a=[],b=0,c=this.D();b<c;b++)a.push(this.A(b).C());this.U=fb.apply(k,a)}return this.U};function ad(a){a.I||(a.I=Dc(a),a.I.sort(function (a,c){var d=a.b(),e=a.j(),f=c.b(),j=c.j();return d==f&&e==j?0:Lc(d,e,f,j)?1:-1}));return a.I}p.b=function(){return ad(this)[0].b()};p.j=function(){return ad(this)[0].j()};p.g=function(){return z(ad(this)).g()};p.k=function(){return z(ad(this)).k()};p.isCollapsed=function(){return 0==this.t.length||1==this.t.length&&this.A(0).isCollapsed()};
-p.r=function(){return new bd(this)};p.select=function(){var a=Cc(this.qa());a.removeAllRanges();for(var b=0,c=this.D();b<c;b++)a.addRange(this.A(b).W())};p.ga=function(){return new cd(this)};p.collapse=function (a){if(!this.isCollapsed()){var b=a?this.A(0):this.A(this.D()-1);this.s();b.collapse(a);this.P=[b];this.I=[b];this.t=[b.W()]}};function cd(a){Ma(Dc(a),function (a){return a.ga()})}x(cd,Bc);function bd(a){a&&(this.H=Ma(ad(a),function (a){return sb(a)}));U.call(this,a?this.b():k,l)}x(bd,U);p=bd.prototype;
-p.H=k;p.V=0;p.b=function(){return this.H[0].b()};p.g=function(){return z(this.H).g()};p.M=function(){return this.H[this.V].M()};p.next=function(){try{var a=this.H[this.V],b=a.next();L(this,a.p,a.q,a.depth);return b}catch(c){return(c!==I||this.H.length-1==this.V)&&g(c),this.V++,this.next()}};function Jc(a){var b,c=l;if(a.createRange)try{b=a.createRange()}catch(d){return k}else if(a.rangeCount){if(1<a.rangeCount){b=new $c;for(var c=0,e=a.rangeCount;c<e;c++)b.t.push(a.getRangeAt(c));return b}b=a.getRangeAt(0);c=Lc(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)}else return k;b&&b.addElement?(a=new Wc,a.a=b):a=Ec(new W(b),c);return a}
-function Lc(a,b,c,d){if(a==c)return d<b;var e;if(1==a.nodeType&&b)if(e=a.childNodes[b])a=e,b=0;else if(G(a,c))return i;if(1==c.nodeType&&d)if(e=c.childNodes[d])c=e,d=0;else if(G(c,a))return l;return 0<(cb(a,c)||b-d)};function dd(){N.call(this);this.ja=k;this.B=new B(0,0);this.sa=l}x(dd,N);var Z={};Z[Zb]=[0,1,2,k];Z[$b]=[k,k,2,k];Z[fc]=[0,1,2,k];Z[dc]=[0,0,0,0];Z[cc]=[0,0,0,0];Z[ac]=Z[Zb];Z[bc]=Z[fc];Z[ec]=Z[dc];dd.prototype.move=function (a,b){var c=xb(a);this.B.x=b.x+c.x;this.B.y=b.y+c.y;a!=this.z()&&(c=this.z()===Ca.document.documentElement||this.z()===Ca.document.body,c=!this.sa&&c?k:this.z(),ed(this,dc,a),Ob(this,a),ed(this,ec,c));ed(this,cc)};
-function ed(a,b,c){a.sa=i;var d=a.B,e;b in Z?(e=Z[b][a.ja===k?3:a.ja],e===k&&g(new y(13,"Event does not permit the specified mouse button."))):e=0;Mb(a.w,i)&&Eb(a.w)&&(c&&!(ec==b||dc==b)&&g(new y(12,"Event type does not allow related target: "+b)),c={clientX:d.x,clientY:d.y,button:e,altKey:l,ctrlKey:l,shiftKey:l,metaKey:l,wheelDelta:0,relatedTarget:c||k},(a=a.w)&&Sb(a,b,c))};function fd(){N.call(this);this.B=new B(0,0);this.ca=new B(0,0)}x(fd,N);fd.prototype.xa=0;fd.prototype.wa=0;fd.prototype.move=function (a,b,c){this.X()||Ob(this,a);a=xb(a);this.B.x=b.x+a.x;this.B.y=b.y+a.y;r(c)&&(this.ca.x=c.x+a.x,this.ca.y=c.y+a.y);if(this.X()){b=Rb;this.X()||g(new y(13,"Should never fire event when touchscreen is not pressed."));var d,e;this.wa&&(d=this.wa,e=this.ca);Pb(this,b,this.xa,this.B,d,e)}};fd.prototype.X=function(){return!!this.xa};function gd(a,b){this.x=a;this.y=b}x(gd,B);gd.prototype.scale=function (a){this.x*=a;this.y*=a;return this};gd.prototype.add=function (a){this.x+=a.x;this.y+=a.y;return this};function hd(){N.call(this)}x(hd,N);(function (a){a.Ba=function(){return a.Da||(a.Da=new a)}})(hd);function id(a){(!Mb(a,i)||!Eb(a))&&g(new y(12,"Element is not currently interactable and may not be manipulated"));(!Gb(a)||Bb(a,"readOnly"))&&g(new y(12,"Element must be user-editable in order to clear it."));var b=hd.Ba();Ob(b,a);var b=b.ua||b.w,c=D(b).activeElement;if(b!=c){if(c&&w(c.blur))try{c.blur()}catch(d){g(d)}w(b.focus)&&b.focus()}a.value&&(a.value="",Sb(a,Yb));Hb(a)&&(a.innerHTML=" ")}var jd=["_"],$=q;!(jd[0]in $)&&$.execScript&&$.execScript("var "+jd[0]);
-for(var ld;jd.length&&(ld=jd.shift());)!jd.length&&r(id)?$[ld]=id:$=$[ld]?$[ld]:$[ld]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/domcore.js#L57
-atom.getElementAttribute = function (element, name, window){return function(){var f=null,g=!1,h=this;
-function i(a){var c=typeof a;if("object"==c)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if("[object Window]"==b)return"object";if("[object Array]"==b||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==b||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
-c&&"undefined"==typeof a.call)return"object";return c}function j(a,c){function b(){}b.prototype=c.prototype;a.f=c.prototype;a.prototype=new b};function k(a,c){for(var b=1;b<arguments.length;b++)var d=(""+arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function l(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};var m,n="",o=/rv\:([^\);]+)(\)|;)/.exec(h.navigator?h.navigator.userAgent:f);m=n=o?o[1]:"";var p={};function q(a,c){this.code=a;this.message=c||"";this.name=r[a]||r[13];var b=Error(this.message);b.name=this.name;this.stack=b.stack||""}j(q,Error);
-var r={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",33:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
-q.prototype.toString=function(){return"["+this.name+"] "+this.message};function s(a){this.stack=Error().stack||"";a&&(this.message=""+a)}j(s,Error);s.prototype.name="CustomError";function t(a,c){c.unshift(a);s.call(this,k.apply(f,c));c.shift()}j(t,s);t.prototype.name="AssertionError";function u(a,c){if("string"==typeof a)return"string"!=typeof c||1!=c.length?-1:a.indexOf(c,0);for(var b=0;b<a.length;b++)if(b in a&&a[b]===c)return b;return-1};if(!p["1.9.1"]){for(var v=0,w=l(""+m).split("."),x=l("1.9.1").split("."),y=Math.max(w.length,x.length),z=0;0==v&&z<y;z++){var A=w[z]||"",B=x[z]||"",C=RegExp("(\\d*)(\\D*)","g"),D=RegExp("(\\d*)(\\D*)","g");do{var E=C.exec(A)||["","",""],F=D.exec(B)||["","",""];if(0==E[0].length&&0==F[0].length)break;v=((0==E[1].length?0:parseInt(E[1],10))<(0==F[1].length?0:parseInt(F[1],10))?-1:(0==E[1].length?0:parseInt(E[1],10))>(0==F[1].length?0:parseInt(F[1],10))?1:0)||((0==E[2].length)<(0==F[2].length)?-1:(0==
-E[2].length)>(0==F[2].length)?1:0)||(E[2]<F[2]?-1:E[2]>F[2]?1:0)}while(0==v)}p["1.9.1"]=0<=v};var G={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},H={IMG:" ",BR:"\n"};function I(a,c,b){if(!(a.nodeName in G))if(3==a.nodeType)b?c.push((""+a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):c.push(a.nodeValue);else if(a.nodeName in H)c.push(H[a.nodeName]);else for(a=a.firstChild;a;)I(a,c,b),a=a.nextSibling};(function(){var a=h.Components;if(!a)return g;try{if(!a.classes)return g}catch(c){return g}var b=a.classes,a=a.interfaces;b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return!0})();var J="StopIteration"in h?h.StopIteration:Error("StopIteration");function K(){}K.prototype.next=function(){throw J;};function L(a,c,b,d,e){this.a=!!c;a&&M(this,a,d);this.depth=void 0!=e?e:this.c||0;this.a&&(this.depth*=-1);this.e=!b}j(L,K);L.prototype.b=f;L.prototype.c=0;L.prototype.d=g;function M(a,c,b){if(a.b=c)a.c="number"==typeof b?b:1!=a.b.nodeType?0:a.a?-1:1}
-L.prototype.next=function(){var a;if(this.d){if(!this.b||this.e&&0==this.depth)throw J;a=this.b;var c=this.a?-1:1;if(this.c==c){var b=this.a?a.lastChild:a.firstChild;b?M(this,b):M(this,a,-1*c)}else(b=this.a?a.previousSibling:a.nextSibling)?M(this,b):M(this,a.parentNode,-1*c);this.depth+=this.c*(this.a?-1:1)}else this.d=!0;a=this.b;if(!this.b)throw J;return a};
-L.prototype.splice=function (a){var c=this.b,b=this.a?1:-1;this.c==b&&(this.c=-1*b,this.depth+=this.c*(this.a?-1:1));this.a=!this.a;L.prototype.next.call(this);this.a=!this.a;for(var b=arguments[0],d=i(b),b="array"==d||"object"==d&&"number"==typeof b.length?arguments[0]:arguments,d=b.length-1;0<=d;d--)c.parentNode&&c.parentNode.insertBefore(b[d],c.nextSibling);c&&c.parentNode&&c.parentNode.removeChild(c)};function N(a,c,b,d){L.call(this,a,c,b,f,d)}j(N,L);N.prototype.next=function(){do N.f.next.call(this);while(-1==this.c);return this.b};function O(a,c){return!!a&&1==a.nodeType&&(!c||a.tagName.toUpperCase()==c)}function P(a){return O(a,"OPTION")?!0:O(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):g}var Q={"class":"className",readonly:"readOnly"},R=["checked","disabled","draggable","hidden"];
-function S(a,c){var b=Q[c]||c,d=a[b];if(void 0===d&&0<=u(R,b))return g;if(b="value"==c)if(b=O(a,"OPTION")){var e;b=c.toLowerCase();if(a.hasAttribute)e=a.hasAttribute(b);else try{e=a.attributes[b].specified}catch(Y){e=g}b=!e}b&&(d=[],I(a,d,g),d=d.join(""));return d}var T="async,autofocus,autoplay,checked,compact,complete,controls,declare,defaultchecked,defaultselected,defer,disabled,draggable,ended,formnovalidate,hidden,indeterminate,iscontenteditable,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,paused,pubdate,readonly,required,reversed,scoped,seamless,seeking,selected,spellcheck,truespeed,willvalidate".split(",");
-function U(a,c){if(8==a.nodeType)return f;c=c.toLowerCase();if("style"==c){var b=l(a.style.cssText).toLowerCase();return b=";"==b.charAt(b.length-1)?b:b+";"}b=a.getAttributeNode(c);return!b?f:0<=u(T,c)?"true":b.specified?b.value:f};function V(a,c){var b=f,d=c.toLowerCase();if("style"==c.toLowerCase()){if((b=a.style)&&"string"!=typeof b)b=b.cssText;return b}if("selected"==d||"checked"==d&&P(a)){if(!P(a))throw new q(15,"Element is not selectable");var e="selected",d=a.type&&a.type.toLowerCase();if("checkbox"==d||"radio"==d)e="checked";return S(a,e)?"true":f}b=O(a,"A");if(O(a,"IMG")&&"src"==d||b&&"href"==d)return(b=U(a,d))&&(b=S(a,d)),b;try{e=S(a,c)}catch(Y){}if(!(d=e==f))d=i(e),d="object"==d||"array"==d||"function"==d;b=d?U(a,
-c):e;return b!=f?b.toString():f}var W=["_"],X=h;!(W[0]in X)&&X.execScript&&X.execScript("var "+W[0]);for(var Z;W.length&&(Z=W.shift());)!W.length&&void 0!==V?X[Z]=V:X=X[Z]?X[Z]:X[Z]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js#L979
-atom.getElementText = function (element, window){return function(){var g=void 0,h=!0,i=null,j=!1,k=this;
-function l(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
-else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function m(a){return"string"==typeof a}function n(a,b){function c(){}c.prototype=b.prototype;a.h=b.prototype;a.prototype=new c};function o(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}function aa(a,b){for(var c=1;c<arguments.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function p(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}var q={};function ba(a){return q[a]||(q[a]=(""+a).replace(/\-([a-z])/g,function (a,c){return c.toUpperCase()}))};var s,ca="",u=/rv\:([^\);]+)(\)|;)/.exec(k.navigator?k.navigator.userAgent:i);s=ca=u?u[1]:"";var v={};var da=window;function w(a,b){this.code=a;this.message=b||"";this.name=x[a]||x[13];var c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(w,Error);
-var x={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",33:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
-w.prototype.toString=function(){return"["+this.name+"] "+this.message};function y(a){this.stack=Error().stack||"";a&&(this.message=""+a)}n(y,Error);y.prototype.name="CustomError";function z(a,b){b.unshift(a);y.call(this,aa.apply(i,b));b.shift()}n(z,y);z.prototype.name="AssertionError";function ea(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(g,d[e],e,a)}function fa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(g,d[e],e,a))return h;return j}function A(a,b){var c;a:if(m(a))c=!m(b)||1!=b.length?-1:a.indexOf(b,0);else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c};var B;
-if(!v["1.9.1"]){for(var C=0,D=p(""+s).split("."),E=p("1.9.1").split("."),ga=Math.max(D.length,E.length),F=0;0==C&&F<ga;F++){var ha=D[F]||"",ia=E[F]||"",ja=RegExp("(\\d*)(\\D*)","g"),ka=RegExp("(\\d*)(\\D*)","g");do{var G=ja.exec(ha)||["","",""],H=ka.exec(ia)||["","",""];if(0==G[0].length&&0==H[0].length)break;C=((0==G[1].length?0:parseInt(G[1],10))<(0==H[1].length?0:parseInt(H[1],10))?-1:(0==G[1].length?0:parseInt(G[1],10))>(0==H[1].length?0:parseInt(H[1],10))?1:0)||((0==G[2].length)<(0==H[2].length)?-1:
-(0==G[2].length)>(0==H[2].length)?1:0)||(G[2]<H[2]?-1:G[2]>H[2]?1:0)}while(0==C)}v["1.9.1"]=0<=C};function I(a,b){this.x=a!==g?a:0;this.y=b!==g?b:0}I.prototype.toString=function(){return"("+this.x+", "+this.y+")"};function J(a,b){this.width=a;this.height=b}J.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};var K=3;function L(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function la(a,b){var c=[];return M(a,b,c,h)?c[0]:g}function M(a,b,c,d){if(a!=i)for(a=a.firstChild;a;){if(b(a)&&(c.push(a),d)||M(a,b,c,d))return h;a=a.nextSibling}return j}function ma(a,b){for(var a=a.parentNode,c=0;a;){if(b(a))return a;a=a.parentNode;c++}return i}function N(a){this.g=a||k.document||document}
-function na(a){var b=a.g,a="CSS1Compat"==b.compatMode?b.documentElement:b.body,b=b.parentWindow||b.defaultView;return new I(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)};var oa=function(){var a={i:"http://www.w3.org/2000/svg"};return function (b){return a[b]||i}}();
-function pa(a,b){var c=function(){var c;a:{var e=L(b);if(e.implementation.hasFeature("XPath","3.0")){try{var f=e.createNSResolver?e.createNSResolver(e.documentElement):oa;c=e.evaluate(a,b,f,9,i);break a}catch(r){if("NS_ERROR_ILLEGAL_VALUE"!=r.name)throw new w(32,"Unable to locate an element with the xpath expression "+a+" because of the following error:\n"+r);}c=g}else c=i}return c?c.singleNodeValue||i:b.selectSingleNode?(c=L(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):
-i}();if(c!==i&&(!c||1!=c.nodeType))throw new w(32,'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");return c};(function(){var a=k.Components;if(!a)return j;try{if(!a.classes)return j}catch(b){return j}var c=a.classes,a=a.interfaces;c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return h})();var P="StopIteration"in k?k.StopIteration:Error("StopIteration");function qa(){}qa.prototype.next=function(){throw P;};function Q(a,b,c,d,e){this.a=!!b;a&&R(this,a,d);this.depth=e!=g?e:this.c||0;this.a&&(this.depth*=-1);this.f=!c}n(Q,qa);Q.prototype.b=i;Q.prototype.c=0;Q.prototype.e=j;function R(a,b,c){if(a.b=b)a.c="number"==typeof c?c:1!=a.b.nodeType?0:a.a?-1:1}
-Q.prototype.next=function(){var a;if(this.e){if(!this.b||this.f&&0==this.depth)throw P;a=this.b;var b=this.a?-1:1;if(this.c==b){var c=this.a?a.lastChild:a.firstChild;c?R(this,c):R(this,a,-1*b)}else(c=this.a?a.previousSibling:a.nextSibling)?R(this,c):R(this,a.parentNode,-1*b);this.depth+=this.c*(this.a?-1:1)}else this.e=h;a=this.b;if(!this.b)throw P;return a};
-Q.prototype.splice=function (a){var b=this.b,c=this.a?1:-1;this.c==c&&(this.c=-1*c,this.depth+=this.c*(this.a?-1:1));this.a=!this.a;Q.prototype.next.call(this);this.a=!this.a;for(var c=arguments[0],d=l(c),c="array"==d||"object"==d&&"number"==typeof c.length?arguments[0]:arguments,d=c.length-1;0<=d;d--)b.parentNode&&b.parentNode.insertBefore(c[d],b.nextSibling);b&&b.parentNode&&b.parentNode.removeChild(b)};function S(a,b,c,d){Q.call(this,a,b,c,i,d)}n(S,Q);S.prototype.next=function(){do S.h.next.call(this);while(-1==this.c);return this.b};function ra(a,b){var c=L(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,i))?c[b]||c.getPropertyValue(b):""}function T(a,b){return ra(a,b)||(a.currentStyle?a.currentStyle[b]:i)||a.style&&a.style[b]}
-function sa(a){for(var b=L(a),c=T(a,"position"),d="fixed"==c||"absolute"==c,a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=T(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return i}
-function ta(a){var b=new I;if(1==a.nodeType)if(a.getBoundingClientRect)a=a.getBoundingClientRect(),b.x=a.left,b.y=a.top;else{var c=na(a?new N(L(a)):B||(B=new N));var d,e=L(a),f=T(a,"position"),r=e.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==f&&(d=e.getBoxObjectFor(a))&&(0>d.screenX||0>d.screenY),f=new I(0,0),t=(e?9==e.nodeType?e:L(e):document).documentElement;if(a!=t)if(a.getBoundingClientRect)d=a.getBoundingClientRect(),a=na(e?new N(L(e)):B||(B=new N)),f.x=d.left+a.x,f.y=d.top+a.y;else if(e.getBoxObjectFor&&
-!r)d=e.getBoxObjectFor(a),a=e.getBoxObjectFor(t),f.x=d.screenX-a.screenX,f.y=d.screenY-a.screenY;else{d=a;do f.x+=d.offsetLeft,f.y+=d.offsetTop,d!=a&&(f.x+=d.clientLeft||0,f.y+=d.clientTop||0),d=d.offsetParent;while(d&&d!=a);for(d=a;(d=sa(d))&&d!=e.body&&d!=t;)f.x-=d.scrollLeft,f.y-=d.scrollTop}b.x=f.x-c.x;b.y=f.y-c.y}else c="function"==l(a.d),d=a,a.targetTouches?d=a.targetTouches[0]:c&&a.d().targetTouches&&(d=a.d().targetTouches[0]),b.x=d.clientX,b.y=d.clientY;return b}
-function ua(a){var b=a.offsetWidth,c=a.offsetHeight;return b===g&&a.getBoundingClientRect?(a=a.getBoundingClientRect(),new J(a.right-a.left,a.bottom-a.top)):new J(b,c)};function U(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var va="async,autofocus,autoplay,checked,compact,complete,controls,declare,defaultchecked,defaultselected,defer,disabled,draggable,ended,formnovalidate,hidden,indeterminate,iscontenteditable,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,paused,pubdate,readonly,required,reversed,scoped,seamless,seeking,selected,spellcheck,truespeed,willvalidate".split(",");
-function V(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return U(a)?a:i}function W(a,b){b=ba(b);return ra(a,b)||wa(a,b)}function wa(a,b){var c=a.currentStyle||a.style,d=c[b];d===g&&"function"==l(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?d!==g?d:i:(c=V(a))?wa(c,b):i}
-function xa(a){if("function"==l(a.getBBox))try{var b=a.getBBox();if(b)return b}catch(c){}if("none"!=T(a,"display"))a=ua(a);else{var b=a.style,d=b.display,e=b.visibility,f=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=ua(a);b.display=d;b.position=f;b.visibility=e}return a}
-function X(a,b){function c(a){if("none"==W(a,"display"))return j;a=V(a);return!a||c(a)}function d(a){var b=xa(a);return 0<b.height&&0<b.width?h:fa(a.childNodes,function (a){return a.nodeType==K||U(a)&&d(a)})}function e(a){var b=V(a);if(b&&"hidden"==W(b,"overflow")){var c=xa(b),d=ta(b),a=ta(a);return d.x+c.width<a.x||d.y+c.height<a.y?j:e(b)}return h}if(!U(a))throw Error("Argument to isShown must be of type Element");if(U(a,"OPTION")||U(a,"OPTGROUP")){var f=ma(a,function (a){return U(a,"SELECT")});return!!f&&
-X(f,h)}if(U(a,"MAP")){if(!a.name)return j;f=L(a);f=f.evaluate?pa('/descendant::*[@usemap = "#'+a.name+'"]',f):la(f,function (b){var c;if(c=U(b))8==b.nodeType?b=i:(c="usemap","style"==c?(b=p(b.style.cssText).toLowerCase(),b=";"==b.charAt(b.length-1)?b:b+";"):(b=b.getAttributeNode(c),b=!b?i:A(va,c)?"true":b.specified?b.value:i)),c=b=="#"+a.name;return c});return!!f&&X(f,b)}return U(a,"AREA")?(f=ma(a,function (a){return U(a,"MAP")}),!!f&&X(f,b)):U(a,"INPUT")&&"hidden"==a.type.toLowerCase()||U(a,"NOSCRIPT")||
-"hidden"==W(a,"visibility")||!c(a)||!b&&0==ya(a)||!d(a)||!e(a)?j:h}function za(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}
-function Aa(a,b){if(U(a,"BR"))b.push("");else{var c=U(a,"TD"),d=W(a,"display"),e=!c&&!A(Ba,d);e&&!/^[\s\xa0]*$/.test(b[b.length-1]||"")&&b.push("");var f=X(a),r=i,t=i;f&&(r=W(a,"white-space"),t=W(a,"text-transform"));ea(a.childNodes,function (a){a.nodeType==K&&f?Ca(a,b,r,t):U(a)&&Aa(a,b)});var O=b[b.length-1]||"";if((c||"table-cell"==d)&&O&&!o(O))b[b.length-1]+=" ";e&&!/^[\s\xa0]*$/.test(O)&&b.push("")}}var Ba="inline,inline-block,inline-table,none,table-cell,table-column,table-column-group".split(",");
-function Ca(a,b,c,d){a=a.nodeValue.replace(/\u200b/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function (a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";o(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)}
-function ya(a){var b=1,c=W(a,"opacity");c&&(b=Number(c));(a=V(a))&&(b*=ya(a));return b};function Da(a){var b;a:{for(b=a;b;){if(b.tagName&&"head"==b.tagName.toLowerCase()){b=h;break a}try{b=b.parentNode}catch(c){break}}b=j}if(b)return b=L(a),"TITLE"==a.tagName.toUpperCase()&&(b?b.parentWindow||b.defaultView:window)==da.top?p(b.title):"";b=[];Aa(a,b);var d=b,a=d.length;b=Array(a);for(var d=m(d)?d.split(""):d,e=0;e<a;e++)e in d&&(b[e]=za.call(g,d[e]));return za(b.join("\n")).replace(/\xa0/g," ")}var Y=["_"],Z=k;!(Y[0]in Z)&&Z.execScript&&Z.execScript("var "+Y[0]);
-for(var $;Y.length&&($=Y.shift());)!Y.length&&Da!==g?Z[$]=Da:Z=Z[$]?Z[$]:Z[$]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js#L189
-atom.isElementEnabled = function (element, window){return function(){var e=this;function f(a,c){function b(){}b.prototype=c.prototype;a.d=c.prototype;a.prototype=new b};function g(a,c){for(var b=1;b<arguments.length;b++)var d=(""+arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a};var h,i="",j=/rv\:([^\);]+)(\)|;)/.exec(e.navigator?e.navigator.userAgent:null);h=i=j?j[1]:"";var k={};function l(a,c){this.code=a;this.message=c||"";this.name=m[a]||m[13];var b=Error(this.message);b.name=this.name;this.stack=b.stack||""}f(l,Error);
-var m={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",33:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
-l.prototype.toString=function(){return"["+this.name+"] "+this.message};function n(a){this.stack=Error().stack||"";a&&(this.message=""+a)}f(n,Error);n.prototype.name="CustomError";function o(a,c){c.unshift(a);n.call(this,g.apply(null,c));c.shift()}f(o,n);o.prototype.name="AssertionError";function p(a,c){var b;a:if("string"==typeof a)b="string"!=typeof c||1!=c.length?-1:a.indexOf(c,0);else{for(b=0;b<a.length;b++)if(b in a&&a[b]===c)break a;b=-1}return 0<=b};if(!k["1.9.1"]){for(var q=0,r=(""+h).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),s="1.9.1".replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),t=Math.max(r.length,s.length),u=0;0==q&&u<t;u++){var v=r[u]||"",w=s[u]||"",x=RegExp("(\\d*)(\\D*)","g"),z=RegExp("(\\d*)(\\D*)","g");do{var A=x.exec(v)||["","",""],B=z.exec(w)||["","",""];if(0==A[0].length&&0==B[0].length)break;q=((0==A[1].length?0:parseInt(A[1],10))<(0==B[1].length?0:parseInt(B[1],10))?-1:(0==A[1].length?0:parseInt(A[1],10))>(0==B[1].length?
-0:parseInt(B[1],10))?1:0)||((0==A[2].length)<(0==B[2].length)?-1:(0==A[2].length)>(0==B[2].length)?1:0)||(A[2]<B[2]?-1:A[2]>B[2]?1:0)}while(0==q)}k["1.9.1"]=0<=q};(function(){var a=e.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(c){return!1}var b=a.classes,a=a.interfaces;b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return!0})();function C(a,c,b,d,y){this.b=!!c;if(a&&(this.a=a))this.c="number"==typeof d?d:1!=this.a.nodeType?0:this.b?-1:1;this.depth=void 0!=y?y:this.c||0;this.b&&(this.depth*=-1)}f(C,function(){});C.prototype.a=null;C.prototype.c=0;f(function (a,c,b,d){C.call(this,a,c,0,null,d)},C);var D={"class":"className",readonly:"readOnly"},E=["checked","disabled","draggable","hidden"],F="BUTTON,INPUT,OPTGROUP,OPTION,SELECT,TEXTAREA".split(",");function G(a){var c=a.tagName.toUpperCase();if(p(F,c)){var b;b=D.disabled||"disabled";var d=a[b];b=void 0===d&&p(E,b)?!1:d;a=b?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==c||"OPTION"==c?G(a.parentNode):!0}else a=!0;return a};var H=G,I=["_"],J=e;!(I[0]in J)&&J.execScript&&J.execScript("var "+I[0]);for(var K;I.length&&(K=I.shift());)!I.length&&void 0!==H?J[K]=H:J=J[K]?J[K]:J[K]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/domcore.js#L198
-atom.isElementSelected = function (element, window){return function(){var f=!1,g=this;function h(a,b){function c(){}c.prototype=b.prototype;a.d=b.prototype;a.prototype=new c};function i(a,b){for(var c=1;c<arguments.length;c++)var d=(""+arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a};var k,l="",m=/rv\:([^\);]+)(\)|;)/.exec(g.navigator?g.navigator.userAgent:null);k=l=m?m[1]:"";var n={};function o(a,b){this.code=a;this.message=b||"";this.name=p[a]||p[13];var c=Error(this.message);c.name=this.name;this.stack=c.stack||""}h(o,Error);
-var p={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",33:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
-o.prototype.toString=function(){return"["+this.name+"] "+this.message};function q(a){this.stack=Error().stack||"";a&&(this.message=""+a)}h(q,Error);q.prototype.name="CustomError";function r(a,b){b.unshift(a);q.call(this,i.apply(null,b));b.shift()}h(r,q);r.prototype.name="AssertionError";if(!n["1.9.1"]){for(var s=0,t=(""+k).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),u="1.9.1".replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),v=Math.max(t.length,u.length),w=0;0==s&&w<v;w++){var x=t[w]||"",y=u[w]||"",z=RegExp("(\\d*)(\\D*)","g"),A=RegExp("(\\d*)(\\D*)","g");do{var B=z.exec(x)||["","",""],C=A.exec(y)||["","",""];if(0==B[0].length&&0==C[0].length)break;s=((0==B[1].length?0:parseInt(B[1],10))<(0==C[1].length?0:parseInt(C[1],10))?-1:(0==B[1].length?0:parseInt(B[1],10))>(0==C[1].length?
-0:parseInt(C[1],10))?1:0)||((0==B[2].length)<(0==C[2].length)?-1:(0==B[2].length)>(0==C[2].length)?1:0)||(B[2]<C[2]?-1:B[2]>C[2]?1:0)}while(0==s)}n["1.9.1"]=0<=s};var D={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},E={IMG:" ",BR:"\n"};function F(a,b,c){if(!(a.nodeName in D))if(3==a.nodeType)c?b.push((""+a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in E)b.push(E[a.nodeName]);else for(a=a.firstChild;a;)F(a,b,c),a=a.nextSibling};(function(){var a=g.Components;if(!a)return f;try{if(!a.classes)return f}catch(b){return f}var c=a.classes,a=a.interfaces;c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return!0})();function G(a,b,c,d,e){this.b=!!b;if(a&&(this.a=a))this.c="number"==typeof d?d:1!=this.a.nodeType?0:this.b?-1:1;this.depth=void 0!=e?e:this.c||0;this.b&&(this.depth*=-1)}h(G,function(){});G.prototype.a=null;G.prototype.c=0;h(function (a,b,c,d){G.call(this,a,b,0,null,d)},G);function H(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function I(a){return H(a,"OPTION")?!0:H(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):f}var J={"class":"className",readonly:"readOnly"},K=["checked","disabled","draggable","hidden"];function L(a){if(I(a)){if(!I(a))throw new o(15,"Element is not selectable");var b="selected",c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";var c=b,d=J[c]||c,b=a[d],e;if(e=void 0===b){b:if("string"==typeof K)d="string"!=typeof d||1!=d.length?-1:K.indexOf(d,0);else{for(e=0;e<K.length;e++)if(e in K&&K[e]===d){d=e;break b}d=-1}e=0<=d}if(e)a=f;else{if(d="value"==c)if(d=H(a,"OPTION")){var j;c=c.toLowerCase();if(a.hasAttribute)j=a.hasAttribute(c);else try{j=a.attributes[c].specified}catch(P){j=
-f}d=!j}d&&(j=[],F(a,j,f),b=j.join(""));a=b}a=!!a}else a=f;return a}var M=["_"],N=g;!(M[0]in N)&&N.execScript&&N.execScript("var "+M[0]);for(var O;M.length&&(O=M.shift());)!M.length&&void 0!==L?N[O]=L:N=N[O]?N[O]:N[O]={};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null}, arguments);}
-
-// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js#L435
-atom.isElementDisplayed = function (element, window){return function(){function h(a){return function(){return a}}var k=this;
-function m(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
-else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function n(a){return"string"==typeof a};function q(a){var b=0,c=String(r).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split(".");a=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split(".");for(var d=Math.max(c.length,a.length),e=0;0==b&&e<d;e++){var f=c[e]||"",g=a[e]||"",w=RegExp("(\\d*)(\\D*)","g"),p=RegExp("(\\d*)(\\D*)","g");do{var l=w.exec(f)||["","",""],v=p.exec(g)||["","",""];if(0==l[0].length&&0==v[0].length)break;b=((0==l[1].length?0:parseInt(l[1],10))<(0==v[1].length?0:parseInt(v[1],10))?-1:(0==l[1].length?0:parseInt(l[1],10))>(0==v[1].length?
-0:parseInt(v[1],10))?1:0)||((0==l[2].length)<(0==v[2].length)?-1:(0==l[2].length)>(0==v[2].length)?1:0)||(l[2]<v[2]?-1:l[2]>v[2]?1:0)}while(0==b)}return b}function aa(a){return String(a).replace(/\-([a-z])/g,function (a,c){return c.toUpperCase()})};var s=Array.prototype;function t(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ba(a,b){if(a.reduce)return a.reduce(b,"");var c="";t(a,function (d,e){c=b.call(void 0,c,d,e,a)});return c}function ca(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}
-function da(a,b){var c;a:if(n(a))c=n(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function ea(a,b,c){return 2>=arguments.length?s.slice.call(a,b):s.slice.call(a,b,c)};var u={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
-darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
-ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
-lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
-moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
-seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var fa="background-color border-top-color border-right-color border-bottom-color border-left-color color outline-color".split(" "),ga=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/;function ha(a){if(!x.test(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(ga,"#$1$1$2$2$3$3"));return a.toLowerCase()}var x=/^#(?:[0-9a-f]{3}){1,2}$/i,ia=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i;
-function ja(a){var b=a.match(ia);if(b){a=Number(b[1]);var c=Number(b[2]),d=Number(b[3]),b=Number(b[4]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=d&&255>=d&&0<=b&&1>=b)return[a,c,d,b]}return[]}var ka=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function la(a){var b=a.match(ka);if(b){a=Number(b[1]);var c=Number(b[2]),b=Number(b[3]);if(0<=a&&255>=a&&0<=c&&255>=c&&0<=b&&255>=b)return[a,c,b]}return[]};function y(a,b){this.code=a;this.state=z[a]||ma;this.message=b||"";var c=this.state.replace(/((?:^|\s+)[a-z])/g,function (a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}(function(){var a=Error;function b(){}b.prototype=a.prototype;y.I=a.prototype;y.prototype=new b})();
-var ma="unknown error",z={15:"element not selectable",11:"element not visible",31:"ime engine activation failed",30:"ime not available",24:"invalid cookie domain",29:"invalid element coordinates",12:"invalid element state",32:"invalid selector",51:"invalid selector",52:"invalid selector",17:"javascript error",405:"unsupported operation",34:"move target out of bounds",27:"no such alert",7:"no such element",8:"no such frame",23:"no such window",28:"script timeout",33:"session not created",10:"stale element reference",
-0:"success",21:"timeout",25:"unable to set cookie",26:"unexpected alert open"};z[13]=ma;z[9]="unknown command";y.prototype.toString=function(){return this.name+": "+this.message};var r,na="",oa=/rv\:([^\);]+)(\)|;)/.exec(k.navigator?k.navigator.userAgent:null);r=na=oa?oa[1]:"";var A={};var B;A["1.9.1"]||(A["1.9.1"]=0<=q("1.9.1"));function C(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}C.prototype.toString=function(){return"("+this.x+", "+this.y+")"};C.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};C.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};C.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function D(a,b){this.width=a;this.height=b}D.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};D.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};D.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};D.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var pa=3;function E(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
-function qa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?ra(a,b):!c&&E(e,b)?-1*sa(a,b):!d&&E(f,a)?sa(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=F(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);
-return c.compareBoundaryPoints(k.Range.START_TO_END,d)}function sa(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return ra(d,a)}function ra(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function F(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function ta(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function G(a){this.p=a||k.document||document}
-function ua(a){var b=a.p;a="CSS1Compat"==b.compatMode?b.documentElement:b.body;b=b.parentWindow||b.defaultView;return new C(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}G.prototype.contains=E;function H(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
-function I(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function J(a,b,c,d,e){return va.call(null,a,b,n(c)?c:null,n(d)?d:null,e||new K)}
-function va(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),t(b,function (b){a.matches(b)&&e.add(b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),t(b,function (b){b.className==d&&a.matches(b)&&e.add(b)})):b.getElementsByTagName&&(b=b.getElementsByTagName(a.getName()),t(b,function (a){I(a,c,d)&&e.add(a)}));return e}function wa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)I(b,c,d)&&a.matches(b)&&e.add(b);return e};function K(){this.d=this.c=null;this.g=0}function xa(a){this.m=a;this.next=this.i=null}K.prototype.unshift=function (a){a=new xa(a);a.next=this.c;this.d?this.c.i=a:this.c=this.d=a;this.c=a;this.g++};K.prototype.add=function (a){a=new xa(a);a.i=this.d;this.c?this.d.next=a:this.c=this.d=a;this.d=a;this.g++};function ya(a){return(a=a.c)?a.m:null}function L(a){return new za(a,!1)}function za(a,b){this.F=a;this.j=(this.n=b)?a.d:a.c;this.r=null}
-za.prototype.next=function(){var a=this.j;if(null==a)return null;var b=this.r=a;this.j=this.n?a.i:a.next;return b.m};function M(a,b,c,d,e){b=b.evaluate(d);c=c.evaluate(d);var f;if(b instanceof K&&c instanceof K){e=L(b);for(d=e.next();d;d=e.next())for(b=L(c),f=b.next();f;f=b.next())if(a(H(d),H(f)))return!0;return!1}if(b instanceof K||c instanceof K){b instanceof K?e=b:(e=c,c=b);e=L(e);b=typeof c;for(d=e.next();d;d=e.next()){switch(b){case "number":d=+H(d);break;case "boolean":d=!!H(d);break;case "string":d=H(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e?
-"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}function Aa(a,b,c,d){this.s=a;this.H=b;this.o=c;this.q=d}Aa.prototype.toString=function(){return this.s};var Ba={};function N(a,b,c,d){if(a in Ba)throw Error("Binary operator already created: "+a);a=new Aa(a,b,c,d);Ba[a.toString()]=a}N("div",6,1,function (a,b,c){return a.b(c)/b.b(c)});N("mod",6,1,function (a,b,c){return a.b(c)%b.b(c)});N("*",6,1,function (a,b,c){return a.b(c)*b.b(c)});
-N("+",5,1,function (a,b,c){return a.b(c)+b.b(c)});N("-",5,1,function (a,b,c){return a.b(c)-b.b(c)});N("<",4,2,function (a,b,c){return M(function (a,b){return a<b},a,b,c)});N(">",4,2,function (a,b,c){return M(function (a,b){return a>b},a,b,c)});N("<=",4,2,function (a,b,c){return M(function (a,b){return a<=b},a,b,c)});N(">=",4,2,function (a,b,c){return M(function (a,b){return a>=b},a,b,c)});N("=",3,2,function (a,b,c){return M(function (a,b){return a==b},a,b,c,!0)});
-N("!=",3,2,function (a,b,c){return M(function (a,b){return a!=b},a,b,c,!0)});N("and",2,2,function (a,b,c){return a.f(c)&&b.f(c)});N("or",1,2,function (a,b,c){return a.f(c)||b.f(c)});function Ca(a,b,c,d,e,f,g,w,p){this.h=a;this.o=b;this.D=c;this.C=d;this.B=e;this.q=f;this.A=g;this.w=void 0!==w?w:g;this.G=!!p}Ca.prototype.toString=function(){return this.h};var Da={};function O(a,b,c,d,e,f,g,w){if(a in Da)throw Error("Function already created: "+a+".");Da[a]=new Ca(a,b,c,d,!1,e,f,g,w)}O("boolean",2,!1,!1,function (a,b){return b.f(a)},1);O("ceiling",1,!1,!1,function (a,b){return Math.ceil(b.b(a))},1);
-O("concat",3,!1,!1,function (a,b){var c=ea(arguments,1);return ba(c,function (b,c){return b+c.a(a)})},2,null);O("contains",2,!1,!1,function (a,b,c){b=b.a(a);a=c.a(a);return-1!=b.indexOf(a)},2);O("count",1,!1,!1,function (a,b){return b.evaluate(a).g},1,1,!0);O("false",2,!1,!1,h(!1),0);O("floor",1,!1,!1,function (a,b){return Math.floor(b.b(a))},1);
-O("id",4,!1,!1,function (a,b){var c=a.e(),d=9==c.nodeType?c:c.ownerDocument,c=b.a(a).split(/\s+/),e=[];t(c,function (a){(a=d.getElementById(a))&&!da(e,a)&&e.push(a)});e.sort(qa);var f=new K;t(e,function (a){f.add(a)});return f},1);O("lang",2,!1,!1,h(!1),1);O("last",1,!0,!1,function (a){if(1!=arguments.length)throw Error("Function last expects ()");return a.u()},0);O("local-name",3,!1,!0,function (a,b){var c=b?ya(b.evaluate(a)):a.e();return c?c.nodeName.toLowerCase():""},0,1,!0);
-O("name",3,!1,!0,function (a,b){var c=b?ya(b.evaluate(a)):a.e();return c?c.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,h(""),0,1,!0);O("normalize-space",3,!1,!0,function (a,b){return(b?b.a(a):H(a.e())).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);O("not",2,!1,!1,function (a,b){return!b.f(a)},1);O("number",1,!1,!0,function (a,b){return b?b.b(a):+H(a.e())},0,1);O("position",1,!0,!1,function (a){return a.v()},0);O("round",1,!1,!1,function (a,b){return Math.round(b.b(a))},1);
-O("starts-with",2,!1,!1,function (a,b,c){b=b.a(a);a=c.a(a);return 0==b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function (a,b){return b?b.a(a):H(a.e())},0,1);O("string-length",1,!1,!0,function (a,b){return(b?b.a(a):H(a.e())).length},0,1);
-O("substring",3,!1,!1,function (a,b,c,d){c=c.b(a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?d.b(a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=b.a(a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);O("substring-after",3,!1,!1,function (a,b,c){b=b.a(a);a=c.a(a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
-O("substring-before",3,!1,!1,function (a,b,c){b=b.a(a);a=c.a(a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function (a,b){for(var c=L(b.evaluate(a)),d=0,e=c.next();e;e=c.next())d+=+H(e);return d},1,1,!0);O("translate",3,!1,!1,function (a,b,c,d){b=b.a(a);c=c.a(a);var e=d.a(a);a=[];for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);O("true",2,!1,!1,h(!0),0);function Ea(a,b,c,d){this.h=a;this.t=b;this.n=c;this.J=d}Ea.prototype.toString=function(){return this.h};var Fa={};function P(a,b,c,d){if(a in Fa)throw Error("Axis already created: "+a);Fa[a]=new Ea(a,b,c,!!d)}P("ancestor",function (a,b){for(var c=new K,d=b;d=d.parentNode;)a.matches(d)&&c.unshift(d);return c},!0);P("ancestor-or-self",function (a,b){var c=new K,d=b;do a.matches(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);
-P("attribute",function (a,b){var c=new K,d=a.getName(),e=b.attributes;if(e)if("*"==d)for(var d=0,f;f=e[d];d++)c.add(f);else(f=e.getNamedItem(d))&&c.add(f);return c},!1);P("child",function (a,b,c,d,e){return wa.call(null,a,b,n(c)?c:null,n(d)?d:null,e||new K)},!1,!0);P("descendant",J,!1,!0);P("descendant-or-self",function (a,b,c,d){var e=new K;I(b,c,d)&&a.matches(b)&&e.add(b);return J(a,b,c,d,e)},!1,!0);
-P("following",function (a,b,c,d){var e=new K;do for(var f=b;f=f.nextSibling;)I(f,c,d)&&a.matches(f)&&e.add(f),e=J(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);P("following-sibling",function (a,b){for(var c=new K,d=b;d=d.nextSibling;)a.matches(d)&&c.add(d);return c},!1);P("namespace",function(){return new K},!1);P("parent",function (a,b){var c=new K;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;var d=b.parentNode;a.matches(d)&&c.add(d);return c},!1);
-P("preceding",function (a,b,c,d){var e=new K,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,w=f.length;g<w;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var l=0,v=p.length;l<v;l++)b=p[l],I(b,c,d)&&a.matches(b)&&e.add(b),e=J(a,b,c,d,e)}return e},!0,!0);P("preceding-sibling",function (a,b){for(var c=new K,d=b;d=d.previousSibling;)a.matches(d)&&c.unshift(d);return c},!0);P("self",function (a,b){var c=new K;a.matches(b)&&c.add(b);return c},!1);var Ga=function(){var a={K:"http://www.w3.org/2000/svg"};return function (b){return a[b]||null}}();
-function Ha(a,b){var c=function(){var c;a:{var e=F(b);try{var f=e.createNSResolver?e.createNSResolver(e.documentElement):Ga;c=e.evaluate(a,b,f,9,null);break a}catch(g){if("NS_ERROR_ILLEGAL_VALUE"!=g.name)throw new y(32,"Unable to locate an element with the xpath expression "+a+" because of the following error:\n"+g);}c=void 0}return c?c.singleNodeValue||null:b.selectSingleNode?(c=F(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();if(null!==c&&(!c||1!=c.nodeType))throw new y(32,
-'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");return c};(function(){var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(b){return!1}var c=a.classes,a=a.interfaces;c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator);c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo);return!0})();function Q(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Q.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};Q.prototype.contains=function (a){return a instanceof Q?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
-Q.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Q.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
-Q.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Ia(a,b){var c=F(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function R(a,b){return Ia(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}function Ja(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}return b}
-function Ka(a){var b=F(a),c=R(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=R(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null}
-function La(a){if(1==a.nodeType){var b;if(a.getBoundingClientRect)b=Ja(a),b=new C(b.left,b.top);else{b=ua(a?new G(F(a)):B||(B=new G));var c,d=F(a),e=R(a,"position"),f=d.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==e&&(c=d.getBoxObjectFor(a))&&(0>c.screenX||0>c.screenY),e=new C(0,0),g=(d?F(d):document).documentElement;if(a!=g)if(a.getBoundingClientRect)c=Ja(a),d=ua(d?new G(F(d)):B||(B=new G)),e.x=c.left+d.x,e.y=c.top+d.y;else if(d.getBoxObjectFor&&!f)c=d.getBoxObjectFor(a),d=d.getBoxObjectFor(g),
-e.x=c.screenX-d.screenX,e.y=c.screenY-d.screenY;else{c=a;do e.x+=c.offsetLeft,e.y+=c.offsetTop,c!=a&&(e.x+=c.clientLeft||0,e.y+=c.clientTop||0),c=c.offsetParent;while(c&&c!=a);for(c=a;(c=Ka(c))&&c!=d.body&&c!=g;)e.x-=c.scrollLeft,e.y-=c.scrollTop}b=new C(e.x-b.x,e.y-b.y)}A[12]||(A[12]=0<=q(12))?a=b:((c=R(a,"-moz-transform"))||(c=R(a,"transform")),a=c?(a=c.match(Ma))?new C(parseFloat(a[1]),parseFloat(a[2])):new C(0,0):new C(0,0),a=new C(b.x+a.x,b.y+a.y));return a}b="function"==m(a.k);c=a;a.targetTouches?
-c=a.targetTouches[0]:b&&a.k().targetTouches&&(c=a.k().targetTouches[0]);return new C(c.clientX,c.clientY)}var Ma=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;function S(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function T(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return S(a)?a:null}
-function U(a,b){var c=aa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c="cssFloat";c=Ia(a,c)||Na(a,c);if(null===c)c=null;else if(da(fa,b)&&(x.test("#"==c.charAt(0)?c:"#"+c)||la(c).length||u&&u[c.toLowerCase()]||ja(c).length)){var d=ja(c);if(!d.length){a:if(d=la(c),!d.length){d=(d=u[c.toLowerCase()])?d:"#"==c.charAt(0)?c:"#"+c;if(x.test(d)&&(d=ha(d),d=ha(d),d=[parseInt(d.substr(1,2),16),parseInt(d.substr(3,2),16),parseInt(d.substr(5,2),16)],d.length))break a;d=[]}3==d.length&&d.push(1)}c=4!=d.length?
-c:"rgba("+d.join(", ")+")"}return c}function Na(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==m(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(c=T(a))?Na(c,b):null}
-function V(a,b){function c(a){if("none"==U(a,"display"))return!1;a=T(a);return!a||c(a)}function d(a){if(a.hasAttribute){if(a.hasAttribute("hidden"))return!1}else return!0;a=T(a);return!a||d(a)}function e(a){var b=W(a);return 0<b.height&&0<b.width?!0:S(a,"PATH")&&(0<b.height||0<b.width)?(a=U(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=U(a,"overflow")&&ca(a.childNodes,function (a){return a.nodeType==pa||S(a)&&e(a)})}function f(a){var b=U(a,"-o-transform")||U(a,"-webkit-transform")||U(a,"-ms-transform")||
-U(a,"-moz-transform")||U(a,"transform");if(b&&"none"!==b)return b=La(a),a=W(a),0<=b.x+a.width&&0<=b.y+a.height?!0:!1;a=T(a);return!a||f(a)}if(!S(a))throw Error("Argument to isShown must be of type Element");if(S(a,"OPTION")||S(a,"OPTGROUP")){var g=ta(a,function (a){return S(a,"SELECT")});return!!g&&V(g,!0)}return(g=Oa(a))?!!g.l&&0<g.rect.width&&0<g.rect.height&&V(g.l,b):S(a,"INPUT")&&"hidden"==a.type.toLowerCase()||S(a,"NOSCRIPT")||"hidden"==U(a,"visibility")||!c(a)||!b&&0==Pa(a)||!d(a)||!e(a)||Qa(a)==
-X?!1:f(a)}var X="hidden";
-function Qa(a){function b(a){var b=a;if("visible"==w)if(a==f)b=g;else if(a==g)return{x:"visible",y:"visible"};b={x:U(b,"overflow-x"),y:U(b,"overflow-y")};a==f&&(b.x="hidden"==b.x?"hidden":"auto",b.y="hidden"==b.y?"hidden":"auto");return b}function c(a){var b=U(a,"position");if("fixed"==b)return f;for(a=T(a);a&&a!=f&&(0==U(a,"display").lastIndexOf("inline",0)||"absolute"==b&&"static"==U(a,"position"));)a=T(a);return a}var d=W(a),e=F(a),f=e.documentElement,g=e.body||f,w=U(f,"overflow");for(a=c(a);a;a=
-c(a)){var p=W(a),e=b(a),l=d.left>=p.left+p.width,p=d.top>=p.top+p.height;if(l&&"hidden"==e.x||p&&"hidden"==e.y)return X;if(l&&"visible"!=e.x||p&&"visible"!=e.y)return Qa(a)==X?X:"scroll"}return"none"}
-function W(a){var b=Oa(a);if(b)return b.rect;if("function"==m(a.getBBox))try{var c=a.getBBox();return new Q(c.x,c.y,c.width,c.height)}catch(d){if("NS_ERROR_FAILURE"===d.name||-1!=d.message.indexOf("Component returned failure code: 0x80004005"))return new Q(0,0,0,0);throw d;}else{if(S(a,"HTML"))return a=((F(a)?F(a).parentWindow||F(a).defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new D(a.clientWidth,a.clientHeight),new Q(0,0,a.width,a.height);b=La(a);
-return new Q(b.x,b.y,a.offsetWidth,a.offsetHeight)}}
-function Oa(a){var b=S(a,"MAP");if(!b&&!S(a,"AREA"))return null;var c=b?a:S(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;if(c&&c.name&&(d=Ha('/descendant::*[@usemap = "#'+c.name+'"]',F(c)))&&(e=W(d),!b&&"default"!=a.shape.toLowerCase())){var f=Ra(a);a=Math.min(Math.max(f.left,0),e.width);b=Math.min(Math.max(f.top,0),e.height);c=Math.min(f.width,e.width-a);f=Math.min(f.height,e.height-b);e=new Q(a+e.left,b+e.top,c,f)}return{l:d,rect:e||new Q(0,0,0,0)}}
-function Ra(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new Q(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Q(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new Q(b,c,d-b,e-c)}return new Q(0,0,0,0)}
-function Pa(a){var b=1,c=U(a,"opacity");c&&(b=Number(c));(a=T(a))&&(b*=Pa(a));return b};var Sa=V,Y=["_"],Z=k;Y[0]in Z||!Z.execScript||Z.execScript("var "+Y[0]);for(var $;Y.length&&($=Y.shift());)Y.length||void 0===Sa?Z=Z[$]?Z[$]:Z[$]={}:Z[$]=Sa;; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);}
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/browser.Context.html b/testing/marionette/doc/api/browser.Context.html deleted file mode 100644 --- a/testing/marionette/doc/api/browser.Context.html +++ /dev/null @@ -1,1597 +0,0 @@ - - - - - JSDoc: Class: Context - - - - - - - - - - -
- -

Class: Context

- - - - - - -
- -
- -

- browser.Context(win, driver)

- -

Creates a browsing context wrapper.

-

Browsing contexts handle interactions with the browser, according to -the current environment (Firefox, Fennec).

- - -
- -
-
- - - - -

Constructor

- - - -

new Context(win, driver)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
win - - -ChromeWindow - - - -

ChromeWindow that contains the top-level browsing context.

driver - - -GeckoDriver - - - -

Reference to driver instance.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Members

- - - -

contentBrowser

- - - - -
-

Returns the content browser for the currently selected tab. -If there is no tab selected, null will be returned.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

curFrameId

- - - - -
-

The current frame ID is managed per browser element on desktop in -case the ID needs to be refreshed. The currently selected window is -identified by a tab.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

currentTitle

- - - - -
-

Returns the current title of the content browser.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

currentURI

- - - - -
-

Returns the current URI of the content browser.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - -

rect

- - - - -
-

Gets the position and dimensions of the top-level browsing context.

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -

Methods

- - - - - - - -

addTab(uri)

- - - - - - -
-

Opens a tab with given URI.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uri - - -string - - - -

URI to open.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

closeTab() → {Promise}

- - - - - - -
-

Close the current tab.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

UnsupportedOperationError - If tab handling for the current application isn't supported.

- -
- - - - - -
Returns:
- - -
-

A promise which is resolved when the current tab has been closed.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -

closeWindow() → {Promise}

- - - - - - -
-

Close the current window.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

A promise which is resolved when the current window has been closed.

-
- - - -
-
- Type -
-
- -Promise - - -
-
- - - - - - - - - - - - - -

executeWhenReady()

- - - - - - -
-

This function intercepts commands interacting with content and queues -or executes them as needed.

-

No commands interacting with content are safe to process until -the new listener script is loaded and registers itself. -This occurs when a command whose effect is asynchronous (such -as goBack) results in a reload of the frame script and new commands -are subsequently posted to the server.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

flushPendingCommands()

- - - - - - -
-

Flushes any queued pending commands after a reload of the frame script.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

getTabModalUI()

- - - - - - -
-

Retrieves the current tabmodal UI object. According to the browser -associated with the currently selected tab.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

register(uid, target)

- - - - - - -
-

Registers a new frame, and sets its current frame id to this frame -if it is not already assigned, and if a) we already have a session -or b) we're starting a new session and it is the right start frame.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uid - - -string - - - -

Frame uid for use by Marionette.

target - - -xul:browser - - - -

The that was the target of the originating message.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -

switchToTab(indexopt, windowopt, focusopt)

- - - - - - -
-

Set the current tab.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
index - - -number - - - - - - <optional>
- - - - - -
- -

Tab index to switch to. If the parameter is undefined, - the currently selected tab will be used.

window - - -ChromeWindow - - - - - - <optional>
- - - - - -
- -

Switch to this window before selecting the tab.

focus - - -boolean - - - - - - <optional>
- - - - - -
- - true - -

A boolean value which determins whether to focus - the window. Defaults to true.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

UnsupportedOperationError - If tab handling for the current application isn't supported.

- -
- - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/browser.Windows.html b/testing/marionette/doc/api/browser.Windows.html deleted file mode 100644 --- a/testing/marionette/doc/api/browser.Windows.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - JSDoc: Class: Windows - - - - - - - - - - -
- -

Class: Windows

- - - - - - -
- -
- -

- browser.Windows()

- -

The window storage is used to save outer window IDs mapped to weak -references of Window objects.

-

Usage:

-
let wins = new browser.Windows();
-wins.set(browser.outerWindowID, window);
-
-...
-
-let win = wins.get(browser.outerWindowID);
- - -
- -
-
- - - - -

Constructor

- - - -

new Windows()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

get(id) → {Window}

- - - - - - -
-

Get the window object stored by provided |id|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Outer window ID.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If |id| is not in the store.

-
-
-
-
-
-
- Type -
-
- -RangeError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Saved window object.

-
- - - -
-
- Type -
-
- -Window - - -
-
- - - - - - - - - - - - - -

set(id, win) → {browser.Windows}

- - - - - - -
-

Save a weak reference to the Window object.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
id - - -string - - - -

Outer window ID.

win - - -Window - - - -

Window object to save.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Instance of self.

-
- - - -
-
- Type -
-
- -browser.Windows - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/browser.html b/testing/marionette/doc/api/browser.html deleted file mode 100644 --- a/testing/marionette/doc/api/browser.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - - JSDoc: Namespace: browser - - - - - - - - - - -
- -

Namespace: browser

- - - - - - -
- -
- -

browser

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Context
-
- -
Windows
-
-
- - - - - - - - - - - -

Methods

- - - - - - - -

(static) getBrowserForTab(tab) → {Browser}

- - - - - - -
-

Get the <xul:browser> for the specified tab.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
tab - - -Tab - - - -

The tab whose browser needs to be returned.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The linked browser for the tab or null if no browser can be found.

-
- - - -
-
- Type -
-
- -Browser - - -
-
- - - - - - - - - - - - - -

(static) getTabBrowser(win) → {Tab}

- - - - - - -
-

Return the tab browser for the specified chrome window.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
win - - -ChromeWindow - - - -

Window whose tabbrowser needs to be accessed.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Tab browser or null if it's not a browser window.

-
- - - -
-
- Type -
-
- -Tab - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/browser.js.html b/testing/marionette/doc/api/browser.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/browser.js.html +++ /dev/null @@ -1,553 +0,0 @@ - - - - - JSDoc: Source: browser.js - - - - - - - - - - -
- -

Source: browser.js

- - - - - - -
-
-
/* 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";
-/* global frame */
-
-const {WebElementEventTarget} = Cu.import("chrome://marionette/content/dom.js", {});
-Cu.import("chrome://marionette/content/element.js");
-const {
-  NoSuchWindowError,
-  UnsupportedOperationError,
-} = Cu.import("chrome://marionette/content/error.js", {});
-Cu.import("chrome://marionette/content/frame.js");
-
-this.EXPORTED_SYMBOLS = ["browser", "WindowState"];
-
-/** @namespace */
-this.browser = {};
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-/**
- * Get the <code>&lt;xul:browser&gt;</code> for the specified tab.
- *
- * @param {Tab} tab
- *     The tab whose browser needs to be returned.
- *
- * @return {Browser}
- *     The linked browser for the tab or null if no browser can be found.
- */
-browser.getBrowserForTab = function(tab) {
-  // Fennec
-  if ("browser" in tab) {
-    return tab.browser;
-
-  // Firefox
-  } else if ("linkedBrowser" in tab) {
-    return tab.linkedBrowser;
-  }
-
-  return null;
-};
-
-/**
- * Return the tab browser for the specified chrome window.
- *
- * @param {ChromeWindow} win
- *     Window whose <code>tabbrowser</code> needs to be accessed.
- *
- * @return {Tab}
- *     Tab browser or null if it's not a browser window.
- */
-browser.getTabBrowser = function(window) {
-  // Fennec
-  if ("BrowserApp" in window) {
-    return window.BrowserApp;
-
-  // Firefox
-  } else if ("gBrowser" in window) {
-    return window.gBrowser;
-  }
-
-  return null;
-};
-
-/**
- * Creates a browsing context wrapper.
- *
- * Browsing contexts handle interactions with the browser, according to
- * the current environment (Firefox, Fennec).
- */
-browser.Context = class {
-
-  /**
-   * @param {ChromeWindow} win
-   *     ChromeWindow that contains the top-level browsing context.
-   * @param {GeckoDriver} driver
-   *     Reference to driver instance.
-   */
-  constructor(window, driver) {
-    this.window = window;
-    this.driver = driver;
-
-    // In Firefox this is <xul:tabbrowser> (not <xul:browser>!)
-    // and BrowserApp in Fennec
-    this.tabBrowser = browser.getTabBrowser(this.window);
-
-    this.knownFrames = [];
-
-    // Used to set curFrameId upon new session
-    this.newSession = true;
-
-    this.seenEls = new element.Store();
-
-    // A reference to the tab corresponding to the current window handle,
-    // if any.  Specifically, this.tab refers to the last tab that Marionette
-    // switched to in this browser window. Note that this may not equal the
-    // currently selected tab.  For example, if Marionette switches to tab
-    // A, and then clicks on a button that opens a new tab B in the same
-    // browser window, this.tab will still point to tab A, despite tab B
-    // being the currently selected tab.
-    this.tab = null;
-
-    // Commands which trigger a page load can cause the frame script to be
-    // reloaded. To not loose the currently active command, or any other
-    // already pushed following command, store them as long as they haven't
-    // been fully processed. The commands get flushed after a new browser
-    // has been registered.
-    this.pendingCommands = [];
-    this._needsFlushPendingCommands = false;
-
-    // We should have one frame.Manager per browser.Context so that we
-    // can handle modals in each <xul:browser>.
-    this.frameManager = new frame.Manager(driver);
-    this.frameRegsPending = 0;
-
-    // register all message listeners
-    this.frameManager.addMessageManagerListeners(driver.mm);
-    this.getIdForBrowser = driver.getIdForBrowser.bind(driver);
-    this.updateIdForBrowser = driver.updateIdForBrowser.bind(driver);
-  }
-
-  /**
-   * Returns the content browser for the currently selected tab.
-   * If there is no tab selected, null will be returned.
-   */
-  get contentBrowser() {
-    if (this.tab) {
-      return browser.getBrowserForTab(this.tab);
-    } else if (this.tabBrowser &&
-        this.driver.isReftestBrowser(this.tabBrowser)) {
-      return this.tabBrowser;
-    }
-
-    return null;
-  }
-
-  get messageManager() {
-    return this.contentBrowser.messageManager;
-  }
-
-  /**
-   * The current frame ID is managed per browser element on desktop in
-   * case the ID needs to be refreshed. The currently selected window is
-   * identified by a tab.
-   */
-  get curFrameId() {
-    let rv = null;
-    if (this.tab || this.driver.isReftestBrowser(this.contentBrowser)) {
-      rv = this.getIdForBrowser(this.contentBrowser);
-    }
-    return rv;
-  }
-
-  /**
-   * Returns the current title of the content browser.
-   *
-   * @return {string}
-   *     Read-only property containing the current title.
-   *
-   * @throws {NoSuchWindowError}
-   *     If the current ChromeWindow does not have a content browser.
-   */
-  get currentTitle() {
-    // Bug 1363368 - contentBrowser could be null until we wait for its
-    // initialization been finished
-    if (this.contentBrowser) {
-      return this.contentBrowser.contentTitle;
-    }
-    throw new NoSuchWindowError(
-        "Current window does not have a content browser");
-  }
-
-  /**
-   * Returns the current URI of the content browser.
-   *
-   * @return {nsIURI}
-   *     Read-only property containing the currently loaded URL.
-   *
-   * @throws {NoSuchWindowError}
-   *     If the current ChromeWindow does not have a content browser.
-   */
-  get currentURI() {
-    // Bug 1363368 - contentBrowser could be null until we wait for its
-    // initialization been finished
-    if (this.contentBrowser) {
-      return this.contentBrowser.currentURI;
-    }
-    throw new NoSuchWindowError(
-        "Current window does not have a content browser");
-  }
-
-  /**
-   * Gets the position and dimensions of the top-level browsing context.
-   *
-   * @return {Map.<string, number>}
-   *     Object with |x|, |y|, |width|, and |height| properties.
-   */
-  get rect() {
-    return {
-      x: this.window.screenX,
-      y: this.window.screenY,
-      width: this.window.outerWidth,
-      height: this.window.outerHeight,
-      state: WindowState.from(this.window.windowState),
-    };
-  }
-
-  /**
-   * Retrieves the current tabmodal UI object.  According to the browser
-   * associated with the currently selected tab.
-   */
-  getTabModalUI() {
-    let br = this.contentBrowser;
-    if (!br.hasAttribute("tabmodalPromptShowing")) {
-      return null;
-    }
-
-    // The modal is a direct sibling of the browser element.
-    // See tabbrowser.xml's getTabModalPromptBox.
-    let modals = br.parentNode.getElementsByTagNameNS(
-        XUL_NS, "tabmodalprompt");
-    return modals[0].ui;
-  }
-
-  /**
-   * Close the current window.
-   *
-   * @return {Promise}
-   *     A promise which is resolved when the current window has been closed.
-   */
-  closeWindow() {
-    return new Promise(resolve => {
-      this.window.addEventListener("unload", ev => {
-        resolve();
-      }, {once: true});
-      this.window.close();
-    });
-  }
-
-  /**
-   * Close the current tab.
-   *
-   * @return {Promise}
-   *     A promise which is resolved when the current tab has been closed.
-   *
-   * @throws UnsupportedOperationError
-   *     If tab handling for the current application isn't supported.
-   */
-  closeTab() {
-    // If the current window is not a browser then close it directly. Do the
-    // same if only one remaining tab is open, or no tab selected at all.
-    if (!this.tabBrowser ||
-        !this.tabBrowser.tabs ||
-        this.tabBrowser.tabs.length === 1 ||
-        !this.tab) {
-      return this.closeWindow();
-    }
-
-    return new Promise((resolve, reject) => {
-      if (this.tabBrowser.closeTab) {
-        // Fennec
-        this.tabBrowser.deck.addEventListener("TabClose", ev => {
-          resolve();
-        }, {once: true});
-        this.tabBrowser.closeTab(this.tab);
-
-      } else if (this.tabBrowser.removeTab) {
-        // Firefox
-        this.tab.addEventListener("TabClose", ev => {
-          resolve();
-        }, {once: true});
-        this.tabBrowser.removeTab(this.tab);
-
-      } else {
-        reject(new UnsupportedOperationError(
-            `closeTab() not supported in ${this.driver.appName}`));
-      }
-    });
-  }
-
-  /**
-   * Opens a tab with given URI.
-   *
-   * @param {string} uri
-   *      URI to open.
-   */
-  addTab(uri) {
-    return this.tabBrowser.addTab(uri, true);
-  }
-
-  /**
-   * Set the current tab.
-   *
-   * @param {number=} index
-   *     Tab index to switch to. If the parameter is undefined,
-   *     the currently selected tab will be used.
-   * @param {ChromeWindow=} window
-   *     Switch to this window before selecting the tab.
-   * @param {boolean=} focus
-   *      A boolean value which determins whether to focus
-   *      the window. Defaults to true.
-   *
-   * @throws UnsupportedOperationError
-   *     If tab handling for the current application isn't supported.
-   */
-  switchToTab(index, window = undefined, focus = true) {
-    if (window) {
-      this.window = window;
-      this.tabBrowser = browser.getTabBrowser(this.window);
-    }
-
-    if (!this.tabBrowser) {
-      return;
-    }
-
-    if (typeof index == "undefined") {
-      this.tab = this.tabBrowser.selectedTab;
-    } else {
-      this.tab = this.tabBrowser.tabs[index];
-
-      if (focus) {
-        if (this.tabBrowser.selectTab) {
-          // Fennec
-          this.tabBrowser.selectTab(this.tab);
-
-        } else if ("selectedTab" in this.tabBrowser) {
-          // Firefox
-          this.tabBrowser.selectedTab = this.tab;
-
-        } else {
-          throw new UnsupportedOperationError("switchToTab() not supported");
-        }
-      }
-    }
-
-    // TODO(ato): Currently tied to curBrowser, but should be moved to
-    // WebElement when introduced by https://bugzil.la/1400256.
-    this.eventObserver = new WebElementEventTarget(this.messageManager);
-  }
-
-  /**
-   * Registers a new frame, and sets its current frame id to this frame
-   * if it is not already assigned, and if a) we already have a session
-   * or b) we're starting a new session and it is the right start frame.
-   *
-   * @param {string} uid
-   *     Frame uid for use by Marionette.
-   * @param {xul:browser} target
-   *     The <xul:browser> that was the target of the originating message.
-   */
-  register(uid, target) {
-    if (this.tabBrowser) {
-      // If we're setting up a new session on Firefox, we only process the
-      // registration for this frame if it belongs to the current tab.
-      if (!this.tab) {
-        this.switchToTab();
-      }
-
-      if (target === this.contentBrowser) {
-        this.updateIdForBrowser(this.contentBrowser, uid);
-        this._needsFlushPendingCommands = true;
-      }
-    }
-
-    // used to delete sessions
-    this.knownFrames.push(uid);
-  }
-
-  /**
-   * Flushes any queued pending commands after a reload of the frame script.
-   */
-  flushPendingCommands() {
-    if (!this._needsFlushPendingCommands) {
-      return;
-    }
-
-    this.pendingCommands.forEach(cb => cb());
-    this.pendingCommands = [];
-    this._needsFlushPendingCommands = false;
-  }
-
-  /**
-    * This function intercepts commands interacting with content and queues
-    * or executes them as needed.
-    *
-    * No commands interacting with content are safe to process until
-    * the new listener script is loaded and registers itself.
-    * This occurs when a command whose effect is asynchronous (such
-    * as goBack) results in a reload of the frame script and new commands
-    * are subsequently posted to the server.
-    */
-  executeWhenReady(cb) {
-    if (this._needsFlushPendingCommands) {
-      this.pendingCommands.push(cb);
-    } else {
-      cb();
-    }
-  }
-
-};
-
-/**
- * The window storage is used to save outer window IDs mapped to weak
- * references of Window objects.
- *
- * Usage:
- *
- *     let wins = new browser.Windows();
- *     wins.set(browser.outerWindowID, window);
- *
- *     ...
- *
- *     let win = wins.get(browser.outerWindowID);
- *
- */
-browser.Windows = class extends Map {
-
-  /**
-   * Save a weak reference to the Window object.
-   *
-   * @param {string} id
-   *     Outer window ID.
-   * @param {Window} win
-   *     Window object to save.
-   *
-   * @return {browser.Windows}
-   *     Instance of self.
-   */
-  set(id, win) {
-    let wref = Cu.getWeakReference(win);
-    super.set(id, wref);
-    return this;
-  }
-
-  /**
-   * Get the window object stored by provided |id|.
-   *
-   * @param {string} id
-   *     Outer window ID.
-   *
-   * @return {Window}
-   *     Saved window object.
-   *
-   * @throws {RangeError}
-   *     If |id| is not in the store.
-   */
-  get(id) {
-    let wref = super.get(id);
-    if (!wref) {
-      throw new RangeError();
-    }
-    return wref.get();
-  }
-
-};
-
-// TODO(ato): Move this to testing/marionette/wm.js
-// after https://bugzil.la/1311041
-/**
- * Marionette representation of the {@link ChromeWindow} window state.
- *
- * @enum {string}
- */
-this.WindowState = {
-  Maximized: "maximized",
-  Minimized: "minimized",
-  Normal: "normal",
-  Fullscreen: "fullscreen",
-
-  /**
-   * Converts {@link nsIDOMChromeWindow.windowState} to WindowState.
-   *
-   * @param {number} windowState
-   *     Attribute from {@link nsIDOMChromeWindow.windowState}.
-   *
-   * @return {WindowState}
-   *     JSON representation.
-   *
-   * @throws {TypeError}
-   *     If <var>windowState</var> was unknown.
-   */
-  from(windowState) {
-    switch (windowState) {
-      case 1:
-        return WindowState.Maximized;
-
-      case 2:
-        return WindowState.Minimized;
-
-      case 3:
-        return WindowState.Normal;
-
-      case 4:
-        return WindowState.Fullscreen;
-
-      default:
-        throw new TypeError(`Unknown window state: ${windowState}`);
-    }
-  },
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/capture.html b/testing/marionette/doc/api/capture.html deleted file mode 100644 --- a/testing/marionette/doc/api/capture.html +++ /dev/null @@ -1,1248 +0,0 @@ - - - - - JSDoc: Namespace: capture - - - - - - - - - - -
- -

Namespace: capture

- - - - - - -
- -
- -

capture

- - -
- -
-
- - -

Provides primitives to capture screenshots.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) canvas(win, left, top, width, height, highlightsopt, canvasopt, flagsopt) → {HTMLCanvasElement}

- - - - - - -
-

Low-level interface to draw a rectangle off the framebuffer.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
win - - -DOMWindow - - - - - - - - - -

The DOM window used for the framebuffer, and providing the interfaces - for creating an HTMLCanvasElement.

left - - -number - - - - - - - - - -

The left, X axis offset of the rectangle.

top - - -number - - - - - - - - - -

The top, Y axis offset of the rectangle.

width - - -number - - - - - - - - - -

The width dimension of the rectangle to paint.

height - - -number - - - - - - - - - -

The height dimension of the rectangle to paint.

highlights - - -Array.<Node> - - - - - - <optional>
- - - - - -

Optional array of nodes, around which a border will be marked to - highlight them in the screenshot.

canvas - - -HTMLCanvasElement - - - - - - <optional>
- - - - - -

Optional canvas to reuse for the screenshot.

flags - - -number - - - - - - <optional>
- - - - - -

Optional integer representing flags to pass to drawWindow; these - are defined on CanvasRenderingContext2D.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The canvas on which the selection from the window's framebuffer - has been painted on.

-
- - - -
-
- Type -
-
- -HTMLCanvasElement - - -
-
- - - - - - - - - - - - - -

(static) element(node, highlightsopt) → {HTMLCanvasElement}

- - - - - - -
-

Take a screenshot of a single element.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
node - - -Node - - - - - - - - - -

The node to take a screenshot of.

highlights - - -Array.<Node> - - - - - - <optional>
- - - - - -

Optional array of nodes, around which a border will be marked to - highlight them in the screenshot.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The canvas element where the element has been painted on.

-
- - - -
-
- Type -
-
- -HTMLCanvasElement - - -
-
- - - - - - - - - - - - - -

(static) toBase64(canvas) → {string}

- - - - - - -
-

Encode the contents of an HTMLCanvasElement to a Base64 encoded string.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
canvas - - -HTMLCanvasElement - - - -

The canvas to encode.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

A Base64 encoded string.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

(static) toHash(canvas) → {string}

- - - - - - -
-

Hash the contents of an HTMLCanvasElement to a SHA-256 hex digest.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
canvas - - -HTMLCanvasElement - - - -

The canvas to encode.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

A hex digest of the SHA-256 hash of the base64 encoded string.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

(static) viewport(win, highlightsopt) → {HTMLCanvasElement}

- - - - - - -
-

Take a screenshot of the window's viewport by taking into account -the current offsets.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
win - - -DOMWindow - - - - - - - - - -

The DOM window providing the document element to capture, - and the offsets for the viewport.

highlights - - -Array.<Node> - - - - - - <optional>
- - - - - -

Optional array of nodes, around which a border will be marked to - highlight them in the screenshot.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

The canvas element where the viewport has been painted on.

-
- - - -
-
- Type -
-
- -HTMLCanvasElement - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/capture.js.html b/testing/marionette/doc/api/capture.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/capture.js.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - JSDoc: Source: capture.js - - - - - - - - - - -
- -

Source: capture.js

- - - - - - -
-
-
/* 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";
-
-Cu.importGlobalProperties(["crypto"]);
-
-this.EXPORTED_SYMBOLS = ["capture"];
-
-const CONTEXT_2D = "2d";
-const BG_COLOUR = "rgb(255,255,255)";
-const PNG_MIME = "image/png";
-const XHTML_NS = "http://www.w3.org/1999/xhtml";
-
-/**
- * Provides primitives to capture screenshots.
- *
- * @namespace
- */
-this.capture = {};
-
-capture.Format = {
-  Base64: 0,
-  Hash: 1,
-};
-
-/**
- * Take a screenshot of a single element.
- *
- * @param {Node} node
- *     The node to take a screenshot of.
- * @param {Array.<Node>=} highlights
- *     Optional array of nodes, around which a border will be marked to
- *     highlight them in the screenshot.
- *
- * @return {HTMLCanvasElement}
- *     The canvas element where the element has been painted on.
- */
-capture.element = function(node, highlights = []) {
-  let win = node.ownerGlobal;
-  let rect = node.getBoundingClientRect();
-
-  return capture.canvas(
-      win,
-      rect.left,
-      rect.top,
-      rect.width,
-      rect.height,
-      {highlights});
-};
-
-/**
- * Take a screenshot of the window's viewport by taking into account
- * the current offsets.
- *
- * @param {DOMWindow} win
- *     The DOM window providing the document element to capture,
- *     and the offsets for the viewport.
- * @param {Array.<Node>=} highlights
- *     Optional array of nodes, around which a border will be marked to
- *     highlight them in the screenshot.
- *
- * @return {HTMLCanvasElement}
- *     The canvas element where the viewport has been painted on.
- */
-capture.viewport = function(win, highlights = []) {
-  let rootNode = win.document.documentElement;
-
-  return capture.canvas(
-      win,
-      win.pageXOffset,
-      win.pageYOffset,
-      rootNode.clientWidth,
-      rootNode.clientHeight,
-      {highlights});
-};
-
-/**
- * Low-level interface to draw a rectangle off the framebuffer.
- *
- * @param {DOMWindow} win
- *     The DOM window used for the framebuffer, and providing the interfaces
- *     for creating an HTMLCanvasElement.
- * @param {number} left
- *     The left, X axis offset of the rectangle.
- * @param {number} top
- *     The top, Y axis offset of the rectangle.
- * @param {number} width
- *     The width dimension of the rectangle to paint.
- * @param {number} height
- *     The height dimension of the rectangle to paint.
- * @param {Array.<Node>=} highlights
- *     Optional array of nodes, around which a border will be marked to
- *     highlight them in the screenshot.
- * @param {HTMLCanvasElement=} canvas
- *     Optional canvas to reuse for the screenshot.
- * @param {number=} flags
- *     Optional integer representing flags to pass to drawWindow; these
- *     are defined on CanvasRenderingContext2D.
- *
- * @return {HTMLCanvasElement}
- *     The canvas on which the selection from the window's framebuffer
- *     has been painted on.
- */
-capture.canvas = function(win, left, top, width, height,
-    {highlights = [], canvas = null, flags = null} = {}) {
-  const scale = win.devicePixelRatio;
-
-  if (canvas === null) {
-    canvas = win.document.createElementNS(XHTML_NS, "canvas");
-    canvas.width = width * scale;
-    canvas.height = height * scale;
-  }
-
-  let ctx = canvas.getContext(CONTEXT_2D);
-  if (flags === null) {
-    flags = ctx.DRAWWINDOW_DRAW_CARET;
-    // TODO(ato): https://bugzil.la/1377335
-    //
-    // Disabled in bug 1243415 for webplatform-test
-    // failures due to out of view elements.  Needs
-    // https://github.com/w3c/web-platform-tests/issues/4383 fixed.
-    /*
-    ctx.DRAWWINDOW_DRAW_VIEW;
-    */
-    // Bug 1009762 - Crash in [@ mozilla::gl::ReadPixelsIntoDataSurface]
-    /*
-    ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
-    */
-  }
-
-  ctx.scale(scale, scale);
-  ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
-  if (highlights.length) {
-    ctx = capture.highlight_(ctx, highlights, top, left);
-  }
-
-  return canvas;
-};
-
-capture.highlight_ = function(context, highlights, top = 0, left = 0) {
-  if (!highlights) {
-    throw new TypeError("Missing highlights");
-  }
-
-  context.lineWidth = "2";
-  context.strokeStyle = "red";
-  context.save();
-
-  for (let el of highlights) {
-    let rect = el.getBoundingClientRect();
-    let oy = -top;
-    let ox = -left;
-
-    context.strokeRect(
-        rect.left + ox,
-        rect.top + oy,
-        rect.width,
-        rect.height);
-  }
-
-  return context;
-};
-
-/**
- * Encode the contents of an HTMLCanvasElement to a Base64 encoded string.
- *
- * @param {HTMLCanvasElement} canvas
- *     The canvas to encode.
- *
- * @return {string}
- *     A Base64 encoded string.
- */
-capture.toBase64 = function(canvas) {
-  let u = canvas.toDataURL(PNG_MIME);
-  return u.substring(u.indexOf(",") + 1);
-};
-
-/**
-* Hash the contents of an HTMLCanvasElement to a SHA-256 hex digest.
-*
-* @param {HTMLCanvasElement} canvas
-*     The canvas to encode.
-*
-* @return {string}
-*     A hex digest of the SHA-256 hash of the base64 encoded string.
-*/
-capture.toHash = function(canvas) {
-  let u = capture.toBase64(canvas);
-  let buffer = new TextEncoder("utf-8").encode(u);
-  return crypto.subtle.digest("SHA-256", buffer).then(hash => hex(hash));
-};
-
-/**
-* Convert buffer into to hex.
-*
-* @param {ArrayBuffer} buffer
-*     The buffer containing the data to convert to hex.
-*
-* @return {string}
-*     A hex digest of the input buffer.
-*/
-function hex(buffer) {
-  let hexCodes = [];
-  let view = new DataView(buffer);
-  for (let i = 0; i < view.byteLength; i += 4) {
-    let value = view.getUint32(i);
-    let stringValue = value.toString(16);
-    let padding = "00000000";
-    let paddedValue = (padding + stringValue).slice(-padding.length);
-    hexCodes.push(paddedValue);
-  }
-  return hexCodes.join("");
-}
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/cert.html b/testing/marionette/doc/api/cert.html deleted file mode 100644 --- a/testing/marionette/doc/api/cert.html +++ /dev/null @@ -1,517 +0,0 @@ - - - - - JSDoc: Namespace: cert - - - - - - - - - - -
- -

Namespace: cert

- - - - - - -
- -
- -

cert

- - -
- -
-
- - -

TLS certificate service override management for Marionette.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) InsecureSweepingOverride()

- - - - - - -
-

Certificate override service that acts in an all-inclusive manner -on TLS certificates.

-

When an invalid certificate is encountered, it is overriden -with the |matching| bit level, which is typically a combination of -|cert.Error.Untrusted|, |cert.Error.Mismatch|, and |cert.Error.Time|.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If there are any problems registering the service.

-
-
-
-
-
-
- Type -
-
- -Components.Exception - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) installOverride(service)

- - - - - - -
-

Installs a TLS certificate service override.

-

The provided |service| must implement the |register| and |unregister| -functions that causes a new |nsICertOverrideService| interface -implementation to be registered with the |nsIComponentRegistrar|.

-

After |service| is registered and made the |cert.currentOverride|, -|nsICertOverrideService| is reinitialised to cause all Gecko components -to pick up the new service.

-

If an override is already installed, i.e. when |cert.currentOverride| -is not null, this functions acts as a NOOP.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
service - - -cert.Override - - - -

Service generator that registers and unregisters the XPCOM service.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If unable to register or initialise |service|.

-
-
-
-
-
-
- Type -
-
- -Components.Exception - - -
-
-
-
-
- - - - - - - - - - - - - - - - -

(static) uninstallOverride()

- - - - - - -
-

Uninstall a TLS certificate service override.

-

After the service has been unregistered, |cert.currentOverride| -is reset to null.

-

If there no current override installed, i.e. if |cert.currentOverride| -is null, this function acts as a NOOP.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/cert.js.html b/testing/marionette/doc/api/cert.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/cert.js.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - JSDoc: Source: cert.js - - - - - - - - - - -
- -

Source: cert.js

- - - - - - -
-
-
/* 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";
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-this.EXPORTED_SYMBOLS = ["cert"];
-
-const registrar =
-    Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-const sss = Cc["@mozilla.org/ssservice;1"]
-    .getService(Ci.nsISiteSecurityService);
-
-const CONTRACT_ID = "@mozilla.org/security/certoverride;1";
-const CERT_PINNING_ENFORCEMENT_PREF =
-    "security.cert_pinning.enforcement_level";
-const HSTS_PRELOAD_LIST_PREF =
-    "network.stricttransportsecurity.preloadlist";
-
-/**
- * TLS certificate service override management for Marionette.
- *
- * @namespace
- */
-this.cert = {
-  Error: {
-    Untrusted: 1,
-    Mismatch: 2,
-    Time: 4,
-  },
-
-  currentOverride: null,
-};
-
-/**
- * Installs a TLS certificate service override.
- *
- * The provided |service| must implement the |register| and |unregister|
- * functions that causes a new |nsICertOverrideService| interface
- * implementation to be registered with the |nsIComponentRegistrar|.
- *
- * After |service| is registered and made the |cert.currentOverride|,
- * |nsICertOverrideService| is reinitialised to cause all Gecko components
- * to pick up the new service.
- *
- * If an override is already installed, i.e. when |cert.currentOverride|
- * is not null, this functions acts as a NOOP.
- *
- * @param {cert.Override} service
- *     Service generator that registers and unregisters the XPCOM service.
- *
- * @throws {Components.Exception}
- *     If unable to register or initialise |service|.
- */
-cert.installOverride = function(service) {
-  if (this.currentOverride) {
-    return;
-  }
-
-  service.register();
-  cert.currentOverride = service;
-};
-
-/**
- * Uninstall a TLS certificate service override.
- *
- * After the service has been unregistered, |cert.currentOverride|
- * is reset to null.
- *
- * If there no current override installed, i.e. if |cert.currentOverride|
- * is null, this function acts as a NOOP.
- */
-cert.uninstallOverride = function() {
-  if (!cert.currentOverride) {
-    return;
-  }
-  cert.currentOverride.unregister();
-  this.currentOverride = null;
-};
-
-/**
- * Certificate override service that acts in an all-inclusive manner
- * on TLS certificates.
- *
- * When an invalid certificate is encountered, it is overriden
- * with the |matching| bit level, which is typically a combination of
- * |cert.Error.Untrusted|, |cert.Error.Mismatch|, and |cert.Error.Time|.
- *
- * @type cert.Override
- *
- * @throws {Components.Exception}
- *     If there are any problems registering the service.
- */
-cert.InsecureSweepingOverride = function() {
-  const CID = Components.ID("{4b67cce0-a51c-11e6-9598-0800200c9a66}");
-  const DESC = "All-encompassing cert service that matches on a bitflag";
-
-  // This needs to be an old-style class with a function constructor
-  // and prototype assignment because... XPCOM.  Any attempt at
-  // modernisation will be met with cryptic error messages which will
-  // make your life miserable.
-  let service = function() {};
-  service.prototype = {
-    hasMatchingOverride(
-        aHostName, aPort, aCert, aOverrideBits, aIsTemporary) {
-      aIsTemporary.value = false;
-      aOverrideBits.value =
-          cert.Error.Untrusted | cert.Error.Mismatch | cert.Error.Time;
-
-      return true;
-    },
-
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsICertOverrideService]),
-  };
-  let factory = XPCOMUtils.generateSingletonFactory(service);
-
-  return {
-    register() {
-      // make it possible to register certificate overrides for domains
-      // that use HSTS or HPKP
-      Preferences.set(HSTS_PRELOAD_LIST_PREF, false);
-      Preferences.set(CERT_PINNING_ENFORCEMENT_PREF, 0);
-
-      registrar.registerFactory(CID, DESC, CONTRACT_ID, factory);
-    },
-
-    unregister() {
-      registrar.unregisterFactory(CID, factory);
-
-      Preferences.reset(HSTS_PRELOAD_LIST_PREF);
-      Preferences.reset(CERT_PINNING_ENFORCEMENT_PREF);
-
-      // clear collected HSTS and HPKP state
-      // through the site security service
-      sss.clearAll();
-      sss.clearPreloads();
-    },
-  };
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/cookie.html b/testing/marionette/doc/api/cookie.html deleted file mode 100644 --- a/testing/marionette/doc/api/cookie.html +++ /dev/null @@ -1,917 +0,0 @@ - - - - - JSDoc: Namespace: cookie - - - - - - - - - - -
- -

Namespace: cookie

- - - - - - -
- -
- -

cookie

- - -
- -
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

(static) add(newCookie, restrictToHostopt)

- - - - - - -
-

Insert cookie to the cookie store.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
newCookie - - -Cookie - - - - - - - - - -

Cookie to add.

restrictToHost - - -string - - - - - - <optional>
- - - - - -

Perform test that newCookie's domain matches this.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If name, value, or domain are - not present and of the correct type.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -TypeError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If restrictToHost is set and newCookie's - domain does not match.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -InvalidCookieDomainError - - -
    -
    -
    -
    -
    - -
  • -
- - - - - - - - - - - - - -

(static) fromJSON(json) → {Cookie}

- - - - - - -
-

Unmarshal a JSON Object to a cookie representation.

-

Effectively this will run validation checks on |json|, which will -produce the errors expected by WebDriver if the input is not valid.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
json - - -Object.<string, (number|boolean|string)> - - - -

Cookie to be deserialised. name and value - are required fields which must be strings. The path and - domain fields are optional, but must be a string if - provided. - The secure, httpOnly, and - sessionfields are similarly optional, but must be - booleans. Likewise, the expiry field is optional but - must be unsigned integer.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

If any of the properties are invalid.

-
-
-
-
-
-
- Type -
-
- -InvalidArgumentError - - -
-
-
-
-
- - - - - -
Returns:
- - -
-

Valid cookie object.

-
- - - -
-
- Type -
-
- -Cookie - - -
-
- - - - - - - - - - - - - -

(static) iter(host, currentPathopt) → {Iterable.<Cookie>}

- - - - - - -
-

Iterates over the cookies for the current host. You may -optionally filter for specific paths on that host by -specifying a path in currentPath.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDefaultDescription
host - - -string - - - - - - - - - - - -

Hostname to retrieve cookies for.

currentPath - - -string - - - - - - <optional>
- - - - - -
- - "/" - -

currentPath - Optionally filter the cookies for host for the - specific path. Defaults to "/", meaning all cookies - for host are included.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Iterator.

-
- - - -
-
- Type -
-
- -Iterable.<Cookie> - - -
-
- - - - - - - - - - - - - -

(static) remove(toDelete)

- - - - - - -
-

Remove cookie from the cookie store.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
toDelete - - -Cookie - - - -

Cookie to remove.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/cookie.js.html b/testing/marionette/doc/api/cookie.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/cookie.js.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - JSDoc: Source: cookie.js - - - - - - - - - - -
- -

Source: cookie.js

- - - - - - -
-
-
/* 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";
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-Cu.import("chrome://marionette/content/assert.js");
-const {
-  InvalidCookieDomainError,
-  pprint,
-} = Cu.import("chrome://marionette/content/error.js", {});
-
-this.EXPORTED_SYMBOLS = ["cookie"];
-
-const IPV4_PORT_EXPR = /:\d+$/;
-
-/** @namespace */
-this.cookie = {
-  manager: Services.cookies,
-};
-
-/**
- * @name Cookie
- *
- * @return {Object.<string, (number|boolean|string)>
- */
-
-/**
- * Unmarshal a JSON Object to a cookie representation.
- *
- * Effectively this will run validation checks on |json|, which will
- * produce the errors expected by WebDriver if the input is not valid.
- *
- * @param {Object.<string, (number|boolean|string)>} json
- *     Cookie to be deserialised.  <var>name</var> and <var>value</var>
- *     are required fields which must be strings.  The <var>path</var> and
- *     <var>domain</var> fields are optional, but must be a string if
- *     provided.
- *     The <var>secure</var>, <var>httpOnly</var>, and
- *     <var>session</var>fields are similarly optional, but must be
- *     booleans.  Likewise, the <var>expiry</var> field is optional but
- *     must be unsigned integer.
- *
- * @return {Cookie}
- *     Valid cookie object.
- *
- * @throws {InvalidArgumentError}
- *     If any of the properties are invalid.
- */
-cookie.fromJSON = function(json) {
-  let newCookie = {};
-
-  assert.object(json, pprint`Expected cookie object, got ${json}`);
-
-  newCookie.name = assert.string(json.name, "Cookie name must be string");
-  newCookie.value = assert.string(json.value, "Cookie value must be string");
-
-  if (typeof json.domain != "undefined") {
-    let domain = assert.string(json.domain, "Cookie domain must be string");
-    if (domain.substring(0, 1) !== ".") {
-      // make sure that this is stored as a domain cookie
-      domain = "." + domain;
-    }
-    newCookie.domain = domain;
-  }
-  if (typeof json.path != "undefined") {
-    newCookie.path = assert.string(json.path, "Cookie path must be string");
-  }
-  if (typeof json.secure != "undefined") {
-    newCookie.secure = assert.boolean(json.secure, "Cookie secure flag must be boolean");
-  }
-  if (typeof json.httpOnly != "undefined") {
-    newCookie.httpOnly = assert.boolean(json.httpOnly, "Cookie httpOnly flag must be boolean");
-  }
-  if (typeof json.session != "undefined") {
-    newCookie.session = assert.boolean(json.session, "Cookie session flag must be boolean");
-  }
-  if (typeof json.expiry != "undefined") {
-    newCookie.expiry = assert.positiveInteger(json.expiry, "Cookie expiry must be a positive integer");
-  }
-
-  return newCookie;
-};
-
-/**
- * Insert cookie to the cookie store.
- *
- * @param {Cookie} newCookie
- *     Cookie to add.
- * @param {string=} restrictToHost
- *     Perform test that <var>newCookie</var>'s domain matches this.
- *
- * @throws {TypeError}
- *     If <var>name</var>, <var>value</var>, or <var>domain</var> are
- *     not present and of the correct type.
- * @throws {InvalidCookieDomainError}
- *     If <var>restrictToHost</var> is set and <var>newCookie</var>'s
- *     domain does not match.
- */
-cookie.add = function(newCookie, {restrictToHost = null} = {}) {
-  assert.string(newCookie.name, "Cookie name must be string");
-  assert.string(newCookie.value, "Cookie value must be string");
-  assert.string(newCookie.domain, "Cookie domain must be string");
-
-  if (typeof newCookie.path == "undefined") {
-    newCookie.path = "/";
-  }
-
-  if (typeof newCookie.expiry == "undefined") {
-    // twenty years into the future
-    let date = new Date();
-    let now = new Date(Date.now());
-    date.setYear(now.getFullYear() + 20);
-    newCookie.expiry = date.getTime() / 1000;
-  }
-
-  if (restrictToHost) {
-    if (!restrictToHost.endsWith(newCookie.domain) &&
-        ("." + restrictToHost) !== newCookie.domain) {
-      throw new InvalidCookieDomainError(
-          `Cookies may only be set ` +
-          `for the current domain (${restrictToHost})`);
-    }
-  }
-
-  // remove port from domain, if present.
-  // unfortunately this catches IPv6 addresses by mistake
-  // TODO: Bug 814416
-  newCookie.domain = newCookie.domain.replace(IPV4_PORT_EXPR, "");
-
-  cookie.manager.add(
-      newCookie.domain,
-      newCookie.path,
-      newCookie.name,
-      newCookie.value,
-      newCookie.secure,
-      newCookie.httpOnly,
-      newCookie.session,
-      newCookie.expiry,
-      {} /* origin attributes */);
-};
-
-/**
- * Remove cookie from the cookie store.
- *
- * @param {Cookie} toDelete
- *     Cookie to remove.
- */
-cookie.remove = function(toDelete) {
-  cookie.manager.remove(
-      toDelete.domain,
-      toDelete.name,
-      toDelete.path,
-      false,
-      {} /* originAttributes */);
-};
-
-/**
- * Iterates over the cookies for the current <var>host</var>.  You may
- * optionally filter for specific paths on that <var>host</var> by
- * specifying a path in <var>currentPath</var>.
- *
- * @param {string} host
- *     Hostname to retrieve cookies for.
- * @param {string=} [currentPath="/"] currentPath
- *     Optionally filter the cookies for <var>host</var> for the
- *     specific path.  Defaults to "<tt>/</tt>", meaning all cookies
- *     for <var>host</var> are included.
- *
- * @return {Iterable.<Cookie>}
- *     Iterator.
- */
-cookie.iter = function* (host, currentPath = "/") {
-  assert.string(host, "host must be string");
-  assert.string(currentPath, "currentPath must be string");
-
-  const isForCurrentPath = path => currentPath.indexOf(path) != -1;
-
-  let en = cookie.manager.getCookiesFromHost(host, {});
-  while (en.hasMoreElements()) {
-    let cookie = en.getNext().QueryInterface(Ci.nsICookie2);
-    // take the hostname and progressively shorten
-    let hostname = host;
-    do {
-      if ((cookie.host == "." + hostname || cookie.host == hostname) &&
-          isForCurrentPath(cookie.path)) {
-        yield {
-          "name": cookie.name,
-          "value": cookie.value,
-          "path": cookie.path,
-          "domain": cookie.host,
-          "secure": cookie.isSecure,
-          "httpOnly": cookie.isHttpOnly,
-          "expiry": cookie.expiry,
-        };
-      }
-      hostname = hostname.replace(/^.*?\./, "");
-    } while (hostname.indexOf(".") != -1);
-  }
-};
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/dom.js.html b/testing/marionette/doc/api/dom.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/dom.js.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - JSDoc: Source: dom.js - - - - - - - - - - -
- -

Source: dom.js

- - - - - - -
-
-
/* 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";
-
-const {utils: Cu} = Components;
-
-this.EXPORTED_SYMBOLS = [
-  "ContentEventObserverService",
-  "WebElementEventTarget",
-];
-
-/**
- * The {@link EventTarget} for web elements can be used to observe DOM
- * events in the content document.
- *
- * A caveat of the current implementation is that it is only possible
- * to listen for top-level <code>window</code> global events.
- *
- * It needs to be backed by a {@link ContentEventObserverService} in a
- * content frame script.
- *
- * Usage:
- *
- * <pre><code>
- *     let observer = new WebElementEventTarget(messageManager);
- *     await new Promise(resolve => {
- *       observer.addEventListener("visibilitychange", resolve, {once: true});
- *       chromeWindow.minimize();
- *     });
- * </code></pre>
- */
-class WebElementEventTarget {
-  /**
-   * @param {function(): nsIMessageListenerManager} messageManagerFn
-   *     Message manager to the current browser.
-   */
-  constructor(messageManager) {
-    this.mm = messageManager;
-    this.listeners = {};
-    this.mm.addMessageListener("Marionette:DOM:OnEvent", this);
-  }
-
-  /**
-   * Register an event handler of a specific event type from the content
-   * frame.
-   *
-   * @param {string} type
-   *     Event type to listen for.
-   * @param {EventListener} listener
-   *     Object which receives a notification (a {@link BareEvent})
-   *     when an event of the specified type occurs.  This must be
-   *     an object implementing the {@link EventListener} interface,
-   *     or a JavaScript function.
-   * @param {boolean=} once
-   *     Indicates that the <var>listener</var> should be invoked at
-   *     most once after being added.  If true, the <var>listener</var>
-   *     would automatically be removed when invoked.
-   */
-  addEventListener(type, listener, {once = false} = {}) {
-    if (!(type in this.listeners)) {
-      this.listeners[type] = [];
-    }
-
-    if (!this.listeners[type].includes(listener)) {
-      listener.once = once;
-      this.listeners[type].push(listener);
-    }
-
-    this.mm.sendAsyncMessage("Marionette:DOM:AddEventListener", {type});
-  }
-
-  /**
-   * Removes an event listener.
-   *
-   * @param {string} type
-   *     Type of event to cease listening for.
-   * @param {EventListener} listener
-   *     Event handler to remove from the event target.
-   */
-  removeEventListener(type, listener) {
-    if (!(type in this.listeners)) {
-      return;
-    }
-
-    let stack = this.listeners[type];
-    for (let i = stack.length - 1; i >= 0; --i) {
-      if (stack[i] === listener) {
-        stack.splice(i, 1);
-        if (stack.length == 0) {
-          this.mm.sendAsyncMessage("Marionette:DOM:RemoveEventListener", {type});
-        }
-        return;
-      }
-    }
-  }
-
-  dispatchEvent(event) {
-    if (!(event.type in this.listeners)) {
-      return;
-    }
-
-    event.target = this;
-
-    let stack = this.listeners[event.type].slice(0);
-    stack.forEach(listener => {
-      listener.call(this, event);
-
-      if (listener.once) {
-        this.removeEventListener(event.type, listener);
-      }
-    });
-  }
-
-  receiveMessage({target, name, data, objects}) {
-    if (name != "Marionette:DOM:OnEvent") {
-      return;
-    }
-
-    let ev = {
-      type: data.type,
-      target: objects.target,
-    };
-    this.dispatchEvent(ev);
-  }
-}
-this.WebElementEventTarget = WebElementEventTarget;
-
-/**
- * Provides the frame script backend for the
- * {@link WebElementEventTarget}.
- *
- * This service receives requests for new DOM events to listen for and
- * to cease listening for, and despatches IPC messages to the browser
- * when they fire.
- */
-class ContentEventObserverService {
-  /**
-   * @param {WindowProxy} windowGlobal
-   *     Window.
-   * @param {nsIMessageSender.sendAsyncMessage} sendAsyncMessage
-   *     Function for sending an async message to the parent browser.
-   */
-  constructor(windowGlobal, sendAsyncMessage) {
-    this.window = windowGlobal;
-    this.sendAsyncMessage = sendAsyncMessage;
-    this.events = new Set();
-  }
-
-  /**
-   * Observe a new DOM event.
-   *
-   * When the DOM event of <var>type</var> fires, a message is passed
-   * to the parent browser's event observer.
-   *
-   * If event type is already being observed, only a single message
-   * is sent.  E.g. multiple registration for events will only ever emit
-   * a maximum of one message.
-   *
-   * @param {string} type
-   *     DOM event to listen for.
-   */
-  add(type) {
-    if (this.events.has(type)) {
-      return;
-    }
-    this.window.addEventListener(type, this);
-    this.events.add(type);
-  }
-
-  /**
-   * Ceases observing a DOM event.
-   *
-   * @param {string} type
-   *     DOM event to stop listening for.
-   */
-  remove(type) {
-    if (!this.events.has(type)) {
-      return;
-    }
-    this.window.removeEventListener(type, this);
-    this.events.delete(type);
-  }
-
-  /** Ceases observing all previously registered DOM events. */
-  clear() {
-    for (let ev of this) {
-      this.remove(ev);
-    }
-  }
-
-  * [Symbol.iterator]() {
-    for (let ev of this.events) {
-      yield ev;
-    }
-  }
-
-  handleEvent({type, target}) {
-    this.sendAsyncMessage("Marionette:DOM:OnEvent", {type}, {target});
-  }
-}
-this.ContentEventObserverService = ContentEventObserverService;
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/driver.html b/testing/marionette/doc/api/driver.html deleted file mode 100644 --- a/testing/marionette/doc/api/driver.html +++ /dev/null @@ -1,511 +0,0 @@ - - - - - JSDoc: Namespace: driver - - - - - - - - - - -
- -

Namespace: driver

- - - - - - -
- -
- -

driver

- - -
- -
-
- - -

The Marionette WebDriver services provides a standard conforming -implementation of the W3C WebDriver specification.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - -
See:
-
- -
- - - -
- - - - -
- - - - - - - - - - - - - - -

Members

- - - -

(static) this.Context

- - - - - - - - - - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
CHROME - -
CONTENT - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - -

Methods

- - - - - - - -

(generator, static) enumeratorIterator(enumerator) → {Iterable}

- - - - - - -
-

Helper function for converting a nsISimpleEnumerator to a -JavaScript iterator.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
enumerator - - -nsISimpleEnumerator - - - -

Enumerator to turn into iterator.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Iterator.

-
- - - -
-
- Type -
-
- -Iterable - - -
-
- - - - - - - - - - - - - -

(static) this.Context.fromString()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/driver.js.html b/testing/marionette/doc/api/driver.js.html deleted file mode 100644 --- a/testing/marionette/doc/api/driver.js.html +++ /dev/null @@ -1,3795 +0,0 @@ - - - - - JSDoc: Source: driver.js - - - - - - - - - - -
- -

Source: driver.js

- - - - - - -
-
-
/* 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";
-/* global XPCNativeWrapper */
-
-const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-    .getService(Ci.mozIJSSubScriptLoader);
-
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("chrome://marionette/content/accessibility.js");
-Cu.import("chrome://marionette/content/addon.js");
-Cu.import("chrome://marionette/content/assert.js");
-Cu.import("chrome://marionette/content/atom.js");
-const {
-  browser,
-  WindowState,
-} = Cu.import("chrome://marionette/content/browser.js", {});
-Cu.import("chrome://marionette/content/capture.js");
-Cu.import("chrome://marionette/content/cert.js");
-Cu.import("chrome://marionette/content/cookie.js");
-Cu.import("chrome://marionette/content/element.js");
-const {
-  ElementNotInteractableError,
-  error,
-  InsecureCertificateError,
-  InvalidArgumentError,
-  InvalidCookieDomainError,
-  InvalidSelectorError,
-  NoAlertOpenError,
-  NoSuchFrameError,
-  NoSuchWindowError,
-  SessionNotCreatedError,
-  UnknownError,
-  UnsupportedOperationError,
-  WebDriverError,
-} = Cu.import("chrome://marionette/content/error.js", {});
-Cu.import("chrome://marionette/content/evaluate.js");
-Cu.import("chrome://marionette/content/event.js");
-Cu.import("chrome://marionette/content/interaction.js");
-Cu.import("chrome://marionette/content/l10n.js");
-Cu.import("chrome://marionette/content/legacyaction.js");
-Cu.import("chrome://marionette/content/modal.js");
-Cu.import("chrome://marionette/content/proxy.js");
-Cu.import("chrome://marionette/content/reftest.js");
-Cu.import("chrome://marionette/content/session.js");
-const {wait, TimedPromise} = Cu.import("chrome://marionette/content/wait.js", {});
-
-Cu.importGlobalProperties(["URL"]);
-
-this.EXPORTED_SYMBOLS = ["GeckoDriver", "Context"];
-
-const FRAME_SCRIPT = "chrome://marionette/content/listener.js";
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-const CLICK_TO_START_PREF = "marionette.debugging.clicktostart";
-const CONTENT_LISTENER_PREF = "marionette.contentListener";
-
-const SUPPORTED_STRATEGIES = new Set([
-  element.Strategy.ClassName,
-  element.Strategy.Selector,
-  element.Strategy.ID,
-  element.Strategy.TagName,
-  element.Strategy.XPath,
-  element.Strategy.Anon,
-  element.Strategy.AnonAttribute,
-]);
-
-const logger = Log.repository.getLogger("Marionette");
-const globalMessageManager = Cc["@mozilla.org/globalmessagemanager;1"]
-    .getService(Ci.nsIMessageBroadcaster);
-
-/**
- * The Marionette WebDriver services provides a standard conforming
- * implementation of the W3C WebDriver specification.
- *
- * @see {@link https://w3c.github.io/webdriver/webdriver-spec.html}
- * @namespace driver
- */
-
-/**
- * @enum
- * @memberof driver
- */
-this.Context = {
-  CHROME: "chrome",
-  CONTENT: "content",
-};
-
-/** @memberof driver */
-this.Context.fromString = function(s) {
-  s = s.toUpperCase();
-  if (s in this) {
-    return this[s];
-  }
-  return null;
-};
-
-/**
- * Helper function for converting a {@link nsISimpleEnumerator} to a
- * JavaScript iterator.
- *
- * @memberof driver
- *
- * @param {nsISimpleEnumerator} enumerator
- *     Enumerator to turn into  iterator.
- *
- * @return {Iterable}
- *     Iterator.
- */
-function* enumeratorIterator(enumerator) {
-  while (enumerator.hasMoreElements()) {
-    yield enumerator.getNext();
-  }
-}
-
-/**
- * Implements (parts of) the W3C WebDriver protocol.  GeckoDriver lives
- * in chrome space and mediates calls to the message listener of the current
- * browsing context's content frame message listener via ListenerProxy.
- *
- * Throughout this prototype, functions with the argument <var>cmd</var>'s
- * documentation refers to the contents of the <code>cmd.parameter</code>
- * object.
- *
- * @class GeckoDriver
- *
- * @param {string} appName
- *     Description of the product, for example "Firefox".
- * @param {MarionetteServer} server
- *     The instance of Marionette server.
- */
-this.GeckoDriver = function(appName, server) {
-  this.appName = appName;
-  this._server = server;
-
-  this.sessionID = null;
-  this.wins = new browser.Windows();
-  this.browsers = {};
-  // points to current browser
-  this.curBrowser = null;
-  // topmost chrome frame
-  this.mainFrame = null;
-  // chrome iframe that currently has focus
-  this.curFrame = null;
-  this.mozBrowserClose = null;
-  this.currentFrameElement = null;
-  // frame ID of the current remote frame, used for mozbrowserclose events
-  this.oopFrameId = null;
-  this.observing = null;
-  this._browserIds = new WeakMap();
-
-  // The curent context decides if commands should affect chrome- or
-  // content space.
-  this.context = Context.CONTENT;
-
-  this.sandboxes = new Sandboxes(() => this.getCurrentWindow());
-  this.legacyactions = new legacyaction.Chain();
-
-  this.timer = null;
-  this.inactivityTimer = null;
-
-  this.testName = null;
-
-  this.capabilities = new session.Capabilities();
-
-  this.mm = globalMessageManager;
-  this.listener = proxy.toListener(() => this.mm, this.sendAsync.bind(this),
-      () => this.curBrowser);
-
-  // points to an alert instance if a modal dialog is present
-  this.dialog = null;
-  this.dialogHandler = this.globalModalDialogHandler.bind(this);
-};
-
-Object.defineProperty(GeckoDriver.prototype, "a11yChecks", {
-  get() {
-    return this.capabilities.get("moz:accessibilityChecks");
-  },
-});
-
-/**
- * Returns the current URL of the ChromeWindow or content browser,
- * depending on context.
- *
- * @return {URL}
- *     Read-only property containing the currently loaded URL.
- */
-Object.defineProperty(GeckoDriver.prototype, "currentURL", {
-  get() {
-    switch (this.context) {
-      case Context.CHROME:
-        let chromeWin = this.getCurrentWindow();
-        return new URL(chromeWin.location.href);
-
-      case Context.CONTENT:
-        return new URL(this.curBrowser.currentURI.spec);
-
-      default:
-        throw TypeError(`Unknown context: ${this.context}`);
-    }
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "title", {
-  get() {
-    switch (this.context) {
-      case Context.CHROME:
-        let chromeWin = this.getCurrentWindow();
-        return chromeWin.document.documentElement.getAttribute("title");
-
-      case Context.CONTENT:
-        return this.curBrowser.currentTitle;
-
-      default:
-        throw TypeError(`Unknown context: ${this.context}`);
-    }
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "proxy", {
-  get() {
-    return this.capabilities.get("proxy");
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "secureTLS", {
-  get() {
-    return !this.capabilities.get("acceptInsecureCerts");
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "timeouts", {
-  get() {
-    return this.capabilities.get("timeouts");
-  },
-
-  set(newTimeouts) {
-    this.capabilities.set("timeouts", newTimeouts);
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "windows", {
-  get() {
-    return enumeratorIterator(Services.wm.getEnumerator(null));
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "windowHandles", {
-  get() {
-    let hs = [];
-
-    for (let win of this.windows) {
-      let tabBrowser = browser.getTabBrowser(win);
-
-      // Only return handles for browser windows
-      if (tabBrowser && tabBrowser.tabs) {
-        tabBrowser.tabs.forEach(tab => {
-          let winId = this.getIdForBrowser(browser.getBrowserForTab(tab));
-          if (winId !== null) {
-            hs.push(winId);
-          }
-        });
-      }
-    }
-
-    return hs;
-  },
-});
-
-Object.defineProperty(GeckoDriver.prototype, "chromeWindowHandles", {
-  get() {
-    let hs = [];
-
-    for (let win of this.windows) {
-      hs.push(getOuterWindowId(win));
-    }
-
-    return hs;
-  },
-});
-
-GeckoDriver.prototype.QueryInterface = XPCOMUtils.generateQI([
-  Ci.nsIMessageListener,
-  Ci.nsIObserver,
-  Ci.nsISupportsWeakReference,
-]);
-
-/**
- * Callback used to observe the creation of new modal or tab modal dialogs
- * during the session's lifetime.
- */
-GeckoDriver.prototype.globalModalDialogHandler = function(subject, topic) {
-  let winr;
-  if (topic === modal.COMMON_DIALOG_LOADED) {
-    // Always keep a weak reference to the current dialog
-    winr = Cu.getWeakReference(subject);
-  }
-  this.dialog = new modal.Dialog(() => this.curBrowser, winr);
-};
-
-/**
- * Switches to the global ChromeMessageBroadcaster, potentially replacing
- * a frame-specific ChromeMessageSender.  Has no effect if the global
- * ChromeMessageBroadcaster is already in use.  If this replaces a
- * frame-specific ChromeMessageSender, it removes the message listeners
- * from that sender, and then puts the corresponding frame script "to
- * sleep", which removes most of the message listeners from it as well.
- */
-GeckoDriver.prototype.switchToGlobalMessageManager = function() {
-  if (this.curBrowser &&
-      this.curBrowser.frameManager.currentRemoteFrame !== null) {
-    this.curBrowser.frameManager.removeMessageManagerListeners(this.mm);
-    this.sendAsync("sleepSession");
-    this.curBrowser.frameManager.currentRemoteFrame = null;
-  }
-  this.mm = globalMessageManager;
-};
-
-/**
- * Helper method to send async messages to the content listener.
- * Correct usage is to pass in the name of a function in listener.js,
- * a serialisable object, and optionally the current command's ID
- * when not using the modern dispatching technique.
- *
- * @param {string} name
- *     Suffix of the targetted message listener
- *     <tt>Marionette:SUFFIX</tt>.
- * @param {Object=} msg
- *     Optional JSON serialisable object to send to the listener.
- * @param {number=} commandID
- *     Optional command ID to ensure synchronisity.
- */
-GeckoDriver.prototype.sendAsync = function(name, data, commandID) {
-  name = "Marionette:" + name;
-  let payload = copy(data);
-
-  // TODO(ato): When proxy.AsyncMessageChannel
-  // is used for all chrome <-> content communication
-  // this can be removed.
-  if (commandID) {
-    payload.commandID = commandID;
-  }
-
-  if (!this.curBrowser.frameManager.currentRemoteFrame) {
-    this.broadcastDelayedAsyncMessage_(name, payload);
-  } else {
-    this.sendTargettedAsyncMessage_(name, payload);
-  }
-};
-
-// eslint-disable-next-line
-GeckoDriver.prototype.broadcastDelayedAsyncMessage_ = function(name, payload) {
-  this.curBrowser.executeWhenReady(() => {
-    if (this.curBrowser.curFrameId) {
-      const target = name + this.curBrowser.curFrameId;
-      this.mm.broadcastAsyncMessage(target, payload);
-    } else {
-      throw new NoSuchWindowError(
-          "No such content frame; perhaps the listener was not registered?");
-    }
-  });
-};
-
-GeckoDriver.prototype.sendTargettedAsyncMessage_ = function(name, payload) {
-  const curRemoteFrame = this.curBrowser.frameManager.currentRemoteFrame;
-  const target = name + curRemoteFrame.targetFrameId;
-
-  try {
-    this.mm.sendAsyncMessage(target, payload);
-  } catch (e) {
-    switch (e.result) {
-      case Cr.NS_ERROR_FAILURE:
-      case Cr.NS_ERROR_NOT_INITIALIZED:
-        throw new NoSuchWindowError();
-
-      default:
-        throw new WebDriverError(e);
-    }
-  }
-};
-
-/**
- * Get the session's current top-level browsing context.
- *
- * It will return the outer {@link ChromeWindow} previously selected by
- * window handle through {@link #switchToWindow}, or the first window that
- * was registered.
- *
- * @param {Context=} forcedContext
- *     Optional name of the context to use for finding the window.
- *     It will be required if a command always needs a specific context,
- *     whether which context is currently set. Defaults to the current
- *     context.
- *
- * @return {ChromeWindow}
- *     The current top-level browsing context.
- */
-GeckoDriver.prototype.getCurrentWindow = function(forcedContext = undefined) {
-  let context = typeof forcedContext == "undefined" ? this.context : forcedContext;
-  let win = null;
-
-  switch (context) {
-    case Context.CHROME:
-      if (this.curFrame !== null) {
-        win = this.curFrame;
-      } else if (this.curBrowser !== null) {
-        win = this.curBrowser.window;
-      }
-      break;
-
-    case Context.CONTENT:
-      if (this.curFrame !== null) {
-        win = this.curFrame;
-      } else if (this.curBrowser !== null && this.curBrowser.contentBrowser) {
-        win = this.curBrowser.window;
-      }
-      break;
-  }
-
-  return win;
-};
-
-GeckoDriver.prototype.isReftestBrowser = function(element) {
-  return this._reftest &&
-    element &&
-    element.tagName === "xul:browser" &&
-    element.parentElement &&
-    element.parentElement.id === "reftest";
-};
-
-GeckoDriver.prototype.addFrameCloseListener = function(action) {
-  let win = this.getCurrentWindow();
-  this.mozBrowserClose = e => {
-    if (e.target.id == this.oopFrameId) {
-      win.removeEventListener("mozbrowserclose", this.mozBrowserClose, true);
-      this.switchToGlobalMessageManager();
-      throw new NoSuchWindowError("The window closed during action: " + action);
-    }
-  };
-  win.addEventListener("mozbrowserclose", this.mozBrowserClose, true);
-};
-
-/**
- * Create a new browsing context for window and add to known browsers.
- *
- * @param {ChromeWindow} win
- *     Window for which we will create a browsing context.
- *
- * @return {string}
- *     Returns the unique server-assigned ID of the window.
- */
-GeckoDriver.prototype.addBrowser = function(window) {
-  let bc = new browser.Context(window, this);
-  let winId = getOuterWindowId(window);
-
-  this.browsers[winId] = bc;
-  this.curBrowser = this.browsers[winId];
-  if (!this.wins.has(winId)) {
-    // add this to seenItems so we can guarantee
-    // the user will get winId as this window's id
-    this.wins.set(winId, window);
-  }
-};
-
-/**
- * Registers a new browser, win, with Marionette.
- *
- * If we have not seen the browser content window before, the listener
- * frame script will be loaded into it.  If isNewSession is true, we will
- * switch focus to the start frame when it registers.
- *
- * @param {ChromeWindow} win
- *     Window whose browser we need to access.
- * @param {boolean=} [false] isNewSession
- *     True if this is the first time we're talking to this browser.
- */
-GeckoDriver.prototype.startBrowser = function(window, isNewSession = false) {
-  this.mainFrame = window;
-  this.curFrame = null;
-  this.addBrowser(window);
-  this.curBrowser.isNewSession = isNewSession;
-  this.whenBrowserStarted(window, isNewSession);
-};
-
-/**
- * Callback invoked after a new session has been started in a browser.
- * Loads the Marionette frame script into the browser if needed.
- *
- * @param {ChromeWindow} window
- *     Window whose browser we need to access.
- * @param {boolean} isNewSession
- *     True if this is the first time we're talking to this browser.
- */
-GeckoDriver.prototype.whenBrowserStarted = function(window, isNewSession) {
-  let mm = window.messageManager;
-  if (mm) {
-    if (!isNewSession) {
-      // Loading the frame script corresponds to a situation we need to
-      // return to the server. If the messageManager is a message broadcaster
-      // with no children, we don't have a hope of coming back from this
-      // call, so send the ack here. Otherwise, make a note of how many
-      // child scripts will be loaded so we known when it's safe to return.
-      // Child managers may not have child scripts yet (e.g. socialapi),
-      // only count child managers that have children, but only count the top
-      // level children as they are the ones that we expect a response from.
-      if (mm.childCount !== 0) {
-        this.curBrowser.frameRegsPending = 0;
-        for (let i = 0; i < mm.childCount; i++) {
-          if (mm.getChildAt(i).childCount !== 0) {
-            this.curBrowser.frameRegsPending += 1;
-          }
-        }
-      }
-    }
-
-    if (!Preferences.get(CONTENT_LISTENER_PREF) || !isNewSession) {
-      // load listener into the remote frame
-      // and any applicable new frames
-      // opened after this call
-      mm.loadFrameScript(FRAME_SCRIPT, true);
-      Preferences.set(CONTENT_LISTENER_PREF, true);
-    }
-  } else {
-    logger.error("Unable to load content frame script");
-  }
-};
-
-/**
- * Recursively get all labeled text.
- *
- * @param {Element} el
- *     The parent element.
- * @param {Array.<string>} lines
- *      Array that holds the text lines.
- */
-GeckoDriver.prototype.getVisibleText = function(el, lines) {
-  try {
-    if (atom.isElementDisplayed(el, this.getCurrentWindow())) {
-      if (el.value) {
-        lines.push(el.value);
-      }
-      for (let child in el.childNodes) {
-        this.getVisibleText(el.childNodes[child], lines);
-      }
-    }
-  } catch (e) {
-    if (el.nodeName == "#text") {
-      lines.push(el.textContent);
-    }
-  }
-};
-
-/**
- * Handles registration of new content listener browsers.  Depending on
- * their type they are either accepted or ignored.
- */
-GeckoDriver.prototype.registerBrowser = function(id, be) {
-  let nullPrevious = this.curBrowser.curFrameId === null;
-  let listenerWindow = Services.wm.getOuterWindowWithId(id);
-
-  // go in here if we're already in a remote frame
-  if (this.curBrowser.frameManager.currentRemoteFrame !== null &&
-      (!listenerWindow || this.mm == this.curBrowser.frameManager
-          .currentRemoteFrame.messageManager.get())) {
-    // The outerWindowID from an OOP frame will not be meaningful to
-    // the parent process here, since each process maintains its own
-    // independent window list.  So, it will either be null (!listenerWindow)
-    // if we're already in a remote frame, or it will point to some
-    // random window, which will hopefully cause an href mismatch.
-    // Currently this only happens in B2G for OOP frames registered in
-    // Marionette:switchToFrame, so we'll acknowledge the switchToFrame
-    // message here.
-    //
-    // TODO: Should have a better way of determining that this message
-    // is from a remote frame.
-    this.curBrowser.frameManager.currentRemoteFrame.targetFrameId = id;
-  }
-
-  // We want to ignore frames that are XUL browsers that aren't in the "main"
-  // tabbrowser, but accept things on Fennec (which doesn't have a
-  // xul:tabbrowser), and accept HTML iframes (because tests depend on it),
-  // as well as XUL frames. Ideally this should be cleaned up and we should
-  // keep track of browsers a different way.
-  if (this.appName != "Firefox" || be.namespaceURI != XUL_NS ||
-      be.nodeName != "browser" || be.getTabBrowser()) {
-    // curBrowser holds all the registered frames in knownFrames
-    this.curBrowser.register(id, be);
-  }
-
-  this.wins.set(id, listenerWindow);
-  if (nullPrevious && (this.curBrowser.curFrameId !== null)) {
-    this.sendAsync(
-        "newSession",
-        this.capabilities.toJSON(),
-        this.newSessionCommandId);
-    if (this.curBrowser.isNewSession) {
-      this.newSessionCommandId = null;
-    }
-  }
-
-  return [id, this.capabilities.toJSON()];
-};
-
-GeckoDriver.prototype.registerPromise = function() {
-  const li = "Marionette:register";
-
-  return new Promise(resolve => {
-    let cb = msg => {
-      let wid = msg.json.value;
-      let be = msg.target;
-      let rv = this.registerBrowser(wid, be);
-
-      if (this.curBrowser.frameRegsPending > 0) {
-        this.curBrowser.frameRegsPending--;
-      }
-
-      if (this.curBrowser.frameRegsPending === 0) {
-        this.mm.removeMessageListener(li, cb);
-        resolve();
-      }
-
-      // this is a sync message and listeners expect the ID back
-      return rv;
-    };
-    this.mm.addMessageListener(li, cb);
-  });
-};
-
-GeckoDriver.prototype.listeningPromise = function() {
-  const li = "Marionette:listenersAttached";
-
-  return new Promise(resolve => {
-    let cb = msg => {
-      if (msg.json.listenerId === this.curBrowser.curFrameId) {
-        this.mm.removeMessageListener(li, cb);
-        resolve();
-      }
-    };
-    this.mm.addMessageListener(li, cb);
-  });
-};
-
-/**
- * Create a new WebDriver session.
- *
- * It is expected that the caller performs the necessary checks on
- * the requested capabilities to be WebDriver conforming.  The WebDriver
- * service offered by Marionette does not match or negotiate capabilities
- * beyond type- and bounds checks.
- *
- * <h3>Capabilities</h3>
- *
- * <dl>
- *  <dt><code>pageLoadStrategy</code> (string)
- *  <dd>The page load strategy to use for the current session.  Must be
- *   one of "<tt>none</tt>", "<tt>eager</tt>", and "<tt>normal</tt>".
- *
- *  <dt><code>acceptInsecureCerts</code> (boolean)
- *  <dd>Indicates whether untrusted and self-signed TLS certificates
- *   are implicitly trusted on navigation for the duration of the session.
- *
- *  <dt><code>timeouts</code> (Timeouts object)
- *  <dd>Describes the timeouts imposed on certian session operations.
- *
- *  <dt><code>proxy</code> (Proxy object)
- *  <dd>Defines the proxy configuration.
- *
- *  <dt><code>moz:accessibilityChecks</code> (boolean)
- *  <dd>Run a11y checks when clicking elements.
- *
- *  <dt><code>moz:webdriverClick</code> (boolean)
- *  <dd>Use a WebDriver conforming <i>WebDriver::ElementClick</i>.
- * </dl>
- *
- * <h4>Timeouts object</h4>
- *
- * <dl>
- *  <dt><code>script</code> (number)
- *  <dd>Determines when to interrupt a script that is being evaluates.
- *
- *  <dt><code>pageLoad</code> (number)
- *  <dd>Provides the timeout limit used to interrupt navigation of the
- *   browsing context.
- *
- *  <dt><code>implicit</code> (number)
- *  <dd>Gives the timeout of when to abort when locating an element.
- * </dl>
- *
- * <h4>Proxy object</h4>
- *
- * <dl>
- *  <dt><code>proxyType</code> (string)
- *  <dd>Indicates the type of proxy configuration.  Must be one
- *   of "<tt>pac</tt>", "<tt>direct</tt>", "<tt>autodetect</tt>",
- *   "<tt>system</tt>", or "<tt>manual</tt>".
- *
- *  <dt><code>proxyAutoconfigUrl</code> (string)
- *  <dd>Defines the URL for a proxy auto-config file if
- *   <code>proxyType</code> is equal to "<tt>pac</tt>".
- *
- *  <dt><code>ftpProxy</code> (string)
- *  <dd>Defines the proxy host for FTP traffic when the
- *   <code>proxyType</code> is "<tt>manual</tt>".
- *
- *  <dt><code>httpProxy</code> (string)
- *  <dd>Defines the proxy host for HTTP traffic when the
- *   <code>proxyType</code> is "<tt>manual</tt>".
- *
- *  <dt><code>noProxy</code> (string)
- *  <dd>Lists the adress for which the proxy should be bypassed when
- *   the <code>proxyType</code> is "<tt>manual</tt>".  Must be a JSON
- *   List containing any number of any of domains, IPv4 addresses, or IPv6
- *   addresses.
- *
- *  <dt><code>sslProxy</code> (string)
- *  <dd>Defines the proxy host for encrypted TLS traffic when the
- *   <code>proxyType</code> is "<tt>manual</tt>".
- *
- *  <dt><code>socksProxy</code> (string)
- *  <dd>Defines the proxy host for a SOCKS proxy traffic when the
- *   <code>proxyType</code> is "<tt>manual</tt>".
- *
- *  <dt><code>socksVersion</code> (string)
- *  <dd>Defines the SOCKS proxy version when the <code>proxyType</code> is
- *   "<tt>manual</tt>".  It must be any integer between 0 and 255
- *   inclusive.
- * </dl>
- *
- * <h3>Example</h3>
- *
- * Input:
- *
- * <pre><code>
- *     {"capabilities": {"acceptInsecureCerts": true}}
- * </code></pre>
- *
- * @param {string=} sessionId
- *     Normally a unique ID is given to a new session, however this can
- *     be overriden by providing this field.
- * @param {Object.<string, *>=} capabilities
- *     JSON Object containing any of the recognised capabilities listed
- *     above.
- *
- * @return {Object}
- *     Session ID and capabilities offered by the WebDriver service.
- *
- * @throws {SessionNotCreatedError}
- *     If, for whatever reason, a session could not be created.
- */
-GeckoDriver.prototype.newSession = async function(cmd, resp) {
-  if (this.sessionID) {
-    throw new SessionNotCreatedError("Maximum number of active sessions");
-  }
-  this.sessionID = element.generateUUID();
-  this.newSessionCommandId = cmd.id;
-
-  try {
-    this.capabilities = session.Capabilities.fromJSON(cmd.parameters);
-
-    if (!this.secureTLS) {
-      logger.warn("TLS certificate errors will be ignored for this session");
-      let acceptAllCerts = new cert.InsecureSweepingOverride();
-      cert.installOverride(acceptAllCerts);
-    }
-
-    if (this.proxy.init()) {
-      logger.info("Proxy settings initialised: " + JSON.stringify(this.proxy));
-    }
-  } catch (e) {
-    throw new SessionNotCreatedError(e);
-  }
-
-  // If we are testing accessibility with marionette, start a11y service in
-  // chrome first. This will ensure that we do not have any content-only
-  // services hanging around.
-  if (this.a11yChecks && accessibility.service) {
-    logger.info("Preemptively starting accessibility service in Chrome");
-  }
-
-  let registerBrowsers = this.registerPromise();
-  let browserListening = this.listeningPromise();
-
-  let waitForWindow = function() {
-    let win = Services.wm.getMostRecentWindow("navigator:browser");
-    if (!win) {
-      // if the window isn't even created, just poll wait for it
-      let checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-      checkTimer.initWithCallback(waitForWindow.bind(this), 100,
-          Ci.nsITimer.TYPE_ONE_SHOT);
-    } else if (win.document.readyState != "complete") {
-      // otherwise, wait for it to be fully loaded before proceeding
-      let listener = ev => {
-        // ensure that we proceed, on the top level document load event
-        // (not an iframe one...)
-        if (ev.target != win.document) {
-          return;
-        }
-        win.removeEventListener("load", listener);
-        waitForWindow.call(this);
-      };
-      win.addEventListener("load", listener, true);
-    } else {
-      let clickToStart = Preferences.get(CLICK_TO_START_PREF);
-      if (clickToStart) {
-        Services.prompt.alert(win, "", "Click to start execution of marionette tests");
-      }
-      this.startBrowser(win, true);
-    }
-  };
-
-  if (!Preferences.get(CONTENT_LISTENER_PREF)) {
-    waitForWindow.call(this);
-  } else if (this.appName != "Firefox" && this.curBrowser === null) {
-    // if there is a content listener, then we just wake it up
-    let win = this.getCurrentWindow();
-    this.addBrowser(win);
-    this.whenBrowserStarted(win, false);
-    this.mm.broadcastAsyncMessage("Marionette:restart", {});
-  } else {
-    throw new WebDriverError("Session already running");
-  }
-  this.switchToGlobalMessageManager();
-
-  await registerBrowsers;
-  await browserListening;
-
-  if (this.curBrowser.tab) {
-    this.curBrowser.contentBrowser.focus();
-  }
-
-  // Setup global listener for modal dialogs, and check if there is already
-  // one open for the currently selected browser window.
-  modal.addHandler(this.dialogHandler);
-  this.dialog = modal.findModalDialogs(this.curBrowser);
-
-  return {
-    sessionId: this.sessionID,
-    capabilities: this.capabilities,
-  };
-};
-
-/**
- * Send the current session's capabilities to the client.
- *
- * Capabilities informs the client of which WebDriver features are
- * supported by Firefox and Marionette.  They are immutable for the
- * length of the session.
- *
- * The return value is an immutable map of string keys
- * ("capabilities") to values, which may be of types boolean,
- * numerical or string.
- */
-GeckoDriver.prototype.getSessionCapabilities = function(cmd, resp) {
-  resp.body.capabilities = this.capabilities;
-};
-
-/**
- * Sets the context of the subsequent commands to be either "chrome" or
- * "content".
- *
- * @param {string} value
- *     Name of the context to be switched to.  Must be one of "chrome" or
- *     "content".
- */
-GeckoDriver.prototype.setContext = function(cmd, resp) {
-  let val = cmd.parameters.value;
-  let ctx = Context.fromString(val);
-  if (ctx === null) {
-    throw new WebDriverError(`Invalid context: ${val}`);
-  }
-  this.context = ctx;
-};
-
-/** Gets the context of the server, either "chrome" or "content". */
-GeckoDriver.prototype.getContext = function(cmd, resp) {
-  resp.body.value = this.context.toString();
-};
-
-/**
- * Executes a JavaScript function in the context of the current browsing
- * context, if in content space, or in chrome space otherwise, and returns
- * the return value of the function.
- *
- * It is important to note that if the <var>sandboxName</var> parameter
- * is left undefined, the script will be evaluated in a mutable sandbox,
- * causing any change it makes on the global state of the document to have
- * lasting side-effects.
- *
- * @param {string} script
- *     Script to evaluate as a function body.
- * @param {Array.<(string|boolean|number|object|WebElement)>} args
- *     Arguments exposed to the script in <code>arguments</code>.
- *     The array items must be serialisable to the WebDriver protocol.
- * @param {number} scriptTimeout
- *     Duration in milliseconds of when to interrupt and abort the
- *     script evaluation.
- * @param {string=} sandbox
- *     Name of the sandbox to evaluate the script in.  The sandbox is
- *     cached for later re-use on the same Window object if
- *     <var>newSandbox</var> is false.  If he parameter is undefined,
- *     the script is evaluated in a mutable sandbox.  If the parameter
- *     is "system", it will be evaluted in a sandbox with elevated system
- *     privileges, equivalent to chrome space.
- * @param {boolean=} newSandbox
- *     Forces the script to be evaluated in a fresh sandbox.  Note that if
- *     it is undefined, the script will normally be evaluted in a fresh
- *     sandbox.
- * @param {string=} filename
- *     Filename of the client's program where this script is evaluated.
- * @param {number=} line
- *     Line in the client's program where this script is evaluated.
- * @param {boolean=} debug_script
- *     Attach an <code>onerror</code> event handler on the {@link Window}
- *     object.  It does not differentiate content errors from chrome errors.
- * @param {boolean=} directInject
- *     Evaluate the script without wrapping it in a function.
- *
- * @return {(string|boolean|number|object|WebElement)}
- *     Return value from the script, or null which signifies either the
- *     JavaScript notion of null or undefined.
- *
- * @throws {ScriptTimeoutError}
- *     If the script was interrupted due to reaching the
- *     <var>scriptTimeout</var> or default timeout.
- * @throws {JavaScriptError}
- *     If an {@link Error} was thrown whilst evaluating the script.
- */
-GeckoDriver.prototype.executeScript = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-
-  let {script, args, scriptTimeout} = cmd.parameters;
-  scriptTimeout = scriptTimeout || this.timeouts.script;
-
-  let opts = {
-    sandboxName: cmd.parameters.sandbox,
-    newSandbox: !!(typeof cmd.parameters.newSandbox == "undefined") ||
-        cmd.parameters.newSandbox,
-    file: cmd.parameters.filename,
-    line: cmd.parameters.line,
-    debug: cmd.parameters.debug_script,
-  };
-
-  resp.body.value = await this.execute_(script, args, scriptTimeout, opts);
-};
-
-/**
- * Executes a JavaScript function in the context of the current browsing
- * context, if in content space, or in chrome space otherwise, and returns
- * the object passed to the callback.
- *
- * The callback is always the last argument to the <var>arguments</var>
- * list passed to the function scope of the script.  It can be retrieved
- * as such:
- *
- * <pre><code>
- *     let callback = arguments[arguments.length - 1];
- *     callback("foo");
- *     // "foo" is returned
- * </code></pre>
- *
- * It is important to note that if the <var>sandboxName</var> parameter
- * is left undefined, the script will be evaluated in a mutable sandbox,
- * causing any change it makes on the global state of the document to have
- * lasting side-effects.
- *
- * @param {string} script
- *     Script to evaluate as a function body.
- * @param {Array.<(string|boolean|number|object|WebElement)>} args
- *     Arguments exposed to the script in <code>arguments</code>.
- *     The array items must be serialisable to the WebDriver protocol.
- * @param {number} scriptTimeout
- *     Duration in milliseconds of when to interrupt and abort the
- *     script evaluation.
- * @param {string=} sandbox
- *     Name of the sandbox to evaluate the script in.  The sandbox is
- *     cached for later re-use on the same Window object if
- *     <var>newSandbox</var> is false.  If the parameter is undefined,
- *     the script is evaluated in a mutable sandbox.  If the parameter
- *     is "system", it will be evaluted in a sandbox with elevated system
- *     privileges, equivalent to chrome space.
- * @param {boolean=} newSandbox
- *     Forces the script to be evaluated in a fresh sandbox.  Note that if
- *     it is undefined, the script will normally be evaluted in a fresh
- *     sandbox.
- * @param {string=} filename
- *     Filename of the client's program where this script is evaluated.
- * @param {number=} line
- *     Line in the client's program where this script is evaluated.
- * @param {boolean=} debug_script
- *     Attach an <code>onerror</code> event handler on the {@link Window}
- *     object.  It does not differentiate content errors from chrome errors.
- * @param {boolean=} directInject
- *     Evaluate the script without wrapping it in a function.
- *
- * @return {(string|boolean|number|object|WebElement)}
- *     Return value from the script, or null which signifies either the
- *     JavaScript notion of null or undefined.
- *
- * @throws {ScriptTimeoutError}
- *     If the script was interrupted due to reaching the
- *     <var>scriptTimeout</var> or default timeout.
- * @throws {JavaScriptError}
- *     If an Error was thrown whilst evaluating the script.
- */
-GeckoDriver.prototype.executeAsyncScript = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-
-  let {script, args, scriptTimeout} = cmd.parameters;
-  scriptTimeout = scriptTimeout || this.timeouts.script;
-
-  let opts = {
-    sandboxName: cmd.parameters.sandbox,
-    newSandbox: !!(typeof cmd.parameters.newSandbox == "undefined") ||
-        cmd.parameters.newSandbox,
-    file: cmd.parameters.filename,
-    line: cmd.parameters.line,
-    debug: cmd.parameters.debug_script,
-    async: true,
-  };
-
-  resp.body.value = await this.execute_(script, args, scriptTimeout, opts);
-};
-
-GeckoDriver.prototype.execute_ = async function(
-    script, args, timeout, opts = {}) {
-  let res, els;
-
-  switch (this.context) {
-    case Context.CONTENT:
-      // evaluate in content with lasting side-effects
-      if (!opts.sandboxName) {
-        res = await this.listener.execute(script, args, timeout, opts);
-
-      // evaluate in content with sandbox
-      } else {
-        res = await this.listener.executeInSandbox(
-            script, args, timeout, opts);
-      }
-
-      break;
-
-    case Context.CHROME:
-      let sb = this.sandboxes.get(opts.sandboxName, opts.newSandbox);
-      opts.timeout = timeout;
-      let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window);
-      res = await evaluate.sandbox(sb, script, wargs, opts);
-      els = this.curBrowser.seenEls;
-      break;
-
-    default:
-      throw new TypeError(`Unknown context: ${this.context}`);
-  }
-
-  return evaluate.toJSON(res, els);
-};
-
-/**
- * Navigate to given URL.
- *
- * Navigates the current browsing context to the given URL and waits for
- * the document to load or the session's page timeout duration to elapse
- * before returning.
- *
- * The command will return with a failure if there is an error loading
- * the document or the URL is blocked.  This can occur if it fails to
- * reach host, the URL is malformed, or if there is a certificate issue
- * to name some examples.
- *
- * The document is considered successfully loaded when the
- * DOMContentLoaded event on the frame element associated with the
- * current window triggers and document.readyState is "complete".
- *
- * In chrome context it will change the current window's location to
- * the supplied URL and wait until document.readyState equals "complete"
- * or the page timeout duration has elapsed.
- *
- * @param {string} url
- *     URL to navigate to.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.get = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let url = cmd.parameters.url;
-
-  let get = this.listener.get({url, pageTimeout: this.timeouts.pageLoad});
-
-  // If a reload of the frame script interrupts our page load, this will
-  // never return. We need to re-issue this request to correctly poll for
-  // readyState and send errors.
-  this.curBrowser.pendingCommands.push(() => {
-    let parameters = {
-      // TODO(ato): Bug 1242595
-      commandID: this.listener.activeMessageId,
-      pageTimeout: this.timeouts.pageLoad,
-      startTime: new Date().getTime(),
-    };
-    this.mm.broadcastAsyncMessage(
-        "Marionette:waitForPageLoaded" + this.curBrowser.curFrameId,
-        parameters);
-  });
-
-  await get;
-
-  this.curBrowser.contentBrowser.focus();
-};
-
-/**
- * Get a string representing the current URL.
- *
- * On Desktop this returns a string representation of the URL of the
- * current top level browsing context.  This is equivalent to
- * document.location.href.
- *
- * When in the context of the chrome, this returns the canonical URL
- * of the current resource.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getCurrentUrl = function(cmd) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  return this.currentURL.toString();
-};
-
-/**
- * Gets the current title of the window.
- *
- * @return {string}
- *     Document title of the top-level browsing context.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getTitle = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  return this.title;
-};
-
-/** Gets the current type of the window. */
-GeckoDriver.prototype.getWindowType = function(cmd, resp) {
-  let win = assert.window(this.getCurrentWindow());
-
-  resp.body.value = win.document.documentElement.getAttribute("windowtype");
-};
-
-/**
- * Gets the page source of the content document.
- *
- * @return {string}
- *     String serialisation of the DOM of the current browsing context's
- *     active document.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getPageSource = async function(cmd, resp) {
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  switch (this.context) {
-    case Context.CHROME:
-      let s = new win.XMLSerializer();
-      resp.body.value = s.serializeToString(win.document);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.getPageSource();
-      break;
-  }
-};
-
-/**
- * Cause the browser to traverse one step backward in the joint history
- * of the current browsing context.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.goBack = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.contentBrowser(this.curBrowser);
-  assert.noUserPrompt(this.dialog);
-
-  // If there is no history, just return
-  if (!this.curBrowser.contentBrowser.webNavigation.canGoBack) {
-    return;
-  }
-
-  let lastURL = this.currentURL;
-  let goBack = this.listener.goBack({pageTimeout: this.timeouts.pageLoad});
-
-  // If a reload of the frame script interrupts our page load, this will
-  // never return. We need to re-issue this request to correctly poll for
-  // readyState and send errors.
-  this.curBrowser.pendingCommands.push(() => {
-    let parameters = {
-      // TODO(ato): Bug 1242595
-      commandID: this.listener.activeMessageId,
-      lastSeenURL: lastURL.toString(),
-      pageTimeout: this.timeouts.pageLoad,
-      startTime: new Date().getTime(),
-    };
-    this.mm.broadcastAsyncMessage(
-        "Marionette:waitForPageLoaded" + this.curBrowser.curFrameId,
-        parameters);
-  });
-
-  await goBack;
-};
-
-/**
- * Cause the browser to traverse one step forward in the joint history
- * of the current browsing context.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.goForward = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.contentBrowser(this.curBrowser);
-  assert.noUserPrompt(this.dialog);
-
-  // If there is no history, just return
-  if (!this.curBrowser.contentBrowser.webNavigation.canGoForward) {
-    return;
-  }
-
-  let lastURL = this.currentURL;
-  let goForward = this.listener.goForward(
-      {pageTimeout: this.timeouts.pageLoad});
-
-  // If a reload of the frame script interrupts our page load, this will
-  // never return. We need to re-issue this request to correctly poll for
-  // readyState and send errors.
-  this.curBrowser.pendingCommands.push(() => {
-    let parameters = {
-      // TODO(ato): Bug 1242595
-      commandID: this.listener.activeMessageId,
-      lastSeenURL: lastURL.toString(),
-      pageTimeout: this.timeouts.pageLoad,
-      startTime: new Date().getTime(),
-    };
-    this.mm.broadcastAsyncMessage(
-        "Marionette:waitForPageLoaded" + this.curBrowser.curFrameId,
-        parameters);
-  });
-
-  await goForward;
-};
-
-/**
- * Causes the browser to reload the page in current top-level browsing
- * context.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.refresh = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let refresh = this.listener.refresh(
-      {pageTimeout: this.timeouts.pageLoad});
-
-  // If a reload of the frame script interrupts our page load, this will
-  // never return. We need to re-issue this request to correctly poll for
-  // readyState and send errors.
-  this.curBrowser.pendingCommands.push(() => {
-    let parameters = {
-      // TODO(ato): Bug 1242595
-      commandID: this.listener.activeMessageId,
-      pageTimeout: this.timeouts.pageLoad,
-      startTime: new Date().getTime(),
-    };
-    this.mm.broadcastAsyncMessage(
-        "Marionette:waitForPageLoaded" + this.curBrowser.curFrameId,
-        parameters);
-  });
-
-  await refresh;
-};
-
-/**
- * Forces an update for the given browser's id.
- */
-GeckoDriver.prototype.updateIdForBrowser = function(browser, newId) {
-  this._browserIds.set(browser.permanentKey, newId);
-};
-
-/**
- * Retrieves a listener id for the given xul browser element. In case
- * the browser is not known, an attempt is made to retrieve the id from
- * a CPOW, and null is returned if this fails.
- */
-GeckoDriver.prototype.getIdForBrowser = function(browser) {
-  if (browser === null) {
-    return null;
-  }
-  let permKey = browser.permanentKey;
-  if (this._browserIds.has(permKey)) {
-    return this._browserIds.get(permKey);
-  }
-
-  let winId = browser.outerWindowID;
-  if (winId) {
-    this._browserIds.set(permKey, winId);
-    return winId;
-  }
-  return null;
-},
-
-/**
- * Get the current window's handle. On desktop this typically corresponds
- * to the currently selected tab.
- *
- * Return an opaque server-assigned identifier to this window that
- * uniquely identifies it within this Marionette instance.  This can
- * be used to switch to this window at a later point.
- *
- * @return {string}
- *     Unique window handle.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- */
-GeckoDriver.prototype.getWindowHandle = function(cmd, resp) {
-  assert.contentBrowser(this.curBrowser);
-
-  return this.curBrowser.curFrameId.toString();
-};
-
-/**
- * Get a list of top-level browsing contexts. On desktop this typically
- * corresponds to the set of open tabs for browser windows, or the window
- * itself for non-browser chrome windows.
- *
- * Each window handle is assigned by the server and is guaranteed unique,
- * however the return array does not have a specified ordering.
- *
- * @return {Array.<string>}
- *     Unique window handles.
- */
-GeckoDriver.prototype.getWindowHandles = function(cmd, resp) {
-  return this.windowHandles.map(String);
-};
-
-/**
- * Get the current window's handle.  This corresponds to a window that
- * may itself contain tabs.
- *
- * Return an opaque server-assigned identifier to this window that
- * uniquely identifies it within this Marionette instance.  This can
- * be used to switch to this window at a later point.
- *
- * @return {string}
- *     Unique window handle.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- */
-GeckoDriver.prototype.getChromeWindowHandle = function(cmd, resp) {
-  assert.window(this.getCurrentWindow(Context.CHROME));
-
-  for (let i in this.browsers) {
-    if (this.curBrowser == this.browsers[i]) {
-      resp.body.value = i;
-      return;
-    }
-  }
-};
-
-/**
- * Returns identifiers for each open chrome window for tests interested in
- * managing a set of chrome windows and tabs separately.
- *
- * @return {Array.<string>}
- *     Unique window handles.
- */
-GeckoDriver.prototype.getChromeWindowHandles = function(cmd, resp) {
-  return this.chromeWindowHandles.map(String);
-};
-
-/**
- * Get the current position and size of the browser window currently in focus.
- *
- * Will return the current browser window size in pixels. Refers to
- * window outerWidth and outerHeight values, which include scroll bars,
- * title bars, etc.
- *
- * @return {Object.<string, number>}
- *     Object with |x| and |y| coordinates, and |width| and |height|
- *     of browser window.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getWindowRect = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-  return this.curBrowser.rect;
-};
-
-/**
- * Set the window position and size of the browser on the operating
- * system window manager.
- *
- * The supplied |width| and |height| values refer to the window outerWidth
- * and outerHeight values, which include browser chrome and OS-level
- * window borders.
- *
- * @param {number} x
- *     X coordinate of the top/left of the window that it will be
- *     moved to.
- * @param {number} y
- *     Y coordinate of the top/left of the window that it will be
- *     moved to.
- * @param {number} width
- *     Width to resize the window to.
- * @param {number} height
- *     Height to resize the window to.
- *
- * @return {Object.<string, number>}
- *     Object with |x| and |y| coordinates and |width| and |height|
- *     dimensions.
- *
- * @throws {UnsupportedOperationError}
- *     Not applicable to application.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.setWindowRect = async function(cmd, resp) {
-  assert.firefox();
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {x, y, width, height} = cmd.parameters;
-  let origRect = this.curBrowser.rect;
-
-  // Synchronous resize to |width| and |height| dimensions.
-  async function resizeWindow(width, height) {
-    return new Promise(resolve => {
-      win.addEventListener("resize", whenIdle(win, resolve), {once: true});
-      win.resizeTo(width, height);
-    });
-  }
-
-  // Wait until window size has changed.  We can't wait for the
-  // user-requested window size as this may not be achievable on the
-  // current system.
-  const windowResizeChange = async () => {
-    return wait.until((resolve, reject) => {
-      let curRect = this.curBrowser.rect;
-      if (curRect.width != origRect.width &&
-          curRect.height != origRect.height) {
-        resolve();
-      } else {
-        reject();
-      }
-    });
-  };
-
-  // Wait for the window position to change.
-  async function windowPosition(x, y) {
-    return wait.until((resolve, reject) => {
-      if ((x == win.screenX && y == win.screenY) ||
-          (win.screenX != origRect.x || win.screenY != origRect.y)) {
-        resolve();
-      } else {
-        reject();
-      }
-    });
-  }
-
-  switch (WindowState.from(win.windowState)) {
-    case WindowState.Fullscreen:
-      await exitFullscreen(win);
-      break;
-
-    case WindowState.Minimized:
-      await restoreWindow(win, this.curBrowser.eventObserver);
-      break;
-  }
-
-  if (height != null && width != null) {
-    assert.positiveInteger(height);
-    assert.positiveInteger(width);
-
-    if (win.outerWidth != width || win.outerHeight != height) {
-      await resizeWindow(width, height);
-      await windowResizeChange();
-    }
-  }
-
-  if (x != null && y != null) {
-    assert.integer(x);
-    assert.integer(y);
-
-    win.moveTo(x, y);
-    await windowPosition(x, y);
-  }
-
-  return this.curBrowser.rect;
-};
-
-/**
- * Switch current top-level browsing context by name or server-assigned
- * ID.  Searches for windows by name, then ID.  Content windows take
- * precedence.
- *
- * @param {string} name
- *     Target name or ID of the window to switch to.
- * @param {boolean=} focus
- *      A boolean value which determines whether to focus
- *      the window. Defaults to true.
- */
-GeckoDriver.prototype.switchToWindow = async function(cmd, resp) {
-  let focus = true;
-  if (typeof cmd.parameters.focus != "undefined") {
-    focus = cmd.parameters.focus;
-  }
-
-  // Window IDs are internally handled as numbers, but here it could
-  // also be the name of the window.
-  let switchTo = parseInt(cmd.parameters.name);
-  if (isNaN(switchTo)) {
-    switchTo = cmd.parameters.name;
-  }
-
-  let byNameOrId = function(win, windowId) {
-    return switchTo === win.name || switchTo === windowId;
-  };
-
-  let found = this.findWindow(this.windows, byNameOrId);
-
-  if (found) {
-    await this.setWindowHandle(found, focus);
-  } else {
-    throw new NoSuchWindowError(`Unable to locate window: ${switchTo}`);
-  }
-};
-
-/**
- * Find a specific window according to some filter function.
- *
- * @param {Iterable.<Window>} winIterable
- *     Iterable that emits Windows.
- * @param {function(Window, number): boolean} filter
- *     A callback function taking two arguments; the window and
- *     the outerId of the window, and returning a boolean indicating
- *     whether the window is the target.
- *
- * @return {Object}
- *     A window handle object containing the window and some
- *     associated metadata.
- */
-GeckoDriver.prototype.findWindow = function(winIterable, filter) {
-  for (let win of winIterable) {
-    let outerId = getOuterWindowId(win);
-    let tabBrowser = browser.getTabBrowser(win);
-
-    // In case the wanted window is a chrome window, we are done.
-    if (filter(win, outerId)) {
-      return {win, outerId, hasTabBrowser: !!tabBrowser};
-
-    // Otherwise check if the chrome window has a tab browser, and that it
-    // contains a tab with the wanted window handle.
-    } else if (tabBrowser && tabBrowser.tabs) {
-      for (let i = 0; i < tabBrowser.tabs.length; ++i) {
-        let contentBrowser = browser.getBrowserForTab(tabBrowser.tabs[i]);
-        let contentWindowId = this.getIdForBrowser(contentBrowser);
-
-        if (filter(win, contentWindowId)) {
-          return {
-            win,
-            outerId,
-            hasTabBrowser: true,
-            tabIndex: i,
-          };
-        }
-      }
-    }
-  }
-
-  return null;
-};
-
-/**
- * Switch the marionette window to a given window. If the browser in
- * the window is unregistered, registers that browser and waits for
- * the registration is complete. If |focus| is true then set the focus
- * on the window.
- *
- * @param {Object} winProperties
- *     Object containing window properties such as returned from
- *     GeckoDriver#findWindow
- * @param {boolean=} focus
- *     A boolean value which determines whether to focus the window.
- *     Defaults to true.
- */
-GeckoDriver.prototype.setWindowHandle = async function(
-    winProperties, focus = true) {
-  if (!(winProperties.outerId in this.browsers)) {
-    // Initialise Marionette if the current chrome window has not been seen
-    // before. Also register the initial tab, if one exists.
-    let registerBrowsers, browserListening;
-
-    if (winProperties.hasTabBrowser) {
-      registerBrowsers = this.registerPromise();
-      browserListening = this.listeningPromise();
-    }
-
-    this.startBrowser(winProperties.win, false /* isNewSession */);
-
-    if (registerBrowsers && browserListening) {
-      await registerBrowsers;
-      await browserListening;
-    }
-
-  } else {
-    // Otherwise switch to the known chrome window, and activate the tab
-    // if it's a content browser.
-    this.curBrowser = this.browsers[winProperties.outerId];
-
-    if ("tabIndex" in winProperties) {
-      this.curBrowser.switchToTab(
-          winProperties.tabIndex, winProperties.win, focus);
-    }
-  }
-};
-
-GeckoDriver.prototype.getActiveFrame = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-
-  switch (this.context) {
-    case Context.CHROME:
-      // no frame means top-level
-      resp.body.value = null;
-      if (this.curFrame) {
-        let elRef = this.curBrowser.seenEls
-            .add(this.curFrame.frameElement);
-        let el = element.makeWebElement(elRef);
-        resp.body.value = el;
-      }
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = null;
-      if (this.currentFrameElement !== null) {
-        let el = element.makeWebElement(this.currentFrameElement);
-        resp.body.value = el;
-      }
-      break;
-  }
-};
-
-/**
- * Set the current browsing context for future commands to the parent
- * of the current browsing context.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.switchToParentFrame = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  await this.listener.switchToParentFrame();
-};
-
-/**
- * Switch to a given frame within the current window.
- *
- * @param {Object} element
- *     A web element reference to the element to switch to.
- * @param {(string|number)} id
- *     If element is not defined, then this holds either the id, name,
- *     or index of the frame to switch to.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.switchToFrame = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {id, element, focus} = cmd.parameters;
-
-  const otherErrorsExpr = /about:.+(error)|(blocked)\?/;
-  const checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-
-  let curWindow = this.getCurrentWindow();
-
-  let checkLoad = function() {
-    let win = this.getCurrentWindow();
-    if (win.document.readyState == "complete") {
-      return;
-    } else if (win.document.readyState == "interactive") {
-      let documentURI = win.document.documentURI;
-      if (documentURI.startsWith("about:certerror")) {
-        throw new InsecureCertificateError();
-      } else if (otherErrorsExpr.exec(documentURI)) {
-        throw new UnknownError("Reached error page: " + documentURI);
-      }
-    }
-
-    checkTimer.initWithCallback(
-        checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-  };
-
-  if (this.context == Context.CHROME) {
-    let foundFrame = null;
-
-    // just focus
-    if (typeof id == "undefined" && typeof element == "undefined") {
-      this.curFrame = null;
-      if (focus) {
-        this.mainFrame.focus();
-      }
-      checkTimer.initWithCallback(
-          checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-      return;
-    }
-
-    // by element
-    if (this.curBrowser.seenEls.has(element)) {
-      // HTMLIFrameElement
-      let wantedFrame = this.curBrowser.seenEls.get(element);
-      // Deal with an embedded xul:browser case
-      if (wantedFrame.tagName == "xul:browser" ||
-          wantedFrame.tagName == "browser") {
-        curWindow = wantedFrame.contentWindow;
-        this.curFrame = curWindow;
-        if (focus) {
-          this.curFrame.focus();
-        }
-        checkTimer.initWithCallback(
-            checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-        return;
-      }
-
-      // Check if the frame is XBL anonymous
-      let parent = curWindow.document.getBindingParent(wantedFrame);
-      // Shadow nodes also show up in getAnonymousNodes, we should
-      // ignore them.
-      if (parent &&
-          !(parent.shadowRoot && parent.shadowRoot.contains(wantedFrame))) {
-        const doc = curWindow.document;
-        let anonNodes = [...doc.getAnonymousNodes(parent) || []];
-        if (anonNodes.length > 0) {
-          let el = wantedFrame;
-          while (el) {
-            if (anonNodes.indexOf(el) > -1) {
-              curWindow = wantedFrame.contentWindow;
-              this.curFrame = curWindow;
-              if (focus) {
-                this.curFrame.focus();
-              }
-              checkTimer.initWithCallback(
-                  checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-              return;
-            }
-            el = el.parentNode;
-          }
-        }
-      }
-
-      // else, assume iframe
-      let frames = curWindow.document.getElementsByTagName("iframe");
-      let numFrames = frames.length;
-      for (let i = 0; i < numFrames; i++) {
-        let wrappedEl = new XPCNativeWrapper(frames[i]);
-        let wrappedWanted = new XPCNativeWrapper(wantedFrame);
-        if (wrappedEl == wrappedWanted) {
-          curWindow = frames[i].contentWindow;
-          this.curFrame = curWindow;
-          if (focus) {
-            this.curFrame.focus();
-          }
-          checkTimer.initWithCallback(
-              checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-          return;
-        }
-      }
-    }
-
-    switch (typeof id) {
-      case "string" :
-        let foundById = null;
-        let frames = curWindow.document.getElementsByTagName("iframe");
-        let numFrames = frames.length;
-        for (let i = 0; i < numFrames; i++) {
-          // give precedence to name
-          let frame = frames[i];
-          if (frame.getAttribute("name") == id) {
-            foundFrame = i;
-            curWindow = frame.contentWindow;
-            break;
-          } else if (foundById === null && frame.id == id) {
-            foundById = i;
-          }
-        }
-        if (foundFrame === null && foundById !== null) {
-          foundFrame = foundById;
-          curWindow = frames[foundById].contentWindow;
-        }
-        break;
-      case "number":
-        if (typeof curWindow.frames[id] != "undefined") {
-          foundFrame = id;
-          let frameEl = curWindow.frames[foundFrame].frameElement;
-          curWindow = frameEl.contentWindow;
-        }
-        break;
-    }
-
-    if (foundFrame !== null) {
-      this.curFrame = curWindow;
-      if (focus) {
-        this.curFrame.focus();
-      }
-      checkTimer.initWithCallback(
-          checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
-    } else {
-      throw new NoSuchFrameError(`Unable to locate frame: ${id}`);
-    }
-
-  } else if (this.context == Context.CONTENT) {
-    if (!id && !element &&
-        this.curBrowser.frameManager.currentRemoteFrame !== null) {
-      // We're currently using a ChromeMessageSender for a remote frame,
-      // so this request indicates we need to switch back to the top-level
-      // (parent) frame.  We'll first switch to the parent's (global)
-      // ChromeMessageBroadcaster, so we send the message to the right
-      // listener.
-      this.switchToGlobalMessageManager();
-    }
-    cmd.commandID = cmd.id;
-
-    let res = await this.listener.switchToFrame(cmd.parameters);
-    if (res) {
-      let {win: winId, frame: frameId} = res;
-      this.mm = this.curBrowser.frameManager.getFrameMM(winId, frameId);
-
-      let registerBrowsers = this.registerPromise();
-      let browserListening = this.listeningPromise();
-
-      this.oopFrameId =
-          this.curBrowser.frameManager.switchToFrame(winId, frameId);
-
-      await registerBrowsers;
-      await browserListening;
-    }
-  }
-};
-
-GeckoDriver.prototype.getTimeouts = function(cmd, resp) {
-  return this.timeouts;
-};
-
-/**
- * Set timeout for page loading, searching, and scripts.
- *
- * @param {Object.<string, number>}
- *     Dictionary of timeout types and their new value, where all timeout
- *     types are optional.
- *
- * @throws {InvalidArgumentError}
- *     If timeout type key is unknown, or the value provided with it is
- *     not an integer.
- */
-GeckoDriver.prototype.setTimeouts = function(cmd, resp) {
-  // merge with existing timeouts
-  let merged = Object.assign(this.timeouts.toJSON(), cmd.parameters);
-  this.timeouts = session.Timeouts.fromJSON(merged);
-};
-
-/** Single tap. */
-GeckoDriver.prototype.singleTap = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-
-  let {id, x, y} = cmd.parameters;
-
-  switch (this.context) {
-    case Context.CHROME:
-      throw new UnsupportedOperationError(
-          "Command 'singleTap' is not yet available in chrome context");
-
-    case Context.CONTENT:
-      this.addFrameCloseListener("tap");
-      await this.listener.singleTap(id, x, y);
-      break;
-  }
-};
-
-/**
- * Perform a series of grouped actions at the specified points in time.
- *
- * @param {Array.<?>} actions
- *     Array of objects that each represent an action sequence.
- *
- * @throws {UnsupportedOperationError}
- *     Not yet available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.performActions = async function(cmd, resp) {
-  assert.content(this.context,
-      "Command 'performActions' is not yet available in chrome context");
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let actions = cmd.parameters.actions;
-  await this.listener.performActions({"actions": actions});
-};
-
-/**
- * Release all the keys and pointer buttons that are currently depressed.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.releaseActions = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  await this.listener.releaseActions();
-};
-
-/**
- * An action chain.
- *
- * @param {Object} value
- *     A nested array where the inner array represents each event,
- *     and the outer array represents a collection of events.
- *
- * @return {number}
- *     Last touch ID.
- *
- * @throws {UnsupportedOperationError}
- *     Not applicable to application.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.actionChain = async function(cmd, resp) {
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {chain, nextId} = cmd.parameters;
-
-  switch (this.context) {
-    case Context.CHROME:
-      // be conservative until this has a use case and is established
-      // to work as expected in Fennec
-      assert.firefox();
-
-      resp.body.value = await this.legacyactions.dispatchActions(
-          chain, nextId, {frame: win}, this.curBrowser.seenEls);
-      break;
-
-    case Context.CONTENT:
-      this.addFrameCloseListener("action chain");
-      resp.body.value = await this.listener.actionChain(chain, nextId);
-      break;
-  }
-};
-
-/**
- * A multi-action chain.
- *
- * @param {Object} value
- *     A nested array where the inner array represents eache vent,
- *     the middle array represents a collection of events for each
- *     finger, and the outer array represents all fingers.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.multiAction = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {value, max_length} = cmd.parameters;  // eslint-disable-line camelcase
-
-  this.addFrameCloseListener("multi action chain");
-  await this.listener.multiAction(value, max_length);
-};
-
-/**
- * Find an element using the indicated search strategy.
- *
- * @param {string} using
- *     Indicates which search method to use.
- * @param {string} value
- *     Value the client is looking for.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.findElement = async function(cmd, resp) {
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let strategy = cmd.parameters.using;
-  let expr = cmd.parameters.value;
-  let opts = {
-    startNode: cmd.parameters.element,
-    timeout: this.timeouts.implicit,
-    all: false,
-  };
-
-  switch (this.context) {
-    case Context.CHROME:
-      if (!SUPPORTED_STRATEGIES.has(strategy)) {
-        throw new InvalidSelectorError(`Strategy not supported: ${strategy}`);
-      }
-
-      let container = {frame: win};
-      if (opts.startNode) {
-        opts.startNode = this.curBrowser.seenEls.get(opts.startNode);
-      }
-      let el = await element.find(container, strategy, expr, opts);
-      let elRef = this.curBrowser.seenEls.add(el);
-      let webEl = element.makeWebElement(elRef);
-
-      resp.body.value = webEl;
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.findElementContent(
-          strategy,
-          expr,
-          opts);
-      break;
-  }
-};
-
-/**
- * Find elements using the indicated search strategy.
- *
- * @param {string} using
- *     Indicates which search method to use.
- * @param {string} value
- *     Value the client is looking for.
- */
-GeckoDriver.prototype.findElements = async function(cmd, resp) {
-  let win = assert.window(this.getCurrentWindow());
-
-  let strategy = cmd.parameters.using;
-  let expr = cmd.parameters.value;
-  let opts = {
-    startNode: cmd.parameters.element,
-    timeout: this.timeouts.implicit,
-    all: true,
-  };
-
-  switch (this.context) {
-    case Context.CHROME:
-      if (!SUPPORTED_STRATEGIES.has(strategy)) {
-        throw new InvalidSelectorError(`Strategy not supported: ${strategy}`);
-      }
-
-      let container = {frame: win};
-      if (opts.startNode) {
-        opts.startNode = this.curBrowser.seenEls.get(opts.startNode);
-      }
-      let els = await element.find(container, strategy, expr, opts);
-
-      let elRefs = this.curBrowser.seenEls.addAll(els);
-      let webEls = elRefs.map(element.makeWebElement);
-      resp.body = webEls;
-      break;
-
-    case Context.CONTENT:
-      resp.body = await this.listener.findElementsContent(
-          cmd.parameters.using,
-          cmd.parameters.value,
-          opts);
-      break;
-  }
-};
-
-/**
- * Return the active element on the page.
- *
- * @return {WebElement}
- *     Active element of the current browsing context's document element.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getActiveElement = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  resp.body.value = await this.listener.getActiveElement();
-};
-
-/**
- * Send click event to element.
- *
- * @param {string} id
- *     Reference ID to the element that will be clicked.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.clickElement = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      await interaction.clickElement(el, this.a11yChecks);
-      break;
-
-    case Context.CONTENT:
-      // We need to protect against the click causing an OOP frame
-      // to close.  This fires the mozbrowserclose event when it closes
-      // so we need to listen for it and then just send an error back.
-      // The person making the call should be aware something is not right
-      // and handle accordingly.
-      this.addFrameCloseListener("click");
-
-      let click = this.listener.clickElement(
-          {id, pageTimeout: this.timeouts.pageLoad});
-
-      // If a reload of the frame script interrupts our page load, this will
-      // never return. We need to re-issue this request to correctly poll for
-      // readyState and send errors.
-      this.curBrowser.pendingCommands.push(() => {
-        let parameters = {
-          // TODO(ato): Bug 1242595
-          commandID: this.listener.activeMessageId,
-          pageTimeout: this.timeouts.pageLoad,
-          startTime: new Date().getTime(),
-        };
-        this.mm.broadcastAsyncMessage(
-            "Marionette:waitForPageLoaded" + this.curBrowser.curFrameId,
-            parameters);
-      });
-
-      await click;
-      break;
-  }
-};
-
-/**
- * Get a given attribute of an element.
- *
- * @param {string} id
- *     Web element reference ID to the element that will be inspected.
- * @param {string} name
- *     Name of the attribute which value to retrieve.
- *
- * @return {string}
- *     Value of the attribute.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementAttribute = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {id, name} = cmd.parameters;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = el.getAttribute(name);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.getElementAttribute(id, name);
-      break;
-  }
-};
-
-/**
- * Returns the value of a property associated with given element.
- *
- * @param {string} id
- *     Web element reference ID to the element that will be inspected.
- * @param {string} name
- *     Name of the property which value to retrieve.
- *
- * @return {string}
- *     Value of the property.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementProperty = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {id, name} = cmd.parameters;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = el[name];
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.getElementProperty(id, name);
-      break;
-  }
-};
-
-/**
- * Get the text of an element, if any.  Includes the text of all child
- * elements.
- *
- * @param {string} id
- *     Reference ID to the element that will be inspected.
- *
- * @return {string}
- *     Element's text "as rendered".
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementText = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      // for chrome, we look at text nodes, and any node with a "label" field
-      let el = this.curBrowser.seenEls.get(id);
-      let lines = [];
-      this.getVisibleText(el, lines);
-      resp.body.value = lines.join("\n");
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.getElementText(id);
-      break;
-  }
-};
-
-/**
- * Get the tag name of the element.
- *
- * @param {string} id
- *     Reference ID to the element that will be inspected.
- *
- * @return {string}
- *     Local tag name of element.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementTagName = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = el.tagName.toLowerCase();
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.getElementTagName(id);
-      break;
-  }
-};
-
-/**
- * Check if element is displayed.
- *
- * @param {string} id
- *     Reference ID to the element that will be inspected.
- *
- * @return {boolean}
- *     True if displayed, false otherwise.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.isElementDisplayed = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = await interaction.isElementDisplayed(
-          el, this.a11yChecks);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.isElementDisplayed(id);
-      break;
-  }
-};
-
-/**
- * Return the property of the computed style of an element.
- *
- * @param {string} id
- *     Reference ID to the element that will be checked.
- * @param {string} propertyName
- *     CSS rule that is being requested.
- *
- * @return {string}
- *     Value of |propertyName|.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementValueOfCssProperty = async function(
-    cmd, resp) {
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {id, propertyName: prop} = cmd.parameters;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      let sty = win.document.defaultView.getComputedStyle(el);
-      resp.body.value = sty.getPropertyValue(prop);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener
-          .getElementValueOfCssProperty(id, prop);
-      break;
-  }
-};
-
-/**
- * Check if element is enabled.
- *
- * @param {string} id
- *     Reference ID to the element that will be checked.
- *
- * @return {boolean}
- *     True if enabled, false if disabled.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.isElementEnabled = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      // Selenium atom doesn't quite work here
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = await interaction.isElementEnabled(
-          el, this.a11yChecks);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.isElementEnabled(id);
-      break;
-  }
-};
-
-/**
- * Check if element is selected.
- *
- * @param {string} id
- *     Reference ID to the element that will be checked.
- *
- * @return {boolean}
- *     True if selected, false if unselected.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.isElementSelected = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      // Selenium atom doesn't quite work here
-      let el = this.curBrowser.seenEls.get(id);
-      resp.body.value = await interaction.isElementSelected(
-          el, this.a11yChecks);
-      break;
-
-    case Context.CONTENT:
-      resp.body.value = await this.listener.isElementSelected(id);
-      break;
-  }
-};
-
-/**
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getElementRect = async function(cmd, resp) {
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      let rect = el.getBoundingClientRect();
-      resp.body = {
-        x: rect.x + win.pageXOffset,
-        y: rect.y + win.pageYOffset,
-        width: rect.width,
-        height: rect.height,
-      };
-      break;
-
-    case Context.CONTENT:
-      resp.body = await this.listener.getElementRect(id);
-      break;
-  }
-};
-
-/**
- * Send key presses to element after focusing on it.
- *
- * @param {string} id
- *     Reference ID to the element that will be checked.
- * @param {string} value
- *     Value to send to the element.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.sendKeysToElement = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {id, text} = cmd.parameters;
-  assert.string(text);
-
-  switch (this.context) {
-    case Context.CHROME:
-      let el = this.curBrowser.seenEls.get(id);
-      await interaction.sendKeysToElement(
-          el, text, true, this.a11yChecks);
-      break;
-
-    case Context.CONTENT:
-      await this.listener.sendKeysToElement(id, text);
-      break;
-  }
-};
-
-/**
- * Clear the text of an element.
- *
- * @param {string} id
- *     Reference ID to the element that will be cleared.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.clearElement = async function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let id = cmd.parameters.id;
-
-  switch (this.context) {
-    case Context.CHROME:
-      // the selenium atom doesn't work here
-      let el = this.curBrowser.seenEls.get(id);
-      if (el.nodeName == "textbox") {
-        el.value = "";
-      } else if (el.nodeName == "checkbox") {
-        el.checked = false;
-      }
-      break;
-
-    case Context.CONTENT:
-      await this.listener.clearElement(id);
-      break;
-  }
-};
-
-/**
- * Switch to shadow root of the given host element.
- *
- * @param {string} id element id.
- */
-GeckoDriver.prototype.switchToShadowRoot = async function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-
-  let id = cmd.parameters.id;
-  await this.listener.switchToShadowRoot(id);
-};
-
-/**
- * Add a single cookie to the cookie store associated with the active
- * document's address.
- *
- * @param {Map.<string, (string|number|boolean)> cookie
- *     Cookie object.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- * @throws {InvalidCookieDomainError}
- *     If <var>cookie</var> is for a different domain than the active
- *     document's host.
- */
-GeckoDriver.prototype.addCookie = function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {protocol, hostname} = this.currentURL;
-
-  const networkSchemes = ["ftp:", "http:", "https:"];
-  if (!networkSchemes.includes(protocol)) {
-    throw new InvalidCookieDomainError("Document is cookie-averse");
-  }
-
-  let newCookie = cookie.fromJSON(cmd.parameters.cookie);
-  if (typeof newCookie.domain == "undefined") {
-    newCookie.domain = hostname;
-  }
-
-  cookie.add(newCookie, {restrictToHost: hostname});
-};
-
-/**
- * Get all the cookies for the current domain.
- *
- * This is the equivalent of calling <code>document.cookie</code> and
- * parsing the result.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.getCookies = function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {hostname, pathname} = this.currentURL;
-  resp.body = [...cookie.iter(hostname, pathname)];
-};
-
-/**
- * Delete all cookies that are visible to a document.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.deleteAllCookies = function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {hostname, pathname} = this.currentURL;
-  for (let toDelete of cookie.iter(hostname, pathname)) {
-    cookie.remove(toDelete);
-  }
-};
-
-/**
- * Delete a cookie by name.
- *
- * @throws {UnsupportedOperationError}
- *     Not available in current context.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.deleteCookie = function(cmd, resp) {
-  assert.content(this.context);
-  assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  let {hostname, pathname} = this.currentURL;
-  let candidateName = assert.string(cmd.parameters.name);
-  for (let toDelete of cookie.iter(hostname, pathname)) {
-    if (toDelete.name === candidateName) {
-      return cookie.remove(toDelete);
-    }
-  }
-
-  throw UnknownError("Unable to find cookie");
-};
-
-/**
- * Close the currently selected tab/window.
- *
- * With multiple open tabs present the currently selected tab will
- * be closed.  Otherwise the window itself will be closed. If it is the
- * last window currently open, the window will not be closed to prevent
- * a shutdown of the application. Instead the returned list of window
- * handles is empty.
- *
- * @return {Array.<string>}
- *     Unique window handles of remaining windows.
- *
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.close = async function(cmd, resp) {
-  assert.contentBrowser(this.curBrowser);
-  assert.noUserPrompt(this.dialog);
-
-  let nwins = 0;
-
-  for (let win of this.windows) {
-    // For browser windows count the tabs. Otherwise take the window itself.
-    let tabbrowser = browser.getTabBrowser(win);
-    if (tabbrowser && tabbrowser.tabs) {
-      nwins += tabbrowser.tabs.length;
-    } else {
-      nwins += 1;
-    }
-  }
-
-  // If there is only one window left, do not close it. Instead return
-  // a faked empty array of window handles.  This will instruct geckodriver
-  // to terminate the application.
-  if (nwins === 1) {
-    return [];
-  }
-
-  if (this.mm != globalMessageManager) {
-    this.mm.removeDelayedFrameScript(FRAME_SCRIPT);
-  }
-
-  await this.curBrowser.closeTab();
-  return this.windowHandles.map(String);
-};
-
-/**
- * Close the currently selected chrome window.
- *
- * If it is the last window currently open, the chrome window will not be
- * closed to prevent a shutdown of the application. Instead the returned
- * list of chrome window handles is empty.
- *
- * @return {Array.<string>}
- *     Unique chrome window handles of remaining chrome windows.
- */
-GeckoDriver.prototype.closeChromeWindow = async function(cmd, resp) {
-  assert.firefox();
-  assert.window(this.getCurrentWindow(Context.CHROME));
-
-  let nwins = 0;
-
-  // eslint-disable-next-line
-  for (let _ of this.windows) {
-    nwins++;
-  }
-
-  // If there is only one window left, do not close it.  Instead return
-  // a faked empty array of window handles. This will instruct geckodriver
-  // to terminate the application.
-  if (nwins == 1) {
-    return [];
-  }
-
-  // reset frame to the top-most frame
-  this.curFrame = null;
-
-  if (this.mm != globalMessageManager) {
-    this.mm.removeDelayedFrameScript(FRAME_SCRIPT);
-  }
-
-  await this.curBrowser.closeWindow();
-  return this.chromeWindowHandles.map(String);
-};
-
-/** Delete Marionette session. */
-GeckoDriver.prototype.deleteSession = function(cmd, resp) {
-  if (this.curBrowser !== null) {
-    // frame scripts can be safely reused
-    Preferences.set(CONTENT_LISTENER_PREF, false);
-
-    // delete session in each frame in each browser
-    for (let win in this.browsers) {
-      let browser = this.browsers[win];
-      for (let i in browser.knownFrames) {
-        globalMessageManager.broadcastAsyncMessage(
-            "Marionette:deleteSession" + browser.knownFrames[i], {});
-      }
-    }
-
-    for (let win of this.windows) {
-      if (win.messageManager) {
-        win.messageManager.removeDelayedFrameScript(FRAME_SCRIPT);
-      } else {
-        logger.error(
-            `Could not remove listener from page ${win.location.href}`);
-      }
-    }
-
-    this.curBrowser.frameManager.removeMessageManagerListeners(
-        globalMessageManager);
-  }
-
-  this.switchToGlobalMessageManager();
-
-  // reset frame to the top-most frame
-  this.curFrame = null;
-  if (this.mainFrame) {
-    try {
-      this.mainFrame.focus();
-    } catch (e) {
-      this.mainFrame = null;
-    }
-  }
-
-  if (this.observing !== null) {
-    for (let topic in this.observing) {
-      Services.obs.removeObserver(this.observing[topic], topic);
-    }
-    this.observing = null;
-  }
-
-  modal.removeHandler(this.dialogHandler);
-
-  this.sandboxes.clear();
-  cert.uninstallOverride();
-
-  this.sessionID = null;
-  this.capabilities = new session.Capabilities();
-};
-
-/**
- * Takes a screenshot of a web element, current frame, or viewport.
- *
- * The screen capture is returned as a lossless PNG image encoded as
- * a base 64 string.
- *
- * If called in the content context, the |id| argument is not null and
- * refers to a present and visible web element's ID, the capture area will
- * be limited to the bounding box of that element.  Otherwise, the capture
- * area will be the bounding box of the current frame.
- *
- * If called in the chrome context, the screenshot will always represent
- * the entire viewport.
- *
- * @param {string=} id
- *     Optional web element reference to take a screenshot of.
- *     If undefined, a screenshot will be taken of the document element.
- * @param {Array.<string>=} highlights
- *     List of web elements to highlight.
- * @param {boolean} full
- *     True to take a screenshot of the entire document element. Is not
- *     considered if <var>id</var> is not defined. Defaults to true.
- * @param {boolean=} hash
- *     True if the user requests a hash of the image data.
- * @param {boolean=} scroll
- *     Scroll to element if |id| is provided.  If undefined, it will
- *     scroll to the element.
- *
- * @return {string}
- *     If <var>hash</var> is false, PNG image encoded as Base64 encoded
- *     string.  If <var>hash</var> is true, hex digest of the SHA-256
- *     hash of the Base64 encoded string.
- */
-GeckoDriver.prototype.takeScreenshot = function(cmd, resp) {
-  let win = assert.window(this.getCurrentWindow());
-
-  let {id, highlights, full, hash} = cmd.parameters;
-  highlights = highlights || [];
-  let format = hash ? capture.Format.Hash : capture.Format.Base64;
-
-  switch (this.context) {
-    case Context.CHROME:
-      let highlightEls = highlights.map(
-          ref => this.curBrowser.seenEls.get(ref));
-
-      // viewport
-      let canvas;
-      if (!id && !full) {
-        canvas = capture.viewport(win, highlightEls);
-
-      // element or full document element
-      } else {
-        let node;
-        if (id) {
-          node = this.curBrowser.seenEls.get(id);
-        } else {
-          node = win.document.documentElement;
-        }
-
-        canvas = capture.element(node, highlightEls);
-      }
-
-      switch (format) {
-        case capture.Format.Hash:
-          return capture.toHash(canvas);
-
-        case capture.Format.Base64:
-          return capture.toBase64(canvas);
-      }
-      break;
-
-    case Context.CONTENT:
-      return this.listener.takeScreenshot(format, cmd.parameters);
-  }
-
-  throw new TypeError(`Unknown context: ${this.context}`);
-};
-
-/**
- * Get the current browser orientation.
- *
- * Will return one of the valid primary orientation values
- * portrait-primary, landscape-primary, portrait-secondary, or
- * landscape-secondary.
- */
-GeckoDriver.prototype.getScreenOrientation = function(cmd, resp) {
-  assert.fennec();
-  let win = assert.window(this.getCurrentWindow());
-
-  resp.body.value = win.screen.mozOrientation;
-};
-
-/**
- * Set the current browser orientation.
- *
- * The supplied orientation should be given as one of the valid
- * orientation values.  If the orientation is unknown, an error will
- * be raised.
- *
- * Valid orientations are "portrait" and "landscape", which fall
- * back to "portrait-primary" and "landscape-primary" respectively,
- * and "portrait-secondary" as well as "landscape-secondary".
- */
-GeckoDriver.prototype.setScreenOrientation = function(cmd, resp) {
-  assert.fennec();
-  let win = assert.window(this.getCurrentWindow());
-
-  const ors = [
-    "portrait", "landscape",
-    "portrait-primary", "landscape-primary",
-    "portrait-secondary", "landscape-secondary",
-  ];
-
-  let or = String(cmd.parameters.orientation);
-  assert.string(or);
-  let mozOr = or.toLowerCase();
-  if (!ors.includes(mozOr)) {
-    throw new InvalidArgumentError(`Unknown screen orientation: ${or}`);
-  }
-
-  if (!win.screen.mozLockOrientation(mozOr)) {
-    throw new WebDriverError(`Unable to set screen orientation: ${or}`);
-  }
-};
-
-/**
- * Synchronously minimizes the user agent window as if the user pressed
- * the minimize button.
- *
- * No action is taken if the window is already minimized.
- *
- * Not supported on Fennec.
- *
- * @return {Object.<string, number>}
- *     Window rect and window state.
- *
- * @throws {UnsupportedOperationError}
- *     Not available for current application.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.minimizeWindow = async function(cmd, resp) {
-  assert.firefox();
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  if (WindowState.from(win.windowState) == WindowState.Fullscreen) {
-    await exitFullscreen(win);
-  }
-
-  if (WindowState.from(win.windowState) != WindowState.Minimized) {
-    await new Promise(resolve => {
-      this.curBrowser.eventObserver.addEventListener("visibilitychange", resolve, {once: true});
-      win.minimize();
-    });
-  }
-
-  return this.curBrowser.rect;
-};
-
-/**
- * Synchronously maximizes the user agent window as if the user pressed
- * the maximize button.
- *
- * No action is taken if the window is already maximized.
- *
- * Not supported on Fennec.
- *
- * @return {Object.<string, number>}
- *     Window rect.
- *
- * @throws {UnsupportedOperationError}
- *     Not available for current application.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.maximizeWindow = async function(cmd, resp) {
-  assert.firefox();
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  switch (WindowState.from(win.windowState)) {
-    case WindowState.Fullscreen:
-      await exitFullscreen(win);
-      break;
-
-    case WindowState.Minimized:
-      await restoreWindow(win, this.curBrowser.eventObserver);
-      break;
-  }
-
-  const origSize = {
-    outerWidth: win.outerWidth,
-    outerHeight: win.outerHeight,
-  };
-
-  // Wait for the window size to change.
-  async function windowSizeChange(from) {
-    return wait.until((resolve, reject) => {
-      let curSize = {
-        outerWidth: win.outerWidth,
-        outerHeight: win.outerHeight,
-      };
-      if (curSize.outerWidth != origSize.outerWidth ||
-          curSize.outerHeight != origSize.outerHeight) {
-        resolve();
-      } else {
-        reject();
-      }
-    });
-  }
-
-  if (WindowState.from(win.windowState) != win.Maximized) {
-    await new TimedPromise(resolve => {
-      win.addEventListener("sizemodechange", resolve, {once: true});
-      win.maximize();
-    }, {throws: null});
-
-    // Transitioning into a window state is asynchronous on Linux,
-    // and we cannot rely on sizemodechange to accurately tell us when
-    // the transition has completed.
-    //
-    // To counter for this we wait for the window size to change, which
-    // it usually will.  On platforms where the transition is synchronous,
-    // the wait will have the cost of one iteration because the size
-    // will have changed as part of the transition.  Where the platform is
-    // asynchronous, the cost may be greater as we have to poll
-    // continuously until we see a change, but it ensures conformity in
-    // behaviour.
-    //
-    // Certain window managers, however, do not have a concept of
-    // maximised windows and here sizemodechange may never fire.  Indeed,
-    // if the window covers the maximum available screen real estate,
-    // the window size may also not change.  In this circumstance,
-    // which admittedly is a somewhat bizarre edge case, we assume that
-    // the timeout of waiting for sizemodechange to fire is sufficient
-    // to give the window enough time to transition itself into whatever
-    // form or shape the WM is programmed to give it.
-    await windowSizeChange();
-  }
-
-  return this.curBrowser.rect;
-};
-
-/**
- * Synchronously sets the user agent window to full screen as if the user
- * had done "View > Enter Full Screen".
- *
- * No action is taken if the window is already in full screen mode.
- *
- * Not supported on Fennec.
- *
- * @return {Map.<string, number>}
- *     Window rect.
- *
- * @throws {UnsupportedOperationError}
- *     Not available for current application.
- * @throws {NoSuchWindowError}
- *     Top-level browsing context has been discarded.
- * @throws {UnexpectedAlertOpenError}
- *     A modal dialog is open, blocking this operation.
- */
-GeckoDriver.prototype.fullscreenWindow = async function(cmd, resp) {
-  assert.firefox();
-  const win = assert.window(this.getCurrentWindow());
-  assert.noUserPrompt(this.dialog);
-
-  if (WindowState.from(win.windowState) == WindowState.Minimized) {
-    await restoreWindow(win, this.curBrowser.eventObserver);
-  }
-
-  if (WindowState.from(win.windowState) != WindowState.Fullscreen) {
-    await new Promise(resolve => {
-      win.addEventListener("sizemodechange", resolve, {once: true});
-      win.fullScreen = true;
-    });
-  }
-
-  return this.curBrowser.rect;
-};
-
-/**
- * Dismisses a currently displayed tab modal, or returns no such alert if
- * no modal is displayed.
- */
-GeckoDriver.prototype.dismissDialog = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  this._checkIfAlertIsPresent();
-
-  let {button0, button1} = this.dialog.ui;
-  (button1 ? button1 : button0).click();
-  this.dialog = null;
-};
-
-/**
- * Accepts a currently displayed tab modal, or returns no such alert if
- * no modal is displayed.
- */
-GeckoDriver.prototype.acceptDialog = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  this._checkIfAlertIsPresent();
-
-  let {button0} = this.dialog.ui;
-  button0.click();
-  this.dialog = null;
-};
-
-/**
- * Returns the message shown in a currently displayed modal, or returns
- * a no such alert error if no modal is currently displayed.
- */
-GeckoDriver.prototype.getTextFromDialog = function(cmd, resp) {
-  assert.window(this.getCurrentWindow());
-  this._checkIfAlertIsPresent();
-
-  let {infoBody} = this.dialog.ui;
-  resp.body.value = infoBody.textContent;
-};
-
-/**
- * Set the user prompt's value field.
- *
- * Sends keys to the input field of a currently displayed modal, or
- * returns a no such alert error if no modal is currently displayed. If
- * a tab modal is currently displayed but has no means for text input,
- * an element not visible error is returned.
- *
- * @param {string} text
- *     Input to the user prompt's value field.
- *
- * @throws {ElementNotInteractableError}
- *     If the current user prompt is an alert or confirm.
- * @throws {NoSuchAlertError}
- *     If there is no current user prompt.
- * @throws {UnsupportedOperationError}
- *     If the current user prompt is something other than an alert,
- *     confirm, or a prompt.
- */
-GeckoDriver.prototype.sendKeysToDialog = function(cmd, resp) {
-  let win = assert.window(this.getCurrentWindow());
-  this._checkIfAlertIsPresent();
-
-  // see toolkit/components/prompts/content/commonDialog.js
-  let {loginContainer, loginTextbox} = this.dialog.ui;
-  if (loginContainer.hidden) {
-    throw new ElementNotInteractableError(
-        "This prompt does not accept text input");
-  }
-
-  event.sendKeysToElement(
-      cmd.parameters.text,
-      loginTextbox,
-      {ignoreVisibility: true},
-      this.dialog.window ? this.dialog.window : win);
-};
-
-GeckoDriver.prototype._checkIfAlertIsPresent = function() {
-  if (!this.dialog || !this.dialog.ui) {
-    throw new NoAlertOpenError("No modal dialog is currently open");
-  }
-};
-
-/**
- * Enables or disables accepting new socket connections.
- *
- * By calling this method with `false` the server will not accept any
- * further connections, but existing connections will not be forcible
- * closed. Use `true` to re-enable accepting connections.
- *
- * Please note that when closing the connection via the client you can
- * end-up in a non-recoverable state if it hasn't been enabled before.
- *
- * This method is used for custom in application shutdowns via
- * marionette.quit() or marionette.restart(), like File -> Quit.
- *
- * @param {boolean} state
- *     True if the server should accept new socket connections.
- */
-GeckoDriver.prototype.acceptConnections = function(cmd, resp) {
-  assert.boolean(cmd.parameters.value);
-  this._server.acceptConnections = cmd.parameters.value;
-};
-
-/**
- * Quits the application with the provided flags.
- *
- * Marionette will stop accepting new connections before ending the
- * current session, and finally attempting to quit the application.
- *
- * Optional {@link nsIAppStartup} flags may be provided as
- * an array of masks, and these will be combined by ORing
- * them with a bitmask.  The available masks are defined in
- * https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAppStartup.
- *
- * Crucially, only one of the *Quit flags can be specified. The |eRestart|
- * flag may be bit-wise combined with one of the *Quit flags to cause
- * the application to restart after it quits.
- *
- * @param {Array.<string>=} flags
- *     Constant name of masks to pass to |Services.startup.quit|.
- *     If empty or undefined, |nsIAppStartup.eAttemptQuit| is used.
- *
- * @return {string}
- *     Explaining the reason why the application quit.  This can be
- *     in response to a normal shutdown or restart, yielding "shutdown"
- *     or "restart", respectively.
- *
- * @throws {InvalidArgumentError}
- *     If <var>flags</var> contains unknown or incompatible flags,
- *     for example multiple Quit flags.
- */
-GeckoDriver.prototype.quit = async function(cmd, resp) {
-  const quits = ["eConsiderQuit", "eAttemptQuit", "eForceQuit"];
-
-  let flags = [];
-  if (typeof cmd.parameters.flags != "undefined") {
-    flags = assert.array(cmd.parameters.flags);
-  }
-
-  // bug 1298921
-  assert.firefox();
-
-  let quitSeen;
-  let mode = 0;
-  if (flags.length > 0) {
-    for (let k of flags) {
-      assert.in(k, Ci.nsIAppStartup);
-
-      if (quits.includes(k)) {
-        if (quitSeen) {
-          throw new InvalidArgumentError(
-              `${k} cannot be combined with ${quitSeen}`);
-        }
-        quitSeen = k;
-      }
-
-      mode |= Ci.nsIAppStartup[k];
-    }
-  } else {
-    mode = Ci.nsIAppStartup.eAttemptQuit;
-  }
-
-  this._server.acceptConnections = false;
-  this.deleteSession();
-
-  // delay response until the application is about to quit
-  let quitApplication = new Promise(resolve => {
-    Services.obs.addObserver(
-        (subject, topic, data) => resolve(data),
-        "quit-application");
-  });
-
-  Services.startup.quit(mode);
-
-  resp.body.cause = await quitApplication;
-  resp.send();
-};
-
-GeckoDriver.prototype.installAddon = function(cmd, resp) {
-  assert.firefox();
-
-  let path = cmd.parameters.path;
-  let temp = cmd.parameters.temporary || false;
-  if (typeof path == "undefined" || typeof path != "string" ||
-      typeof temp != "boolean") {
-    throw InvalidArgumentError();
-  }
-
-  return addon.install(path, temp);
-};
-
-GeckoDriver.prototype.uninstallAddon = function(cmd, resp) {
-  assert.firefox();
-
-  let id = cmd.parameters.id;
-  if (typeof id == "undefined" || typeof id != "string") {
-    throw new InvalidArgumentError();
-  }
-
-  return addon.uninstall(id);
-};
-
-/** Receives all messages from content messageManager. */
-/* eslint-disable consistent-return */
-GeckoDriver.prototype.receiveMessage = function(message) {
-  switch (message.name) {
-    case "Marionette:ok":
-    case "Marionette:done":
-    case "Marionette:error":
-      // check if we need to remove the mozbrowserclose listener
-      if (this.mozBrowserClose !== null) {
-        let win = this.getCurrentWindow();
-        win.removeEventListener("mozbrowserclose", this.mozBrowserClose, true);
-        this.mozBrowserClose = null;
-      }
-      break;
-
-    case "Marionette:log":
-      // log server-side messages
-      logger.info(message.json.message);
-      break;
-
-    case "Marionette:switchToModalOrigin":
-      this.curBrowser.frameManager.switchToModalOrigin(message);
-      this.mm = this.curBrowser.frameManager
-          .currentRemoteFrame.messageManager.get();
-      break;
-
-    case "Marionette:switchedToFrame":
-      if (message.json.restorePrevious) {
-        this.currentFrameElement = this.previousFrameElement;
-      } else {
-        // we don't arbitrarily save previousFrameElement, since
-        // we allow frame switching after modals appear, which would
-        // override this value and we'd lose our reference
-        if (message.json.storePrevious) {
-          this.previousFrameElement = this.currentFrameElement;
-        }
-        this.currentFrameElement = message.json.frameValue;
-      }
-      break;
-
-    case "Marionette:emitTouchEvent":
-      globalMessageManager.broadcastAsyncMessage(
-          "MarionetteMainListener:emitTouchEvent", message.json);
-      break;
-
-    case "Marionette:register":
-      let wid = message.json.value;
-      let be = message.target;
-      let rv = this.registerBrowser(wid, be);
-      return rv;
-
-    case "Marionette:listenersAttached":
-      if (message.json.listenerId === this.curBrowser.curFrameId) {
-        // If the frame script gets reloaded we need to call newSession.
-        // In the case of desktop this just sets up a small amount of state
-        // that doesn't change over the course of a session.
-        this.sendAsync("newSession", this.capabilities.toJSON());
-        this.curBrowser.flushPendingCommands();
-      }
-      break;
-  }
-};
-/* eslint-enable consistent-return */
-
-GeckoDriver.prototype.responseCompleted = function() {
-  if (this.curBrowser !== null) {
-    this.curBrowser.pendingCommands = [];
-  }
-};
-
-/**
- * Retrieve the localized string for the specified entity id.
- *
- * Example:
- *     localizeEntity(["chrome://global/locale/about.dtd"], "about.version")
- *
- * @param {Array.<string>} urls
- *     Array of .dtd URLs.
- * @param {string} id
- *     The ID of the entity to retrieve the localized string for.
- *
- * @return {string}
- *     The localized string for the requested entity.
- */
-GeckoDriver.prototype.localizeEntity = function(cmd, resp) {
-  let {urls, id} = cmd.parameters;
-
-  if (!Array.isArray(urls)) {
-    throw new InvalidArgumentError("Value of `urls` should be of type 'Array'");
-  }
-  if (typeof id != "string") {
-    throw new InvalidArgumentError("Value of `id` should be of type 'string'");
-  }
-
-  resp.body.value = l10n.localizeEntity(urls, id);
-};
-
-/**
- * Retrieve the localized string for the specified property id.
- *
- * Example:
- *
- *     localizeProperty(
- *         ["chrome://global/locale/findbar.properties"], "FastFind");
- *
- * @param {Array.<string>} urls
- *     Array of .properties URLs.
- * @param {string} id
- *     The ID of the property to retrieve the localized string for.
- *
- * @return {string}
- *     The localized string for the requested property.
- */
-GeckoDriver.prototype.localizeProperty = function(cmd, resp) {
-  let {urls, id} = cmd.parameters;
-
-  if (!Array.isArray(urls)) {
-    throw new InvalidArgumentError("Value of `urls` should be of type 'Array'");
-  }
-  if (typeof id != "string") {
-    throw new InvalidArgumentError("Value of `id` should be of type 'string'");
-  }
-
-  resp.body.value = l10n.localizeProperty(urls, id);
-};
-
-/**
- * Initialize the reftest mode
- */
-GeckoDriver.prototype.setupReftest = async function(cmd, resp) {
-  if (this._reftest) {
-    throw new UnsupportedOperationError(
-        "Called reftest:setup with a reftest session already active");
-  }
-
-  if (this.context !== Context.CHROME) {
-    throw new UnsupportedOperationError(
-        "Must set chrome context before running reftests");
-  }
-
-  let {urlCount = {}, screenshot = "unexpected"} = cmd.parameters;
-  if (!["always", "fail", "unexpected"].includes(screenshot)) {
-    throw new InvalidArgumentError(
-        "Value of `screenshot` should be 'always', 'fail' or 'unexpected'");
-  }
-
-  this._reftest = new reftest.Runner(this);
-  await this._reftest.setup(urlCount, screenshot);
-};
-
-
-/** Run a reftest. */
-GeckoDriver.prototype.runReftest = async function(cmd, resp) {
-  let {test, references, expected, timeout} = cmd.parameters;
-
-  if (!this._reftest) {
-    throw new UnsupportedOperationError(
-        "Called reftest:run before reftest:start");
-  }
-
-  assert.string(test);
-  assert.string(expected);
-  assert.array(references);
-
-  resp.body.value = await this._reftest.run(
-      test, references, expected, timeout);
-};
-
-/**
- * End a reftest run.
- *
- * Closes the reftest window (without changing the current window handle),
- * and removes cached canvases.
- */
-GeckoDriver.prototype.teardownReftest = function(cmd, resp) {
-  if (!this._reftest) {
-    throw new UnsupportedOperationError(
-        "Called reftest:teardown before reftest:start");
-  }
-
-  this._reftest.abort();
-  this._reftest = null;
-};
-
-
-GeckoDriver.prototype.commands = {
-  // Marionette service
-  "Marionette:SetContext": GeckoDriver.prototype.setContext,
-  "setContext": GeckoDriver.prototype.setContext,  // deprecated, remove in Firefox 60
-  "Marionette:GetContext": GeckoDriver.prototype.getContext,
-  "getContext": GeckoDriver.prototype.getContext,
-  "Marionette:AcceptConnections": GeckoDriver.prototype.acceptConnections,
-  "acceptConnections": GeckoDriver.prototype.acceptConnections,  // deprecated, remove in Firefox 60
-  "Marionette:Quit": GeckoDriver.prototype.quit,
-  "quit": GeckoDriver.prototype.quit,  // deprecated, remove in Firefox 60
-  "quitApplication": GeckoDriver.prototype.quit,  // deprecated, remove in Firefox 60
-
-  // Addon service
-  "Addon:Install": GeckoDriver.prototype.installAddon,
-  "addon:install": GeckoDriver.prototype.installAddon,  // deprecated, remove in Firefox 60
-  "Addon:Uninstall": GeckoDriver.prototype.uninstallAddon,
-  "addon:uninstall": GeckoDriver.prototype.uninstallAddon,  // deprecated, remove in Firefox 60
-
-  // L10n service
-  "L10n:LocalizeEntity": GeckoDriver.prototype.localizeEntity,
-  "localization:l10n:localizeEntity": GeckoDriver.prototype.localizeEntity,  // deprecated, remove in Firefox 60
-  "L10n:LocalizeProperty": GeckoDriver.prototype.localizeProperty,
-  "localization:l10n:localizeProperty": GeckoDriver.prototype.localizeProperty,  // deprecated, remove in Firefox 60
-
-  // Reftest service
-  "reftest:setup": GeckoDriver.prototype.setupReftest,
-  "reftest:run": GeckoDriver.prototype.runReftest,
-  "reftest:teardown": GeckoDriver.prototype.teardownReftest,
-
-  // WebDriver service
-  "WebDriver:AcceptDialog": GeckoDriver.prototype.acceptDialog,
-  "WebDriver:AddCookie": GeckoDriver.prototype.addCookie,
-  "WebDriver:Back": GeckoDriver.prototype.goBack,
-  "WebDriver:CloseChromeWindow": GeckoDriver.prototype.closeChromeWindow,
-  "WebDriver:CloseWindow": GeckoDriver.prototype.close,
-  "WebDriver:DeleteAllCookies": GeckoDriver.prototype.deleteAllCookies,
-  "WebDriver:DeleteCookie": GeckoDriver.prototype.deleteCookie,
-  "WebDriver:DeleteSession": GeckoDriver.prototype.deleteSession,
-  "WebDriver:DismissAlert": GeckoDriver.prototype.dismissDialog,
-  "WebDriver:ElementClear": GeckoDriver.prototype.clearElement,
-  "WebDriver:ElementClick": GeckoDriver.prototype.clickElement,
-  "WebDriver:ElementSendKeys": GeckoDriver.prototype.sendKeysToElement,
-  "WebDriver:ExecuteAsyncScript": GeckoDriver.prototype.executeAsyncScript,
-  "WebDriver:ExecuteScript": GeckoDriver.prototype.executeScript,
-  "WebDriver:FindElement": GeckoDriver.prototype.findElement,
-  "WebDriver:FindElements": GeckoDriver.prototype.findElements,
-  "WebDriver:Forward": GeckoDriver.prototype.goForward,
-  "WebDriver:FullscreenWindow": GeckoDriver.prototype.fullscreenWindow,
-  "WebDriver:GetActiveElement": GeckoDriver.prototype.getActiveElement,
-  "WebDriver:GetActiveFrame": GeckoDriver.prototype.getActiveFrame,
-  "WebDriver:GetAlertText": GeckoDriver.prototype.getTextFromDialog,
-  "WebDriver:GetCapabilities": GeckoDriver.prototype.getSessionCapabilities,
-  "WebDriver:GetChromeWindowHandle": GeckoDriver.prototype.getChromeWindowHandle,
-  "WebDriver:GetChromeWindowHandles": GeckoDriver.prototype.getChromeWindowHandles,
-  "WebDriver:GetCookies": GeckoDriver.prototype.getCookies,
-  "WebDriver:GetCurrentChromeWindowHandle": GeckoDriver.prototype.getChromeWindowHandle,
-  "WebDriver:GetCurrentURL": GeckoDriver.prototype.getCurrentUrl,
-  "WebDriver:GetElementAttribute": GeckoDriver.prototype.getElementAttribute,
-  "WebDriver:GetElementCSSValue": GeckoDriver.prototype.getElementValueOfCssProperty,
-  "WebDriver:GetElementProperty": GeckoDriver.prototype.getElementProperty,
-  "WebDriver:GetElementRect": GeckoDriver.prototype.getElementRect,
-  "WebDriver:GetElementTagName": GeckoDriver.prototype.getElementTagName,
-  "WebDriver:GetElementText": GeckoDriver.prototype.getElementText,
-  "WebDriver:GetPageSource": GeckoDriver.prototype.getPageSource,
-  "WebDriver:GetScreenOrientation": GeckoDriver.prototype.getScreenOrientation,
-  "WebDriver:GetTimeouts": GeckoDriver.prototype.getTimeouts,
-  "WebDriver:GetTitle": GeckoDriver.prototype.getTitle,
-  "WebDriver:GetWindowHandle": GeckoDriver.prototype.getWindowHandle,
-  "WebDriver:GetWindowHandles": GeckoDriver.prototype.getWindowHandles,
-  "WebDriver:GetWindowRect": GeckoDriver.prototype.getWindowRect,
-  "WebDriver:GetWindowType": GeckoDriver.prototype.getWindowType,
-  "WebDriver:IsElementDisplayed": GeckoDriver.prototype.isElementDisplayed,
-  "WebDriver:IsElementEnabled": GeckoDriver.prototype.isElementEnabled,
-  "WebDriver:IsElementSelected": GeckoDriver.prototype.isElementSelected,
-  "WebDriver:MinimizeWindow": GeckoDriver.prototype.minimizeWindow,
-  "WebDriver:MaximizeWindow": GeckoDriver.prototype.maximizeWindow,
-  "WebDriver:Navigate": GeckoDriver.prototype.get,
-  "WebDriver:NewSession": GeckoDriver.prototype.newSession,
-  "WebDriver:PerformActions": GeckoDriver.prototype.performActions,
-  "WebDriver:Refresh":  GeckoDriver.prototype.refresh,
-  "WebDriver:ReleaseActions": GeckoDriver.prototype.releaseActions,
-  "WebDriver:SendAlertText": GeckoDriver.prototype.sendKeysToDialog,
-  "WebDriver:SetScreenOrientation": GeckoDriver.prototype.setScreenOrientation,
-  "WebDriver:SetTimeouts": GeckoDriver.prototype.setTimeouts,
-  "WebDriver:SetWindowRect": GeckoDriver.prototype.setWindowRect,
-  "WebDriver:SwitchToFrame": GeckoDriver.prototype.switchToFrame,
-  "WebDriver:SwitchToParentFrame": GeckoDriver.prototype.switchToParentFrame,
-  "WebDriver:SwitchToShadowRoot": GeckoDriver.prototype.switchToShadowRoot,
-  "WebDriver:SwitchToWindow": GeckoDriver.prototype.switchToWindow,
-  "WebDriver:TakeScreenshot": GeckoDriver.prototype.takeScreenshot,
-
-  // deprecated WebDriver commands, remove in Firefox 60
-  "acceptDialog": GeckoDriver.prototype.acceptDialog,
-  "actionChain": GeckoDriver.prototype.actionChain,
-  "addCookie": GeckoDriver.prototype.addCookie,
-  "clearElement": GeckoDriver.prototype.clearElement,
-  "clickElement": GeckoDriver.prototype.clickElement,
-  "closeChromeWindow": GeckoDriver.prototype.closeChromeWindow,
-  "close": GeckoDriver.prototype.close,
-  "deleteAllCookies": GeckoDriver.prototype.deleteAllCookies,
-  "deleteCookie": GeckoDriver.prototype.deleteCookie,
-  "deleteSession": GeckoDriver.prototype.deleteSession,
-  "dismissDialog": GeckoDriver.prototype.dismissDialog,
-  "executeAsyncScript": GeckoDriver.prototype.executeAsyncScript,
-  "executeScript": GeckoDriver.prototype.executeScript,
-  "findElement": GeckoDriver.prototype.findElement,
-  "findElements": GeckoDriver.prototype.findElements,
-  "fullscreen": GeckoDriver.prototype.fullscreenWindow,
-  "getActiveElement": GeckoDriver.prototype.getActiveElement,
-  "getActiveFrame": GeckoDriver.prototype.getActiveFrame,
-  "getChromeWindowHandle": GeckoDriver.prototype.getChromeWindowHandle,
-  "getChromeWindowHandles": GeckoDriver.prototype.getChromeWindowHandles,
-  "getCookies": GeckoDriver.prototype.getCookies,
-  "getCurrentChromeWindowHandle": GeckoDriver.prototype.getChromeWindowHandle,
-  "getCurrentUrl": GeckoDriver.prototype.getCurrentUrl,
-  "getElementAttribute": GeckoDriver.prototype.getElementAttribute,
-  "getElementProperty": GeckoDriver.prototype.getElementProperty,
-  "getElementRect": GeckoDriver.prototype.getElementRect,
-  "getElementTagName": GeckoDriver.prototype.getElementTagName,
-  "getElementText": GeckoDriver.prototype.getElementText,
-  "getElementValueOfCssProperty": GeckoDriver.prototype.getElementValueOfCssProperty,
-  "get": GeckoDriver.prototype.get,
-  "getPageSource": GeckoDriver.prototype.getPageSource,
-  "getScreenOrientation": GeckoDriver.prototype.getScreenOrientation,
-  "getSessionCapabilities": GeckoDriver.prototype.getSessionCapabilities,
-  "getTextFromDialog": GeckoDriver.prototype.getTextFromDialog,
-  "getTimeouts": GeckoDriver.prototype.getTimeouts,
-  "getTitle": GeckoDriver.prototype.getTitle,
-  "getWindowHandle": GeckoDriver.prototype.getWindowHandle,
-  "getWindowHandles": GeckoDriver.prototype.getWindowHandles,
-  "getWindowPosition": GeckoDriver.prototype.getWindowRect, // redirect for compatibility
-  "getWindowRect": GeckoDriver.prototype.getWindowRect,
-  "getWindowSize": GeckoDriver.prototype.getWindowRect, // redirect for compatibility
-  "getWindowType": GeckoDriver.prototype.getWindowType,
-  "goBack": GeckoDriver.prototype.goBack,
-  "goForward": GeckoDriver.prototype.goForward,
-  "isElementDisplayed": GeckoDriver.prototype.isElementDisplayed,
-  "isElementEnabled": GeckoDriver.prototype.isElementEnabled,
-  "isElementSelected": GeckoDriver.prototype.isElementSelected,
-  "maximizeWindow": GeckoDriver.prototype.maximizeWindow,
-  "multiAction": GeckoDriver.prototype.multiAction,
-  "newSession": GeckoDriver.prototype.newSession,
-  "performActions": GeckoDriver.prototype.performActions,
-  "refresh":  GeckoDriver.prototype.refresh,
-  "releaseActions": GeckoDriver.prototype.releaseActions,
-  "sendKeysToDialog": GeckoDriver.prototype.sendKeysToDialog,
-  "sendKeysToElement": GeckoDriver.prototype.sendKeysToElement,
-  "setScreenOrientation": GeckoDriver.prototype.setScreenOrientation,
-  "setTimeouts": GeckoDriver.prototype.setTimeouts,
-  "setWindowPosition": GeckoDriver.prototype.setWindowRect, // redirect for compatibility
-  "setWindowRect": GeckoDriver.prototype.setWindowRect,
-  "setWindowSize": GeckoDriver.prototype.setWindowRect, // redirect for compatibility
-  "singleTap": GeckoDriver.prototype.singleTap,
-  "switchToFrame": GeckoDriver.prototype.switchToFrame,
-  "switchToParentFrame": GeckoDriver.prototype.switchToParentFrame,
-  "switchToShadowRoot": GeckoDriver.prototype.switchToShadowRoot,
-  "switchToWindow": GeckoDriver.prototype.switchToWindow,
-  "takeScreenshot": GeckoDriver.prototype.takeScreenshot,
-};
-
-function copy(obj) {
-  if (Array.isArray(obj)) {
-    return obj.slice();
-  } else if (typeof obj == "object") {
-    return Object.assign({}, obj);
-  }
-  return obj;
-}
-
-function getOuterWindowId(win) {
-  return win.QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindowUtils)
-      .outerWindowID;
-}
-
-/**
- * Exit fullscreen and wait for <var>window</var> to resize.
- *
- * @param {ChromeWindow} window
- *     Window to exit fullscreen.
- */
-async function exitFullscreen(window) {
-  return new Promise(resolve => {
-    window.addEventListener("sizemodechange", whenIdle(window, resolve), {once: true});
-    window.fullScreen = false;
-  });
-}
-
-/**
- * Restore window and wait for the window state to change.
- *
- * @param {ChromeWindow} chromWindow
- *     Window to restore.
- * @param {WebElementEventTarget} contentWindow
- *     Content window to listen for events in.
- */
-async function restoreWindow(chromeWindow, contentWindow) {
-  return new Promise(resolve => {
-    contentWindow.addEventListener("visibilitychange", resolve, {once: true});
-    chromeWindow.restore();
-  });
-}
-
-/**
- * Throttle <var>callback</var> until the main thread is idle and
- * <var>window</var> has performed an animation frame.
- *
- * @param {ChromeWindow} window
- *     Window to request the animation frame from.
- * @param {function()} callback
- *     Called when done.
- *
- * @return {function()}
- *     Anonymous function that when invoked will wait for the main
- *     thread to clear up and request an animation frame before calling
- *     <var>callback</var>.
- */
-function whenIdle(window, callback) {
-  return () => Services.tm.idleDispatchToMainThread(() => {
-    window.requestAnimationFrame(callback);
-  });
-}
-
-
-
- - - - -
- - - -
- - - - - - - diff --git a/testing/marionette/doc/api/element.Store.html b/testing/marionette/doc/api/element.Store.html deleted file mode 100644 --- a/testing/marionette/doc/api/element.Store.html +++ /dev/null @@ -1,867 +0,0 @@ - - - - - JSDoc: Class: Store - - - - - - - - - - -
- -

Class: Store

- - - - - - -
- -
- -

- element.Store()

- -

Stores known/seen elements and their associated web element -references.

-

Elements are added by calling |add(el)| or |addAll(elements)|, and -may be queried by their web element reference using |get(element)|.

- - -
- -
-
- - - - -

Constructor

- - - -

new Store()

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -

Methods

- - - - - - - -

add(el) → {string}

- - - - - - -
-

Make an element seen.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
el - - -Element - - - -

Element to add to set of seen elements.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Web element reference associated with element.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - - - - -

addAll(els) → {Array.<WebElement>}

- - - - - - -
-

Make a collection of elements seen.

-

The oder of the returned web element references is guaranteed to -match that of the collection passed in.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
els - - -NodeList - - - -

Sequence of elements to add to set of seen elements.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

List of the web element references associated with each element - from |els|.

-
- - - -
-
- Type -
-
- -Array.<WebElement> - - -
-
- - - - - - - - - - - - - -

get(uuid) → {Element}

- - - - - - -
-

Retrieve a DOM element by its unique web element reference/UUID.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -string - - - -

Web element reference, or UUID.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    -
    -
    -

    If the web element reference uuid has not been - seen before.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -NoSuchElementError - - -
    -
    -
    -
    -
    - -
  • - -
  • - -
    -
    -
    -

    If the element has gone stale, indicating it is no longer - attached to the DOM, or its node document is no longer the - active document.

    -
    -
    -
    -
    -
    -
    - Type -
    -
    - -StaleElementReferenceError - - -
    -
    -
    -
    -
    - -
  • -
- - -
Returns:
- - -
-

Element associated with reference.

-
- - - -
-
- Type -
-
- -Element - - -
-
- - - - - - - - - - - - - -

has(uuid) → {boolean}

- - - - - - -
-

Determine if the provided web element reference has been seen -before/is in the element store.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
uuid - - -string - - - -

Element's associated web element reference.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

True if element is in the store, false otherwise.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - - -
- -
- - - - -
- - - -
- - - - - - - \ No newline at end of file diff --git a/testing/marionette/doc/api/element.html b/testing/marionette/doc/api/element.html deleted file mode 100644 --- a/testing/marionette/doc/api/element.html +++ /dev/null @@ -1,3476 +0,0 @@ - - - - - JSDoc: Namespace: element - - - - - - - - - - -
- -

Namespace: element

- - - - - - -
- -
- -

element

- - -
- -
-
- - -

This module provides shared functionality for dealing with DOM- -and web elements in Marionette.

-

A web element is an abstraction used to identify an element when it -is transported across the protocol, between remote- and local ends.

-

Each element has an associated web element reference (a UUID) that -uniquely identifies the the element across all browsing contexts. The -web element reference for every element representing the same element -is the same.

-

The element.Store provides a mapping between web element -references and DOM elements for each browsing context. It also provides -functionality for looking up and retrieving elements.

- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - -
- - - - - - -

Classes

- -
-
Store
-
-
- - - - - - - - - - - -

Methods

- - - - - - - -

(static) coordinates(node, xOffsetopt, yOffsetopt) → {Object.<string, number>}

- - - - - - -
-

This function generates a pair of coordinates relative to the viewport -given a target element and coordinates relative to that element's -top-left corner.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
node - - -Node - - - - - - - - - -

Target node.

xOffset - - -number - - - - - - <optional>
- - - - - -

Horizontal offset relative to target's top-left corner. - Defaults to the centre of the target's bounding box.

yOffset - - -number - - - - - - <optional>
- - - - - -

Vertical offset relative to target's top-left corner. Defaults to - the centre of the target's bounding box.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
- -

TypeError - If |xOffset| or |yOffset| are not numbers.

- -
- - - - - -
Returns:
- - -
-

X- and Y coordinates.

-
- - - -
-
- Type -
-
- -Object.<string, number> - - -
-
- - - - - - - - - - - - - -

(static) find(container, strategy, selector, opts) → {Promise.<(Element|Array.<Element>)>}

- - - - - - -
-

Find a single element or a collection of elements starting at the -document root or a given node.

-

If |timeout| is above 0, an implicit search technique is used. -This will wait for the duration of |timeout| for the element -to appear in the DOM.

-

See the |element.Strategy| enum for a full list of supported -search strategies that can be passed to |strategy|.

-

Available flags for opts:

-

-
all -
- If true, a multi-element search selector is used and a sequence - of elements will be returned. Otherwise a single element.

-

timeout -
- Duration to wait before timing out the search. If all - is false, a NoSuchElementError is thrown if unable to - find the element within the timeout duration.

-

startNode -
Element to use as the root of the search.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
container - - -Object.<string, WindowProxy> - - - -

Window object and an optional shadow root that contains the - root shadow DOM element.

strategy - - -string - - - -

Search strategy whereby to locate the element(s).

selector - - -string - - - -

Selector search pattern. The selector must be compatible with - the chosen search strategy.

opts - - -Object.<string, ?> - - - -

Options.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Throws:
-
    -
  • - -
    - -

    InvalidSelectorError - If strategy is unknown.

    - -
    - -
  • - -
  • - -
    - -

    InvalidSelectorError - If selector is malformed.

    - -
    - -
  • - -
  • - -
    - -

    NoSuchElementError - If a single element is requested, this error will throw if the - element is not found.

    - -
    - -
  • -
- - -
Returns:
- - -
-

Single element or a sequence of elements.

-
- - - -
-
- Type -
-
- -Promise.<(Element|Array.<Element>)> - - -
-
- - - - - - - - - - - - - -

(static) findByLinkText(node, s) → {Array.<DOMAnchorElement>}

- - - - - - -
-

Find all hyperlinks dscendant of |node| which link text is |s|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
node - - -DOMElement - - - -

Where in the DOM hierarchy to being searching.

s - - -string - - - -

Link text to search for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Sequence of link elements which text is |s|.

-
- - - -
-
- Type -
-
- -Array.<DOMAnchorElement> - - -
-
- - - - - - - - - - - - - -

(static) findByPartialLinkText(node, s) → {Array.<DOMAnchorElement>}

- - - - - - -
-

Find all hyperlinks descendant of |node| which link text contains |s|.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
node - - -DOMElement - - - -

Where in the DOM hierachy to begin searching.

s - - -string - - - -

Link text to search for.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Sequence of link elements which text containins |s|.

-
- - - -
-
- Type -
-
- -Array.<DOMAnchorElement> - - -
-
- - - - - - - - - - - - - -

(static) findByXPath(root, startNode, expr) → {DOMElement}

- - - - - - -
-

Find a single element by XPath expression.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
root - - -DOMElement - - - -

Document root

startNode - - -DOMElement - - - -

Where in the DOM hiearchy to begin searching.

expr - - -string - - - -

XPath search expression.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

First element matching expression.

-
- - - -
-
- Type -
-
- -DOMElement - - -
-
- - - - - - - - - - - - - -

(static) findByXPathAll(root, startNode, expr) → {Array.<DOMElement>}

- - - - - - -
-

Find elements by XPath expression.

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
root - - -DOMElement - - - -

Document root.

startNode - - -DOMElement - - - -

Where in the DOM hierarchy to begin searching.

expr - - -string - - - -

XPath search expression.

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
Returns:
- - -
-

Sequence of found elements matching expression.

-
- - - -
-
- Type -
-
- -Array.<DOMElement> - - -
-
- - - - - - - - - - - - - -

(static) getContainer(el) → {Element}

- - - - - - -
-

Gets the element's container element.

-

An element container is defined by the WebDriver -specification to be an