Sample standalone HTTP servers:

https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/modules-testing/aitcserver.js
https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/modules-testing/storageserver.js

Minimal JS files to launch said servers:

https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/tests/run_aitc_server.js
https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/tests/run_storage_server.js

Python script to invoke xpcshell process with necessary arguments to get JS to work:

https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/tests/run_server.py

Makefile targets to run the Python script (just for reference - this should probably be implemented as mach commands these days):

https://hg.mozilla.org/mozilla-central/file/214853a29174/services/common/Makefile.in#l43

I wish it were easier. If this pattern ever becomes prevalent, we should probably move the Python + JS harness to somewhere more central. File a bug against me and I'll happily refactor the code in services/ to be more generic and shareable.

Let me know if you have any questions.

Gregory

On 10/17/12 4:01 PM, Jim Porter wrote:
I'm looking to write a fake server for the ActiveSync protocol, which I
will eventually incorporate into xpcshell tests. httpd.js seems like the
best tool for the job here.

However, since the server is fairly complex, I wanted to be able to use
XHRs in Firefox to talk to the server just to test things out. However,
the documentation only seems to say how to use httpd.js in xpcshell.
Surely there's a simpler way to get started. Does anyone know of such a
way?

Ideally, I'd be able to use this as a fake server for B2G desktop to
talk to as well, since that would let manually test against the
ActiveSync client implementation in Gaia.

Thanks,
Jim
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to