diff --git a/webdriver-spec.html b/webdriver-spec.html index 73d1c94aa..c0de17539 100644 --- a/webdriver-spec.html +++ b/webdriver-spec.html @@ -2423,6 +2423,14 @@

Sessions

or implicitly when Close Window is called at the last remaining top-level browsing context. +

An intermediary node will maintain an associated + session for each active session. This is + the session on the upstream neighbor that is created + when the intermediary node executes the New + Session command. Closing a session on + an intermediary node will also close the session of + the associated session. +

All commands, except New Session and Status, have an associated current session, which is the session in which that command will run. @@ -2496,15 +2504,34 @@

Sessions

a remote end must take the following steps:
    -
  1. Set the webdriver-active flag to false. +

  2. Perform the folowing substeps based on the remote end's + type: +

    +
    Remote end is an endpoint node +
    +
      +
    1. Set the webdriver-active flag to false. -

    2. Close any top-level browsing contexts - associated with the session, - without prompting to unload. +

    3. An endpoint node must close any top-level + browsing contexts associated with the session, + without prompting to unload. +

    +
    Remote end is an intermediary node +
    +
      +
    1. Close the associated session. If this causes + an error to occur, complete the remainder of this + algorithm before returning the error. +

    +
  3. Remove the current session from active sessions.

  4. Perform any implementation-specific cleanup steps. + +

  5. If an error has occurred in any of the steps above, + return the error, otherwise return success with + data null.

Closing a session might cause the associated browser process to be killed. @@ -2565,12 +2592,21 @@

New Session

The remote end steps are:

    -
  1. If the remote end is an intermediary node, - take implementation-defined steps that either result in - returning an error with error code session not created, - or in returning a success with data - that is isomorphic to that returned by remote ends - according to the rest of this algorithm. +

  2. If the remote end is an intermediary node, take + implementation-defined steps that either result in returning + an error with error code session not created, + or in returning a success with data that is isomorphic to + that returned by remote ends according to the rest of this + algorithm. If an error is not returned, the intermediary + node must retain a reference to the session created on + the upstream node as the associated session such that + commands may be forwarded to this associated session on + subsequent commands. + +

    How this is done is entirely up to the implementation, + but typically the sessionId, and URL and + URL prefix of the upstream remote end will need + to be tracked.

  3. If the maximum active sessions is equal to the length of the list of active sessions, @@ -2685,7 +2721,7 @@

    Delete Session

    The remote end steps are:

      -
    1. Close the session. +

    2. Try to close the session.

    3. Return success with data null.

    @@ -3439,7 +3475,7 @@

    Close Window

  4. Close the current top-level browsing context.

  5. If there are no more open top-level browsing contexts, - then close the session. + then try to close the session.

  6. Return the result of running the remote end steps for the Get Window Handles command.