Skip to content
This repository has been archived by the owner on Aug 19, 2021. It is now read-only.

Commit

Permalink
add test static server to proper test repl injection works on Firefox…
Browse files Browse the repository at this point in the history
… >= 40 is remote tabs feature is disabled
  • Loading branch information
rpl committed Jul 29, 2015
1 parent 510a278 commit d344db0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: node_js
node_js:
- "0.10"
env:
- FIREFOX_VERSION=40.0b8
- FIREFOX_VERSION=39.0
- FIREFOX_VERSION=38.0.6
- FIREFOX_VERSION=37.0.2
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"chai": "^3.2.0",
"jpm": "^1.0.0",
"mocha": "^2.2.5",
"mozfee": "^0.1.5"
"mozfee": "^0.1.5",
"node-static": "^0.7.7"
}
}
Empty file added test/fixtures/index.html
Empty file.
5 changes: 4 additions & 1 deletion test/fixtures/test-prefs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extensions.mozrepl.autoStart": true
"extensions.mozrepl.autoStart": true,
"browser.tabs.remote.autostart": false,
"browser.tabs.remote.autostart.1": false,
"browser.tabs.remote.autostart.2": false
}
14 changes: 13 additions & 1 deletion test/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ var path = require("path");

var mozrepl;

var static = require('node-static');

var file = new static.Server("./test/fixtures/");

require('http').createServer(function (request, response) {
request.addListener('end', function () {
file.serve(request, response);
}).resume();
}).listen(8080);

var manifest = jpm_utils.getManifest();

jpm_run(manifest, {
Expand All @@ -30,7 +40,9 @@ beforeEach(function(done) {
mozrepl.connect();
}

mozrepl.on("connect", done);
mozrepl.on("connect", function() {
mozrepl.eval("content.location = 'http://localhost:8080';", done);
});
mozrepl.on("error", function() {
if (retries > 0) {
console.log("RETRY");
Expand Down

0 comments on commit d344db0

Please sign in to comment.