Closed Bug 787545 Opened 7 years ago Closed 7 years ago

When creating a new session on Fennec the socket times out

Categories

(Testing :: Marionette, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla18

People

(Reporter: automatedtester, Assigned: automatedtester)

References

Details

Attachments

(1 file)

When I try get a new session from Marionette something happens and causes a socket.timeout


>>> m = Marionette('localhost', 2826)
>>> m.start_session()                                                          
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/davidburns/mozilla-inbound/testing/marionette/client/marionette/m
arionette.py", line 239, in start_session
    self.session = self._send_message('newSession', 'value')
  File "/home/davidburns/mozilla-inbound/testing/marionette/client/marionette/m
arionette.py", line 152, in _send_message
    response = self.client.send(message)
  File "/home/davidburns/mozilla-inbound/testing/marionette/client/marionette/c
lient.py", line 84, in send
    response = self.receive()
  File "/home/davidburns/mozilla-inbound/testing/marionette/client/marionette/c
lient.py", line 52, in receive
    raise MarionetteException("Could not successfully complete transport of mes
sage to Gecko, socket closed?")
marionette.errors.MarionetteException: Could not successfully complete transpor
t of message to Gecko, socket closed?
>>>
This isn't too surprising.  When you create a new session, Marionette tries to attach itself to the browser window.  To do this, it needs to know something about how that's implemented, which varies between Firefox, Fennec and B2G.  We have code to handle the Firefox and B2G cases, but not the Fennec case, so we'll have to add code to address this.
I can telnet to the device and http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-actors.js#74 answers so am currently connecting to Marionette.
The code that's dying is here: http://mxr.mozilla.org/mozilla-central/source/testing/marionette/marionette-actors.js#1568

getBrowserForTab and related functions don't exist in Fennec, they're Firefox specific.  We need to figure out the Fennec analogs, probably from http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js, and use them in the Fennec case.
Thanks :jgriffin, I suspect there are going to be a number of similar things like this as I get marionette working on Fennec.
Depends on: 787280
Assignee: nobody → dburns
Attachment #661875 - Flags: review?(jgriffin)
Depends on: 791793
Comment on attachment 661875 [details] [diff] [review]
Allow marionette to work on Fennec

Review of attachment 661875 [details] [diff] [review]:
-----------------------------------------------------------------

This looks ok to me.  I assume you've verified it doesn't break with Firefox?  This doesn't create a new tab on Fennec for a new session, as we do for Firefox.  I'm assuming that's acceptable; we can always change that behavior later if needed.
Attachment #661875 - Flags: review?(jgriffin) → review+
(In reply to Jonathan Griffin (:jgriffin) from comment #6)
> Comment on attachment 661875 [details] [diff] [review]
> Allow marionette to work on Fennec
> 
> Review of attachment 661875 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This looks ok to me.  I assume you've verified it doesn't break with
> Firefox?  

Most definitely! Not wanting mud on my face!

>This doesn't create a new tab on Fennec for a new session, as we
> do for Firefox.  I'm assuming that's acceptable; we can always change that
> behavior later if needed.

Since the primary use case, that I know of, is running against web apps in the web runtime, I don't know how well the tabs are going to work but as you say, if I need to change it it should be simple :)

Thanks for the r+
https://hg.mozilla.org/mozilla-central/rev/eacd4f900b56
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Blocks: 1294427
No longer blocks: 1294427
You need to log in before you can comment on or make changes to this bug.