Merge remote-tracking branch 'origin/master' into wsmonitor-pipeline

pull/248/head
Tim Robinson 2016-02-03 19:06:23 +00:00
commit fd50d42a12
9 zmienionych plików z 76 dodań i 53 usunięć

4
node_modules/architect/architect.js wygenerowano vendored
Wyświetl plik

@ -399,15 +399,17 @@ function checkCycles(config, lookup) {
var pluginsList = plugins.map(function(p) { return p.packagePath; }).join("\n"); var pluginsList = plugins.map(function(p) { return p.packagePath; }).join("\n");
var unresolvedList = Object.keys(unresolved); var unresolvedList = Object.keys(unresolved);
var resolvedList = Object.keys(resolved);
console.warn("Could not resolve dependencies of these plugins:\n" console.warn("Could not resolve dependencies of these plugins:\n"
+ pluginsList + "\n", plugins, + pluginsList + "\n", plugins,
"\nMissing services:\n" + unresolvedList.join("\n") + "\n", unresolved, "\nMissing services:\n" + unresolvedList.join("\n") + "\n", unresolved,
"\nResolved services:", Object.keys(resolved)); "\nResolved services:", resolvedList);
var err = new Error("Could not resolve dependencies\n" var err = new Error("Could not resolve dependencies\n"
+ (unresolvedList.length ? "Missing services: " + unresolvedList + (unresolvedList.length ? "Missing services: " + unresolvedList
: "Config contains cyclic dependencies" // TODO print cycles : "Config contains cyclic dependencies" // TODO print cycles
)); ));
err.unresolved = unresolvedList; err.unresolved = unresolvedList;
err.resolved = resolvedList;
throw err; throw err;
} }

Wyświetl plik

@ -10,8 +10,10 @@ define(function(require, exports, module) {
function formatUser(user) { function formatUser(user) {
if (!user) return {}; // empty traits get ignored if (!user) return {}; // empty traits get ignored
var uid = /^\d+$/.test(user.id) ? user.id : user.uid;
var traits = { var traits = {
uid: user.id, uid: uid,
username: user.name || user.username, username: user.name || user.username,
email: user.email, email: user.email,
createdAt: user.date_add, createdAt: user.date_add,

Wyświetl plik

@ -1,7 +1,7 @@
{ {
"name": "c9", "name": "c9",
"description": "New Cloud9 Client", "description": "New Cloud9 Client",
"version": "3.1.1246", "version": "3.1.1267",
"author": "Ajax.org B.V. <info@ajax.org>", "author": "Ajax.org B.V. <info@ajax.org>",
"private": true, "private": true,
"main": "bin/c9", "main": "bin/c9",
@ -56,7 +56,7 @@
"c9" "c9"
], ],
"c9plugins": { "c9plugins": {
"c9.ide.language": "#197e5eb0d0", "c9.ide.language": "#ad77e2cbd6",
"c9.ide.language.css": "#be07d72209", "c9.ide.language.css": "#be07d72209",
"c9.ide.language.generic": "#a4023db7f6", "c9.ide.language.generic": "#a4023db7f6",
"c9.ide.language.html": "#9be847c0ce", "c9.ide.language.html": "#9be847c0ce",
@ -67,7 +67,7 @@
"c9.ide.language.javascript.tern": "#bf1072b11a", "c9.ide.language.javascript.tern": "#bf1072b11a",
"c9.ide.language.javascript.infer": "#0561c69d67", "c9.ide.language.javascript.infer": "#0561c69d67",
"c9.ide.language.jsonalyzer": "#bf12af3d0a", "c9.ide.language.jsonalyzer": "#bf12af3d0a",
"c9.ide.collab": "#4b93a497cd", "c9.ide.collab": "#1073faea73",
"c9.ide.local": "#a6e689e33b", "c9.ide.local": "#a6e689e33b",
"c9.ide.find": "#e33fbaed2f", "c9.ide.find": "#e33fbaed2f",
"c9.ide.find.infiles": "#c3bf17286d", "c9.ide.find.infiles": "#c3bf17286d",
@ -105,10 +105,10 @@
"c9.ide.recentfiles": "#7c099abf40", "c9.ide.recentfiles": "#7c099abf40",
"c9.ide.remote": "#301d2ab519", "c9.ide.remote": "#301d2ab519",
"c9.ide.processlist": "#2b12cd1bdd", "c9.ide.processlist": "#2b12cd1bdd",
"c9.ide.run": "#53d351200a", "c9.ide.run": "#1a5a660c44",
"c9.ide.run.build": "#0598fff697", "c9.ide.run.build": "#0598fff697",
"c9.ide.run.debug.xdebug": "#9956689819", "c9.ide.run.debug.xdebug": "#9956689819",
"c9.ide.save": "#f8aaf93ea1", "c9.ide.save": "#2de9fd7c2d",
"c9.ide.scm": "#ca3c94b84f", "c9.ide.scm": "#ca3c94b84f",
"c9.ide.terminal.monitor": "#1ccac33b0d", "c9.ide.terminal.monitor": "#1ccac33b0d",
"c9.ide.test": "#a282ec1619", "c9.ide.test": "#a282ec1619",

Wyświetl plik

@ -1764,11 +1764,11 @@ define(function(require, exports, module) {
// Set Gutter Context Menu // Set Gutter Context Menu
if (ui.isChildOf(gutter, target, true)) { if (ui.isChildOf(gutter, target, true)) {
mnuGutter.show(e.x, e.y); mnuGutter.show(e.x, e.y, "context");
} }
// Set main Ace Context Menu // Set main Ace Context Menu
else { else {
mnuAce.show(e.x, e.y); mnuAce.show(e.x, e.y, "context");
} }
return false; return false;
}); });

Wyświetl plik

@ -52,16 +52,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
baseProc: baseProc baseProc: baseProc
}, },
// Mock plugins
{
consumes: ["apf", "ui", "Plugin"],
provides: [
"commands", "menus", "commands", "layout", "watcher",
"save", "anims", "clipboard", "dialog.alert", "auth.bootstrap",
"info", "dialog.error"
],
setup: expect.html.mocked
},
{ {
consumes: ["tabManager", "proc", "terminal"], consumes: ["tabManager", "proc", "terminal"],
provides: [], provides: [],
@ -106,12 +96,12 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
var sessId; var sessId;
it('should open a pane with just an editor', function(done) { it('should open a pane with just an editor', function(done) {
tabs.openEditor("terminal", function(err, tab) { tabs.openEditor("terminal", function(err, tab) {
expect(err).to.not.ok;
expect(tabs.getTabs()).length(1); expect(tabs.getTabs()).length(1);
var doc = tab.document; var doc = tab.document;
doc.on("setTitle", function c1(){ doc.on("setTitle", function c1(){
expect(doc.title) // expect(doc.title).match(new RegExp("^bash - "));
.match(new RegExp("^bash - "));
sessId = doc.getSession().id; sessId = doc.getSession().id;
@ -129,7 +119,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
session.once("connected", function(){ session.once("connected", function(){
doc.once("setTitle", function(){ doc.once("setTitle", function(){
expect(doc.title).to.match(/^bash - /); // expect(doc.title).to.match(/^bash - /);
expect(session.id).to.equal(sessId); expect(session.id).to.equal(sessId);
done(); done();
}); });
@ -139,7 +129,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
session.pty.kill(); session.pty.kill();
}); });
it('should reconnect when the session has been lost', function(done) { it.skip('should reconnect when the session has been lost', function(done) {
var doc = tabs.focussedTab.document; var doc = tabs.focussedTab.document;
var session = doc.getSession(); var session = doc.getSession();
@ -169,8 +159,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
var doc = tab.document; var doc = tab.document;
doc.on("setTitle", function c1(){ doc.on("setTitle", function c1(){
expect(doc.title) // expect(doc.title).match(new RegExp("^bash - "));
.match(new RegExp("^bash - "));
doc.off("setTitle", c1); doc.off("setTitle", c1);
done(); done();
@ -184,9 +173,11 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
var state, info = {}; var state, info = {};
before(function(done) { before(function(done) {
tabs.getTabs()[0].activate(); tabs.getTabs()[0].activate();
tabs.focussedTab.editor.write("ls -l\r"); tabs.focussedTab.editor.write("echo 123\r");
setTimeout(done, 5000); tabs.focussedTab.document.getSession().terminal.once("afterWrite", function() {
}) done();
});
});
it('should retrieve the state', function(done) { it('should retrieve the state', function(done) {
state = tabs.getState(); state = tabs.getState();
@ -214,6 +205,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
var l = info.pages.length; var l = info.pages.length;
expect(tabs.getTabs()).length(l); expect(tabs.getTabs()).length(l);
expect(tabs.getPanes()[0].getTabs()).length(l); expect(tabs.getPanes()[0].getTabs()).length(l);
tabs.getPanes()[0].focus();
expect(tabs.focussedTab.pane.getTabs()).length(l); expect(tabs.focussedTab.pane.getTabs()).length(l);
expect(tabs.getTabs().map(function(tab) { expect(tabs.getTabs().map(function(tab) {
@ -231,7 +223,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
setTimeout(function(){ setTimeout(function(){
done(); done();
}, 2000); });
}); });
if (!onload.remain) { if (!onload.remain) {
it('should reconnect both terminals when doing kill-server', function(done) { it('should reconnect both terminals when doing kill-server', function(done) {
@ -244,7 +236,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
session.off("connected", c0); session.off("connected", c0);
}); });
}) });
tabs.focussedTab.editor.write(String.fromCharCode(2) + ":kill-server\r"); tabs.focussedTab.editor.write(String.fromCharCode(2) + ":kill-server\r");
}); });
@ -269,20 +261,21 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
var id = session.id; var id = session.id;
tabs.focussedTab.unload(); tabs.focussedTab.unload();
setTimeout(function(){
proc.execFile("tmux", {
args: ["list-sessions"]
}, function(err, stdout, stderr) {
// Ignore errors for now
if (err)
throw err.message;
expect(id).is.ok
expect(stdout.indexOf(id) > -1).is.not.ok;
done(); done();
});
}, 3000); // setTimeout(function(){
// proc.execFile("tmux", {
// args: ["list-sessions"]
// }, function(err, stdout, stderr) {
// // Ignore errors for now
// if (err)
// throw err.message;
// expect(id).is.ok
// expect(stdout.indexOf(id) > -1).is.not.ok;
// done();
// });
// }, 3000);
}); });
}); });

Wyświetl plik

@ -946,7 +946,9 @@ define(function(require, exports, module) {
aml.removeChild(item.aml); aml.removeChild(item.aml);
} }
function show(x, y) { function show(x, y, type) {
if (type == "context")
y++;
lastCoords = { x : x, y : y }; lastCoords = { x : x, y : y };
aml.display(x, y); aml.display(x, y);
} }

Wyświetl plik

@ -374,8 +374,8 @@ define(function(require, exports, module) {
function recallVfs() { function recallVfs() {
var vfs; var vfs;
try { try {
vfs = JSON.parse(lastVfs || window.sessionStorage.getItem("vfsid")); vfs = JSON.parse(lastVfs || window.sessionStorage.getItem("vfsid") || null);
if (!lastVfs) { if (!lastVfs && vfs) {
window.sessionStorage.removeItem("vfsid"); window.sessionStorage.removeItem("vfsid");
lastVfs = JSON.stringify(vfs); lastVfs = JSON.stringify(vfs);
} }

Wyświetl plik

@ -248,7 +248,7 @@
mocha.run(done); mocha.run(done);
} }
}; };
onload.remain = onload.remain == "1"; onload.remain = options.remain == "1";
mocha.timeout(10000); mocha.timeout(10000);

Wyświetl plik

@ -489,27 +489,51 @@ require([
x.unregister = function(){}; x.unregister = function(){};
return x; return x;
})(), })(),
"immediate": (function(){
var x = new EventEmitter();
x.register = function(){};
x.unregister = function(){};
return x;
})(),
"c9.analytics": (function(){
var x = new EventEmitter();
x.register = function(){};
x.unregister = function(){};
return x;
})(),
}); });
}; };
expect.setupArchitectTest = function(config, _, options) { expect.setupArchitectTest = function(config, _, options) {
if (options && options.mockPlugins) { if (options && options.mockPlugins) {
config.push({ config.push({
consumes: [], consumes: options.existingPlugins || [],
provides: options.mockPlugins, provides: options.mockPlugins,
setup: expect.html.mocked setup: expect.html.mocked
}); });
} }
architect.resolveConfig(config, function(err, config) { architect.resolveConfig(config, function(err, config) {
/*global describe it before after = */ /*global describe it before after */
if (err) throw err; if (err) throw err;
var app = architect.createApp(config, function(err, app) { var app = architect.createApp(config, function(err, app) {
if (err && err.unresolved && !config.unresolved) { if (err && err.unresolved && !config.unresolved) {
console.warn("Adding mock services for " + err.unresolved); expect.html.mocked({}, {}, function(a, mockServices) {
config.unresolved = err.unresolved; err.missingMock = err.unresolved.filter(function(x) {
return expect.setupArchitectTest(config, architect, { return !mockServices[x];
mockPlugins: config.unresolved
}); });
config.unresolved = err.unresolved.filter(function(x) {
return mockServices[x];
});
});
if (err.missingMock.length) {
console.error("Missing mock services for " + err.missingMock);
} else {
console.warn("Adding mock services for " + err.unresolved);
return expect.setupArchitectTest(config, architect, {
mockPlugins: config.unresolved,
existingPlugins: err.resolved
});
}
} }
if (typeof describe == "function") { if (typeof describe == "function") {
describe('app', function() { describe('app', function() {