Closed Bug 1403528 Opened 7 years ago Closed 5 years ago

Remove special-casing of close()/closeChromeWindow() if only one tab/window is present

Categories

(Remote Protocol :: Marionette, enhancement, P3)

57 Branch
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: whimboo, Unassigned)

Details

While trying to get a testcase with Marionette for bug 1403510 I noticed that we have this workaround in the driver for `close`:

https://dxr.mozilla.org/mozilla-central/source/testing/marionette/driver.js#2744-2749

I feel more and more that this is a wrong thing to do. Also because it causes inconsistencies between a click which triggers `window.close()`. I would expect that Marionette behaves exactly the same in both cases, which means it closes the tab/window even if only one is remaining.

I cannot remember why we actually put this code in place, and why we don't want to close the last window.

Andreas, what do you think?
Flags: needinfo?
Flags: needinfo? → needinfo?(ato)
A click that causes the window to close is not meant to end the
session given the current specification text.  It can be argued that
it should, but it’s not called out specifically at the moment.

Regarding the piece of code you referenced that returns an empty
array if WebDriver:CloseWindow is called and there is only one tlbc
open:

>   // 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 [];
>   }

This is there because it is geckodriver that needs to end the
Firefox child process.  If Marionette quits Firefox we are unable to
guarantee that the response is sent back to geckodriver before the
process exits.
Flags: needinfo?(ato)
[Mass Change 2018-01-15] Moving bugs to backlog
Priority: -- → P3

I think it's actually not something we want to change.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.