Closed Bug 1873948 Opened 4 months ago Closed 3 months ago

"browsingContext.close" should be able to close the last tab of a window

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect
Points:
3

Tracking

(firefox-esr115 unaffected, firefox121 unaffected, firefox122 unaffected, firefox123 wontfix, firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox121 --- unaffected
firefox122 --- unaffected
firefox123 --- wontfix
firefox124 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: whimboo)

References

(Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [webdriver:m10][webdriver:relnote])

Attachments

(2 files)

Filed by: hskupin [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=442845038&repo=try
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/fhR4hJ3GTKuQ5si51KOX9A/runs/0/artifacts/public/logs/live_backing.log


The test will start to fail because of the upcoming changes from bug 1873916 and especially the preference `browser.tabs.closeWindowWithLastTab` that we set to `false` via recommended preferences for all Remote Agent related protocols.

We should figure out what to do here given that it should only affect the last tab of the very last open browser window. Maybe instead of setting the preference we should use the window enumerator and check if closing the window is possible or not so that the browser doesn't shut down.

:whimboo, since you are the author of the regressor, bug 1873916, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)

This needs a discussion. We will do that in our next weeks triage session.

Flags: needinfo?(hskupin)
Whiteboard: [webdriver:triage]

Set release status flags based on info from the regressing bug 1873916

The WebDriver BiDi specification is not clear about the right behavior: https://github.com/w3c/webdriver-bidi/issues/187.

But that shouldn't block us here. So just let us remove this pref and check for at least one open tab/window.

Points: --- → 3
Priority: P5 → P2
Whiteboard: [webdriver:triage] → [webdriver:m10]

This also removes the custom value of the recommended
preference browser.tabs.closeWindowWithLastTab because
it currently blocks closing the last tab of a window for
the "browsingContext.close" command.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Assignee: hskupin → nobody
Status: ASSIGNED → NEW
Summary: Perma /webdriver/tests/bidi/browsing_context/close/close.py | test_top_level_context[window] - assert 2 == 1 → "browsingContext.close" should be able to close the last tab of a window
Assignee: nobody → hskupin
Attachment #9375509 - Attachment description: Bug 1873948 - [webdriver-bidi] Do not close the very last open browser tab. → Bug 1873948 - [webdriver-bidi] "browsingContext.close" should be able to close the last tab of a window.
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/44ed20f894fb
[webdriver-bidi] "browsingContext.close" should be able to close the last tab of a window. r=webdriver-reviewers,Sasha

Backed out for causing Puppeteer related failure

Backout link

Push with failures

Failure log 1 // Failure log 2

Flags: needinfo?(hskupin)

Set release status flags based on info from the regressing bug 1873916

I cannot actually reproduce the problem locally on MacOS. It might be related to the fact that the application stays open even with the last window closed. I actually would propose to keep the browser.tabs.closeWindowWithLastTab preference set to false for Puppeteer and only when the CDP protocol is selected. It works all fine with WebDriver BiDi.

I pushed a try build to check if that approach works:
https://treeherder.mozilla.org/jobs?repo=try&revision=2a46d284a5b154792a517a8f431a416e4206fb97

Flags: needinfo?(hskupin)

I was able to reproduce on a Linux machine but fixing this might need some effort that we do not want to spend for CDP. As such keeping the preference for CDP sounds the best solution to me.

The only problem is that we cannot land the patch stack until a new version of Puppeteer has been released with the change in D200073 included.

Whiteboard: [webdriver:m10] → [webdriver:m10:blocked]
Depends on: 1877214

(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #14)

The upstream PR for Puppeteer is: https://github.com/puppeteer/puppeteer/pull/11794

The PR got merged. I'm now waiting for the next Puppeteer release to get this stack of patches pushed.

A new Puppeteer release is out. That means we can push the stack now.

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/539c2d1bb3b6
[webdriver-bidi] "browsingContext.close" should be able to close the last tab of a window. r=webdriver-reviewers,Sasha
https://hg.mozilla.org/integration/autoland/rev/d4f5993f9b5c
[puppeteer] Keep "browser.tabs.closeWindowWithLastTab" disabled for CDP. r=webdriver-reviewers,Sasha
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch

The patch landed in nightly and beta is affected.
:whimboo, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox123 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)

This should as best ride the trains, so lets not uplift.

Flags: needinfo?(hskupin)
Whiteboard: [webdriver:m10:blocked] → [webdriver:m10][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: