running httpd.js on a remote host

This exercise came about as an option for running unittests on windows mobile. We ran into an issue where the http server was running but not returning web pages. Vlad had mentioned running the web server on a host machine to be respectful of the memory on the device. In the past other members of the QA team have tried this with no luck. With the help of :waldo, I was able to get tests running while accessing a remote webserver.

For a quick background, all unittests rely on httpd.js running via xpcshell to serve web pages. For example, xpcshell update tests (test_0030_general.js) utilize httpd.js to download a .mar file and mochitest uses httpd.js for every test it runs. It is a little tricky to get this to run on a remote server as there are a few things to edit:

Now you need to fire up xpcshell to run as a server:

#set any env variables such as
#LD_LIBRARY_PATH=$firefox_dir/xulrunner on linux
cd $firefox_dir/xulrunner
./xpcshell -f ../../mochitest/httpd.js -f ../../mochitest/server.js

On the remote machine launch your test and be happy!

To really utilize this for the Fennec unittests on Windows Mobile, we will have to make many changes to the tests in addition to the ones mentioned above. Making it fit into automation would be very difficult as ip addresses can change and we might need to set it dynamically. Alternatively, running 1 host to many clients does have some attraction.

Advertisements

5 Comments

Filed under testdev

5 responses to “running httpd.js on a remote host

  1. Is this possible to make an add-on with httpd.js to control Firefox remotly ?

    • elvis314

      There is a lot of value from that, but danger as well. I know that Mark Finkle is working on a remote javascript tool which might be similar. I pinged him in IRC and he has most of a blog post written up already. I don’t know if using httpd.js directly is the best method for it, but maybe this is a good tool to play with and learn.

  2. ahdesai

    Go Jmaher, Go!

  3. Pingback: considering new approach to mochitest on mobile « 3.1415926535897932384626433…

  4. Pingback: mochitests are starting to run on windows mobile « 3.1415926535897932384626433…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s