Closed Bug 1311657 Opened 4 years ago Closed 4 years ago

switch_to_frame() can prevent close_chrome_window() from closing the chrome window

Categories

(Testing :: Marionette, defect)

Version 3
defect
Not set
normal

Tracking

(firefox52 fixed, firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox52 --- fixed
firefox53 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I have seen this issue while working on bug 1259055. The XUL dialog (test_anonymous_content.xul) which gets opened by "test_anonymous_content.py TestAnonymousContent.test_switch_to_anonymous_iframe" cannot be closed after `switch_to_frame()` has been called.

A switch_to_window() call to actually switch to the chrome window succeeds, but the call to close_chrome_window() right after fails. I cannot 

1476962103221	Marionette	TRACE	conn10 -> [0,21,"switchToFrame",{"focus":true,"element":"2aa734d6-973b-b641-92ee-10fcded402cb"}]
1476962103223	Marionette	TRACE	conn10 <- [1,21,null,{}]
1476962103225	Marionette	TRACE	conn10 -> [0,22,"getChromeWindowHandles",null]
1476962103226	Marionette	TRACE	conn10 <- [1,22,null,["3","90"]]
1476962103227	Marionette	TRACE	conn10 -> [0,23,"getContext",null]
1476962103228	Marionette	TRACE	conn10 <- [1,23,null,{"value":"chrome"}]
1476962103229	Marionette	TRACE	conn10 -> [0,24,"setContext",{"value":"chrome"}]
1476962103230	Marionette	TRACE	conn10 <- [1,24,null,{}]
1476962103234	Marionette	TRACE	conn10 -> [0,25,"switchToWindow",{"name":"90"}]
1476962103235	Marionette	TRACE	conn10 <- [1,25,null,{}]
1476962103237	Marionette	TRACE	conn10 -> [0,26,"getCurrentChromeWindowHandle",null]
1476962103237	Marionette	TRACE	conn10 <- [1,26,null,{"value":"90"}]
1476962103239	Marionette	TRACE	conn10 -> [0,27,"closeChromeWindow",null]
1476962103240	Marionette	TRACE	conn10 <- [1,27,null,{}]
1476962103243	Marionette	TRACE	conn10 -> [0,28,"getChromeWindowHandles",null]
1476962103244	Marionette	TRACE	conn10 <- [1,28,null,["3","90"]]
[..]
1476962108247	Marionette	TRACE	conn10 -> [0,77,"setContext",{"value":"chrome"}]
1476962108247	Marionette	TRACE	conn10 <- [1,77,null,{}]
1476962108249	Marionette	TRACE	conn10 -> [0,78,"getContext",null]
1476962108250	Marionette	TRACE	conn10 <- [1,78,null,{"value":"chrome"}]
1476962108251	Marionette	TRACE	conn10 -> [0,79,"setContext",{"value":"chrome"}]
1476962108252	Marionette	TRACE	conn10 <- [1,79,null,{}]
1476962108253	Marionette	TRACE	conn10 -> [0,80,"takeScreenshot",{"highlights":null,"full":true,"hash":false,"id":null}]
1476962108254	Marionette	TRACE	conn10 <- [1,80,null,{"value":""}]

I will disable this test as part of my patch on bug 1259055 given that it actually can cause a regression in following tests.
Summary: switch_to_frame() prevents close_chrome_window() from closing the chrome window → switch_to_frame() for anonymous iframe prevents close_chrome_window() from closing the chrome window
Same problem exists in test_switch_frame_chrome.py TestSwitchFrameChrome.* when calling switch_to_frame(0).

So it's not only anonymous iframe related.
Summary: switch_to_frame() for anonymous iframe prevents close_chrome_window() from closing the chrome window → switch_to_frame() can prevent close_chrome_window() from closing the chrome window
Lets wait for bug 1259055 before tackling this.
Depends on: 1259055
The problem here is similar to endSession that we have to switch to the top-most frame. Patch upcoming.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Comment on attachment 8818194 [details]
Bug 1311657 - Switch to top-most frame first before closing chrome window.

https://reviewboard.mozilla.org/r/98324/#review98918

This is excellent.  Thanks for fixing this!
Attachment #8818194 - Flags: review?(ato) → review+
If possible, I’d quite like to uplift this all the way.
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/24bf5850aefe
Switch to top-most frame first before closing chrome window. r=ato
https://hg.mozilla.org/mozilla-central/rev/24bf5850aefe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Test-only patch we would like to have for the next ESR release. Please uplift to aurora. Thanks.
Whiteboard: [checkin-needed-aurora]
https://hg.mozilla.org/releases/mozilla-aurora/rev/6db2fdca32d1
Flags: in-testsuite+
Whiteboard: [checkin-needed-aurora]
You need to log in before you can comment on or make changes to this bug.