Closed Bug 941749 Opened 12 years ago Closed 11 years ago

getWindows should return tabs

Categories

(Remote Protocol :: Marionette, defect, P1)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla37

People

(Reporter: jlal, Assigned: chmanchester)

References

Details

(Keywords: pi-marionette-server, pi-marionette-spec, Whiteboard: [spec][affects=gaia])

Attachments

(3 files, 2 obsolete files)

I have a firefox profile with some extensions that is running with marionette enabled. When it starts it is in a tab running "system.gaiamobile.org" when I start the session I am now in about:blank and cannot find the tab with getWindows.
geWindows should return all available tabs, and right now we just retrieve "navigator:browser" type windows, which doesn't return tabs.
Summary: Cannot find tabs with getWindows. ? → getWindows should return tabs
Assignee: nobody → mdas
also related: Bug 941770 (stop creating the new tab)
Whiteboard: [spec]
Whiteboard: [spec] → [spec][affects=loop gaia]
Whiteboard: [spec][affects=loop gaia] → [spec][affects=gaia]
Two test cases I came up with when I thought this was bug 1097221.
Basing the window handle commands on tabs rather than windows should be doable, but will require a pretty extensive re-work of marionette's internal mechanism for keeping track of things.
(It really helps to talk about top level browsing contexts here rather than "tabs". Otherwise it's hard to tell if you are going to implement the right thing).
/r/751 - Bug 941749 - A test managing open windows and tabs with marionette. /r/753 - Bug 941749 - Add support for returning both known tabs and chrome windows from the marionette server. Pull down these commits: hg pull review -r 5921494d714ba584753e5f9020c8f78fa5777c6a
The commits above are a rough version of what we discussed in the m21s meeting yesterday. I'm interested in feedback on the api and implementation. Try: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=e6de410e3933
https://reviewboard.mozilla.org/r/749/#review343 ::: testing/marionette/client/marionette/tests/unit/test_window_handles.py (Diff revision 1) > + self.marionette.navigate("about:blank") > + self.marionette.navigate("about:home") > + self.marionette.navigate("about:blank") about:home loads external content, consider using data URI's with a <title> tag or something.
Attachment #8524791 - Flags: feedback?(dburns)
https://reviewboard.mozilla.org/r/749/#review397 from a quick look this looks great. I would like to see how it fares on Try ::: testing/marionette/client/marionette/tests/unit/test_window_handles.py (Diff revision 1) > + def test_tab_and_window_handles(self): This scenario is the most important one really, thanks for writing a test!
Attachment #8524791 - Flags: feedback?(dburns) → feedback+
/r/751 - Bug 941749 - A test managing open windows and tabs with marionette. /r/753 - Bug 941749 - Add support for returning both known tabs and chrome windows from the marionette server. Pull down these commits: hg pull review -r 7b84c35142ecdc0ba3bb4aeffdbef1d86d14591b
I noticed from pushing my updated patch to try that wpt relies on the old behavior, so we'll need an update there before landing this.
This should fix the wpt issue (I'll submit a pr upstream when the changes are finalized and ready to land): https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ed769b37d4d5
Attachment #8520966 - Attachment is obsolete: true
(In reply to Chris Manchester [:chmanchester] from comment #17) > This should fix the wpt issue (I'll submit a pr upstream when the changes > are finalized and ready to land): > > https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ed769b37d4d5 According to jgraham this intention of this assertion is that top level browsing contexts aren't being leaked between tests, but isn't quite doing that because of just this bug. So all we need here is a stopgap to keep things working between when this bug lands in tree and the upstream harness can be fixed to take the it in to account and enforce the original intent.
Attachment #8524791 - Flags: review?(dburns)
/r/751 - Bug 941749 - A test managing open windows and tabs with marionette. /r/753 - Bug 941749 - Add support for returning both known tabs and chrome windows from the marionette server. Pull down these commits: hg pull review -r fa56c5604c21cd1b2236c697d769036dde27cd6f
https://reviewboard.mozilla.org/r/749/#review537 ::: testing/marionette/marionette-server.js (Diff revision 3) > + if (appName == 'Firefox' && this.curBrowser.curFrameId) { :whimboo noted on irc that this checks for appName == 'Firefox' here and appName != 'B2G' below. Not sure if one is prefereable to the other, but they should be consistent.
Attachment #8524791 - Flags: review?(dburns) → review+
Opened https://github.com/w3c/wptrunner/pull/58 to prevent wpt bustage when this lands.
Attachment #8524791 - Flags: review+ → review?(dburns)
/r/751 - Bug 941749 - A test managing open windows and tabs with marionette.;r=automatedtester /r/753 - Bug 941749 - Add support for returning both known tabs and chrome windows from the marionette server.;r=automatedtester Pull down these commits: hg pull review -r 4775706a1f7a4c345fa1481cfed453ccd8be160c
Comment on attachment 8524791 [details] MozReview Request: bz://941749/chmanchester Didn't mean for mozreview to re-set that.
Attachment #8524791 - Flags: review?(dburns) → review+
Comment on attachment 8529186 [details] [review] Remove assertion in wpt invalidated by the fix. Forgot to say here that I merged the wptrunner fix upstream, so we just need to pull the latest version into the tree.
Attachment #8529186 - Flags: review?(james) → review+
I just found pushing to try this fails a test on b2g, investigating now.
Assignee: mdas → cmanchester
Attachment #8524791 - Flags: review+ → review?(dburns)
/r/751 - Bug 941749 - A test managing open windows and tabs with marionette.;r=automatedtester /r/753 - Bug 941749 - Add support for returning both known tabs and chrome windows from the marionette server.;r=automatedtester Pull down these commits: hg pull review -r 3d26a4a0d9ab5b72b02c62f0b8891204579be0c9
https://reviewboard.mozilla.org/r/749/#review783 ::: testing/marionette/marionette-server.js (Diff revisions 4 - 5) > + winId += (appName == "B2G") ? "-b2g" : ""; The previous patch didn't add the '-b2g' suffix, so tests switching windows on b2g started failing. Wasn't sure whether this required re-review, so decided to err on the side of caution.
Attachment #8524791 - Flags: review?(dburns) → review+
Chris, one thing I noticed here is the different implementation as shown below: > 2.275 "getCurrentWindowHandle": MarionetteServerConnection.prototype.getWindowHandle, // Selenium 2 compat > 2.276 + "getChromeWindowHandle": MarionetteServerConnection.prototype.getChromeWindowHandle, Was there a reason not to use getCurrentChromeWindowHandle together with .current_chrome_window_handle? Was it just the length which let you do the shorter property name? .chrome_window_handle doesn't really tell that it is the one for the currently selected chrome window.
Flags: needinfo?(cmanchester)
(In reply to Henrik Skupin (:whimboo) from comment #34) > Chris, one thing I noticed here is the different implementation as shown > below: > > > 2.275 "getCurrentWindowHandle": MarionetteServerConnection.prototype.getWindowHandle, // Selenium 2 compat > > 2.276 + "getChromeWindowHandle": MarionetteServerConnection.prototype.getChromeWindowHandle, > > Was there a reason not to use getCurrentChromeWindowHandle together with > .current_chrome_window_handle? Was it just the length which let you do the > shorter property name? .chrome_window_handle doesn't really tell that it is > the one for the currently selected chrome window. Yes, for a reasonably short name. I think it's ok, but I wouldn't really have a problem with changing it.
Flags: needinfo?(cmanchester)
(In reply to Chris Manchester [:chmanchester] from comment #35) > > > 2.275 "getCurrentWindowHandle": MarionetteServerConnection.prototype.getWindowHandle, // Selenium 2 compat > > > 2.276 + "getChromeWindowHandle": MarionetteServerConnection.prototype.getChromeWindowHandle, > > > > Was there a reason not to use getCurrentChromeWindowHandle together with > > .current_chrome_window_handle? Was it just the length which let you do the > > shorter property name? .chrome_window_handle doesn't really tell that it is > > the one for the currently selected chrome window. > > Yes, for a reasonably short name. I think it's ok, but I wouldn't really > have a problem with changing it. David, what is your opinion here?
Flags: needinfo?(dburns)
No problem changing it, let's get this sorted ASAP
Flags: needinfo?(dburns)
Attachment #8524791 - Attachment is obsolete: true
Attachment #8618062 - Flags: review+
Attachment #8618063 - Flags: review+
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: