Skip to content

Introduce the concept of an associated session #824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 48 additions & 12 deletions webdriver-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,14 @@ <h2>Sessions</h2>
or implicitly when <a>Close Window</a> is called
at the last remaining <a>top-level browsing context</a>.

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

<p>All <a>commands</a>, except <a>New Session</a> and <a>Status</a>,
have an associated <dfn>current session</dfn>,
which is the <a>session</a> in which that <a>command</a> will run.
Expand Down Expand Up @@ -2496,15 +2504,34 @@ <h2>Sessions</h2>
a <a>remote end</a> must take the following steps:

<ol>
<li><p>Set the <a>webdriver-active flag</a> to false.
<li><p>Perform the folowing substeps based on the <a>remote end</a>'s
type:
<dl class=switch>
<dt><a>Remote end</a> is an <a>endpoint node</a>
<dd>
<ol>
<li><p>Set the <a>webdriver-active flag</a> to false.

<li><p><a>Close</a> any <a>top-level browsing contexts</a>
associated with the <a>session</a>,
without <a>prompting to unload</a>.
<li><p>An <a>endpoint node</a> must <a>close</a> any <a>top-level
browsing contexts</a> associated with the <a>session</a>,
without <a>prompting to unload</a>.
</ol>
<dt><a>Remote end</a> is an <a>intermediary node</a>
<dd>
<ol>
<li><p><a>Close</a> the <a>associated session</a>. If this causes
an <a>error</a> to occur, complete the remainder of this
algorithm before returning the <a>error</a>.
</ol>
</dl>

<li><p>Remove the <a>current session</a> from <a>active sessions</a>.

<li><p>Perform any implementation-specific cleanup steps.

<li><p>If an <a>error</a> has occurred in any of the steps above,
return the <a>error</a>, otherwise return <a>success</a> with
data <a><code>null</code></a>.
</ol>

<p>Closing a <a>session</a> might cause the associated browser process to be killed.
Expand Down Expand Up @@ -2565,12 +2592,21 @@ <h3>New Session</h3>
<p>The <a>remote end steps</a> are:

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

<p class=note>How this is done is entirely up to the implementation,
but typically the <code>sessionId</code>, and <a>URL</a> and
<a>URL prefix</a> of the <a>upstream</a> <a>remote end</a> will need
to be tracked.

<li><p>If the <a>maximum active sessions</a> is equal to
the length of the list of <a>active sessions</a>,
Expand Down Expand Up @@ -2685,7 +2721,7 @@ <h3>Delete Session</h3>
<p>The <a>remote end steps</a> are:

<ol>
<li><p><a>Close the session</a>.
<li><p><a>Try</a> to <a>close the session</a>.

<li><p>Return <a>success</a> with data <a><code>null</code></a>.
</ol>
Expand Down Expand Up @@ -3439,7 +3475,7 @@ <h3>Close Window</h3>
<li><p><a>Close</a> the <a>current top-level browsing context</a>.

<li><p>If there are no more open <a>top-level browsing contexts</a>,
then <a>close the session</a>.
then <a>try</a> to <a>close the session</a>.

<li>Return the result of running the <a>remote end steps</a>
for the <a>Get Window Handles</a> <a>command</a>.
Expand Down