Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
65
gaia/tests/jsmarionette/runner/mozilla-runner/test/detectbinary.js
Executable file
65
gaia/tests/jsmarionette/runner/mozilla-runner/test/detectbinary.js
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
'use strict';
|
||||
var assert = require('assert');
|
||||
var fsPath = require('path');
|
||||
var subject = require('../lib/detectbinary').detectBinary;
|
||||
|
||||
suite('detectbinary', function() {
|
||||
var platforms = {
|
||||
mac: {
|
||||
path: __dirname + '/fixtures/product-mac',
|
||||
suffix: '/Contents/MacOS',
|
||||
platform: 'darwin',
|
||||
product: 'firefox'
|
||||
},
|
||||
noBinMac: {
|
||||
path: __dirname + '/fixtures/product-mac-no-bin',
|
||||
suffix: '/Contents/MacOS',
|
||||
platform: 'darwin',
|
||||
product: 'firefox'
|
||||
},
|
||||
linux: {
|
||||
path: __dirname + '/fixtures/product-linux',
|
||||
suffix: '',
|
||||
platform: 'linux-bs',
|
||||
product: 'firefox'
|
||||
},
|
||||
noBinLinux: {
|
||||
path: __dirname + '/fixtures/product-linux-no-bin',
|
||||
suffix: '',
|
||||
platform: 'linux-bs',
|
||||
product: 'firefox'
|
||||
}
|
||||
};
|
||||
|
||||
function fixturePath(fixture, bin) {
|
||||
fsPath.join(
|
||||
fixture.path,
|
||||
fixture.suffix,
|
||||
bin
|
||||
);
|
||||
}
|
||||
|
||||
function verify(name, fixture, bin) {
|
||||
test(name, function(done) {
|
||||
subject(fixture.path, fixture, function(err, path) {
|
||||
if (err) return done(err);
|
||||
assert.equal(fixturePath(fixture, bin));
|
||||
done();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
verify('mac with -bin', platforms.mac, 'firefox-bin');
|
||||
verify('mac without -bin', platforms.noBinMac, 'firefox');
|
||||
verify('linux with -bin', platforms.linux, 'firefox-bin');
|
||||
verify('linux without -bin', platforms.noBinLinux, 'firefox');
|
||||
|
||||
test('missing binary', function(done) {
|
||||
subject(__dirname, { product: 'firefox', bin: 'nothere' }, function(err) {
|
||||
assert.ok(err, 'has error');
|
||||
assert.ok(err.message.indexOf(__dirname) !== 0, 'contains path');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
3
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/env-echoer/echostuff
vendored
Executable file
3
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/env-echoer/echostuff
vendored
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo FOO is $FOO and BAR is $BAR stop
|
||||
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux-no-bin/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux-no-bin/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux/firefox-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux/firefox-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux/foo-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-linux/foo-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac-no-bin/Contents/MacOS/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac-no-bin/Contents/MacOS/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac-no-bin/Contents/MacOS/foo-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac-no-bin/Contents/MacOS/foo-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/firefox
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/firefox-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/firefox-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/foo-bin
vendored
Executable file
0
gaia/tests/jsmarionette/runner/mozilla-runner/test/fixtures/product-mac/Contents/MacOS/foo-bin
vendored
Executable file
13
gaia/tests/jsmarionette/runner/mozilla-runner/test/html/dump.html
Executable file
13
gaia/tests/jsmarionette/runner/mozilla-runner/test/html/dump.html
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>Dump</title>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
dump('\n\n WOOT DUMP \n\n');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
189
gaia/tests/jsmarionette/runner/mozilla-runner/test/run.js
Executable file
189
gaia/tests/jsmarionette/runner/mozilla-runner/test/run.js
Executable file
|
|
@ -0,0 +1,189 @@
|
|||
'use strict';
|
||||
var Static = require('node-static');
|
||||
var assert = require('assert');
|
||||
var profile = require('mozilla-profile-builder');
|
||||
var run = require('../lib/run').run;
|
||||
|
||||
var runtime = __dirname + '/../../../../../firefox';
|
||||
|
||||
'use strict';
|
||||
suite('run', function() {
|
||||
test('launch mulet', function(done) {
|
||||
var options = { product: 'firefox', profile: process.env.PROFILE_FOLDER };
|
||||
this.timeout(5000);
|
||||
run(runtime, options, function(err, child, bin, argv) {
|
||||
assert.ok(!err, err && err.message);
|
||||
|
||||
// verify the binary
|
||||
assert.ok(bin.indexOf('firefox-bin') !== 0, 'has bin');
|
||||
|
||||
// verify arguments
|
||||
assert.deepEqual(
|
||||
argv,
|
||||
['-profile', process.env.PROFILE_FOLDER, '-no-remote']
|
||||
);
|
||||
|
||||
// verify we have a child
|
||||
assert.ok(child.kill, 'is process');
|
||||
child.kill();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('launch mulet with different screen', function(done) {
|
||||
var options =
|
||||
{ product: 'firefox', profile: process.env.PROFILE_FOLDER,
|
||||
screen: {
|
||||
width: 1280,
|
||||
height: 800,
|
||||
dpi: 160
|
||||
}
|
||||
};
|
||||
this.timeout(5000);
|
||||
run(runtime, options, function(err, child, bin, argv) {
|
||||
assert.ok(!err, err && err.message);
|
||||
|
||||
// verify screen size
|
||||
assert.deepEqual(
|
||||
argv,
|
||||
[
|
||||
'-profile', process.env.PROFILE_FOLDER, '--screen=1280x800@160',
|
||||
'-no-remote'
|
||||
]
|
||||
);
|
||||
|
||||
// verify we have a child
|
||||
assert.ok(child.kill, 'is process');
|
||||
child.kill();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('check env overrides', function(done) {
|
||||
// this should not be seen in the child since we are deleting it
|
||||
process.env.BAR = 'bar';
|
||||
var options = {
|
||||
product: 'echostuff',
|
||||
envOverrides: {
|
||||
FOO: 'foo',
|
||||
BAR: null
|
||||
}
|
||||
};
|
||||
var expected = 'FOO is foo and BAR is stop';
|
||||
this.timeout(5000);
|
||||
run(__dirname + '/fixtures/env-echoer', options,
|
||||
function(err, child, bin, argv) {
|
||||
assert.ok(!err, err && err.message);
|
||||
|
||||
child.stdout.on('data', function(content) {
|
||||
content = content.toString();
|
||||
// verify we can go to a given url
|
||||
if (content.indexOf(expected) !== -1) {
|
||||
child.kill();
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('explicit env', function(done) {
|
||||
// this should not be seen in the child since it is using an explicit env.
|
||||
process.env.BAR = 'bar';
|
||||
var options = {
|
||||
product: 'echostuff',
|
||||
env: {
|
||||
FOO: 'foo',
|
||||
}
|
||||
};
|
||||
var expected = 'FOO is foo and BAR is stop';
|
||||
this.timeout(5000);
|
||||
run(__dirname + '/fixtures/env-echoer', options,
|
||||
function(err, child, bin, argv) {
|
||||
assert.ok(!err, err && err.message);
|
||||
|
||||
child.stdout.on('data', function(content) {
|
||||
content = content.toString();
|
||||
if (content.indexOf(expected) !== -1) {
|
||||
child.kill();
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('env is expected default if not specified', function(done) {
|
||||
process.env.FOO = 'foo';
|
||||
process.env.BAR = 'bar';
|
||||
var options = {
|
||||
product: 'echostuff',
|
||||
};
|
||||
var expected = 'FOO is foo and BAR is bar stop';
|
||||
this.timeout(5000);
|
||||
run(__dirname + '/fixtures/env-echoer', options,
|
||||
function(err, child, bin, argv) {
|
||||
assert.ok(!err, err && err.message);
|
||||
|
||||
child.stdout.on('data', function(content) {
|
||||
content = content.toString();
|
||||
if (content.indexOf(expected) !== -1) {
|
||||
child.kill();
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
suite('launch mulet read dump', function() {
|
||||
var server;
|
||||
var port = 60033;
|
||||
var config = {
|
||||
// turn on dump
|
||||
'browser.dom.window.dump.enabled': true
|
||||
};
|
||||
|
||||
// create server
|
||||
setup(function() {
|
||||
var file = new (Static.Server)(__dirname + '/html');
|
||||
server = require('http').createServer(function(req, res) {
|
||||
// stolen from node-Static
|
||||
req.on('end', function() {
|
||||
file.serve(req, res);
|
||||
}).resume();
|
||||
});
|
||||
server.listen(port);
|
||||
});
|
||||
|
||||
// ensure server gets closed
|
||||
teardown(function() {
|
||||
server.close();
|
||||
});
|
||||
|
||||
// create tmp profile
|
||||
var profileDir;
|
||||
setup(function(done) {
|
||||
profile.create({ prefs: config }, function(err, result) {
|
||||
if (err) return done(err);
|
||||
profileDir = result.path;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
var url = 'http://localhost:' + port + '/dump.html';
|
||||
var expected = 'WOOT DUMP';
|
||||
test('go to url', function(done) {
|
||||
var options = { product: 'firefox', profile: profileDir, url: url };
|
||||
run(runtime, options, function(err, child) {
|
||||
if (err) return done(err);
|
||||
child.stdout.on('data', function(content) {
|
||||
content = content.toString();
|
||||
// verify we can go to a given url
|
||||
if (content.indexOf(expected) !== -1) {
|
||||
child.kill();
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue