Closed Bug 1789659 Opened 2 years ago Closed 2 years ago

"TabManager.removeTab" needs to be async

Categories

(Remote Protocol :: Agent, defect, P1)

defect
Points:
2

Tracking

(firefox107 fixed)

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m5], [wptsync upstream])

Attachments

(1 file)

The TabManager.removeTab() method is currently not async. It calls into tabBrowser.removeTab() which we cannot assume it is synchronous.

When making this change locally I can get everything working except the following wdspec test: testing/web-platform/tests/webdriver/tests/bidi/browsing_context/navigate/wait.py::test_slow_image[complete-True].

The reason here is that the browsingContext.navigate command with wait: complete errors because we do not wait for it to finish on purpose but close the tab while the page is still loading. Maybe the test has to take it as a navigation aborted case?

We probably want to wait with a fix here until bug 1506782 has been fixed.

Blocks: 1559120
Blocks: 1791306

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Flags: needinfo?(hskupin)
Priority: -- → P2
Whiteboard: [webdriver:backlog]
Blocks: 1790329
Assignee: nobody → hskupin
Blocks: webdriver:m5
No longer blocks: 1790329
Status: NEW → ASSIGNED
Points: --- → 2
Whiteboard: [webdriver:backlog] → [webdriver:m4]
Priority: P2 → P1
Whiteboard: [webdriver:m4] → [webdriver:m5]
Blocks: 1790329

With the code changes applied we run into a timeout error for /webdriver/tests/bidi/browsing_context/navigate/wait.py:

 0:16.67 pid:27538 1663952952965	RemoteAgent	TRACE	WebDriverBiDiConnection 9958f10e-092c-4913-9e19-4df65b2d5179 -> {"id":22,"method":"browsingContext.close","params":{"context":"abe20296-eef6-454b-bc54-d6ae9b670986"}}
 0:16.67 pid:27538 1663952952965	RemoteAgent	TRACE	Received command browsingContext.close for destination ROOT
 0:16.67 pid:27538 1663952952968	RemoteAgent	TRACE	[21] ProgressListener state=stop: error=0x80004004 (NS_ERROR_ABORT)
 0:16.67 pid:27538 1663952952969	RemoteAgent	TRACE	MessageHandler WINDOW_GLOBAL for session 37623124-0863-4e4b-bba2-0d29869b23ce is being destroyed
 0:16.68 pid:27538 1663952952969	RemoteAgent	TRACE	Unregistered MessageHandler WINDOW_GLOBAL for session 37623124-0863-4e4b-bba2-0d29869b23ce
 0:16.68 pid:27538 1663952952970	RemoteAgent	TRACE	WebDriverBiDiConnection 9958f10e-092c-4913-9e19-4df65b2d5179 <- {"id":20,"error":"unknown error","message":"Error: NS_ERROR_ABORT","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:239:28\nonStateChange@chrome://remote/content/shared/Navigate.jsm:284:28\n_endRemoveTab@chrome://browser/content/tabbrowser.js:4190:15\nremoveTab@chrome://browser/content/tabbrowser.js:3823:14\nremoveTab@chrome://remote/content/shared/TabManager.jsm:270:22\nclose@chrome://remote/content/webdriver-bidi/modules/root/browsingContext.jsm:138:27\nhandleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.jsm:256:33\nexecute@chrome://remote/content/shared/webdriver/Session.jsm:241:32\nonPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.jsm:177:37\nonMessage@chrome://remote/content/server/WebSocketTransport.jsm:91:18\nhandleEvent@chrome://remote/content/server/WebSocketTransport.jsm:73:14\n"}
 0:16.68 pid:27538 1663952952970	RemoteAgent	TRACE	WebDriverBiDiConnection 9958f10e-092c-4913-9e19-4df65b2d5179 <- {"id":22,"result":{}}
 0:16.68 pid:27538 1663952952972	RemoteAgent	TRACE	MessageHandler WINDOW_GLOBAL for session 37623124-0863-4e4b-bba2-0d29869b23ce is being destroyed
 0:16.68 pid:27538 1663952952972	RemoteAgent	TRACE	Unregistered MessageHandler WINDOW_GLOBAL for session 37623124-0863-4e4b-bba2-0d29869b23ce
 0:16.68 pid:27538 JavaScript error: chrome://remote/content/shared/Navigate.jsm, line 239: Error: NS_ERROR_ABORT

Note that in such a case we do not await the call to browsingContext.navigate with wait=complete and go ahead and call browsingContext.close. As such the navigation gets aborted and raises an error. Given that we do not await for the result of the navigation I actually do not expect that our test would fail on this failure.

Not sure yet if the navigation should actually fail or simply return.

Blocks: 1762386
Blocks: 1792688
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8799c655f87f
[remote] Make TabManager.removeTab asynchronous. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36185 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m5] → [webdriver:m5], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot
Blocks: 1729409
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: