Closed
Bug 1336445
Opened 8 years ago
Closed 8 years ago
If switch_to_window is called with a chrome handle, the first tab of that window gets selected
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(firefox52 fixed, firefox53 fixed, firefox54 fixed)
RESOLVED
FIXED
mozilla54
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
We have some broken behavior in our switchToWindow() implementation which causes us to select the first tab when actually switching to the chrome window handle. This is because we also take all the content window handles into account, and return the index=0 for the first match.
We should only check the content windows if the handle is not for a chrome window.
Patch and test is upcoming.
This blocks bug 1322383 from landing, because it found this issue.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8833325 -
Flags: review?(ato)
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8833325 [details]
Bug 1336445 - Don't select the first tab if switch_to_window() is called with a chrome window handle.
https://reviewboard.mozilla.org/r/109584/#review110662
Attachment #8833325 -
Flags: review?(ato) → review+
Backed out for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=74406761&repo=autoland
https://hg.mozilla.org/integration/autoland/rev/711aa14e4c4cfe5a39fd3c06ac67c4bb31573375
Flags: needinfo?(hskupin)
Assignee | ||
Comment 5•8 years ago
|
||
I had a look and totally my fault! When I see this I really wonder why no other Mn test actually noticed that problem! What we miss here is to initialize the first content browser when opening a new chrome window. Because we look for tabIndex, which will no longer be set by moving those code lines above the other block.
I have a working solution locally but will add another unit test.
Flags: needinfo?(hskupin)
Assignee | ||
Comment 6•8 years ago
|
||
The code path you actually have to take to reproduce this problem is opening a new private browsing window. If you don't do that it's not reproducible. At least I can setup a proper unit test for marionette now.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8833325 -
Flags: review+ → review?(ato)
Assignee | ||
Comment 8•8 years ago
|
||
Comment on attachment 8833325 [details]
Bug 1336445 - Don't select the first tab if switch_to_window() is called with a chrome window handle.
Try shows bustage somewhere in session creation for fx-ui-tests.
Attachment #8833325 -
Flags: review?(ato)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 10•8 years ago
|
||
Comment on attachment 8833325 [details]
Bug 1336445 - Don't select the first tab if switch_to_window() is called with a chrome window handle.
Silly mistake I made in the last revision. The property hasTabBrowser is always present for non-browser windows. So a check for `"hasTabBrowser" in found` always results in trying to register browsers, which caused an obvious hang.
Attachment #8833325 -
Flags: review?(ato)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•8 years ago
|
||
Last update contains a small fix for a race condition I noticed in the try builds on Linux, where we do not wait long enough for the body element to appear. It's better to exchange it with a call to execute_script() which indeed has the same effect.
Comment 14•8 years ago
|
||
mozreview-review |
Comment on attachment 8833325 [details]
Bug 1336445 - Don't select the first tab if switch_to_window() is called with a chrome window handle.
https://reviewboard.mozilla.org/r/109584/#review111100
Attachment #8833325 -
Flags: review?(ato) → review+
Comment 15•8 years ago
|
||
The latest revision looks excellent. It would be good if we could uplift this to the relevant channels, if possible.
Comment 16•8 years ago
|
||
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f08c78b5f19b
Don't select the first tab if switch_to_window() is called with a chrome window handle. r=ato
Comment 17•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Assignee | ||
Comment 18•8 years ago
|
||
test-only changes we would like to see uplifted for aurora and beta. Thanks.
status-firefox52:
--- → affected
status-firefox53:
--- → affected
Whiteboard: [checkin-needed-aurora][checkin-needed-beta]
Assignee | ||
Updated•8 years ago
|
Blocks: webdriver-chrome
Comment 19•8 years ago
|
||
bugherder uplift |
Whiteboard: [checkin-needed-aurora][checkin-needed-beta] → [checkin-needed-beta]
Comment 20•8 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•