From f48869601e299ec5c5324c653cbd4f387ef13af2 Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Thu, 12 Feb 2015 17:41:49 +0000 Subject: [PATCH] runat-1128988: Fix isRemote test detection isRemote is a testing flag to allow tests to be skipped if the commands are being run on a remote system. Previously there was some hacky voodoo which (predictably) broken, so now we're explicit about it. We also line up some comments in index.html. Signed-off-by: Joe Walker --- index.html | 4 ++-- lib/gcli/test/index.js | 4 ++-- remote.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 9ca4f09e..e910da16 100644 --- a/index.html +++ b/index.html @@ -34,8 +34,8 @@ system.addItems(demo.items); // Extra demo commands gcli.createTerminal(system).then(function(terminal) { - terminal.language.showIntro(); // Intro text - test.run(terminal); // Run the unit test at each startup + terminal.language.showIntro(); // Intro text + test.run(terminal, false); // Run the unit test at each startup }).then(null, console.error.bind(console)); }); diff --git a/lib/gcli/test/index.js b/lib/gcli/test/index.js index a9ee2f1a..c71ccacf 100644 --- a/lib/gcli/test/index.js +++ b/lib/gcli/test/index.js @@ -69,7 +69,7 @@ var addDebugAids = exports.addDebugAids = function(options) { * - Runs the unit tests automatically on startup * - Registers a 'test' command to re-run the unit tests */ -exports.run = function(terminal) { +exports.run = function(terminal, isRemote) { var options = { terminal: terminal, window: window, @@ -78,7 +78,7 @@ exports.run = function(terminal) { isNode: false, isFirefox: false, isPhantomjs: (window.navigator.userAgent.indexOf('hantom') !== -1), - isRemote: (terminal.system.connection != null), + isRemote: isRemote, hideExec: true }; diff --git a/remote.html b/remote.html index 29530b41..d79a6a0a 100644 --- a/remote.html +++ b/remote.html @@ -30,7 +30,7 @@ var options = { connector: 'websocket' }; cnx.connect(options).then(function(system) { gcli.createTerminal(system).then(function(terminal) { - test.run(terminal); + test.run(terminal, true); }); }).then(null, console.error.bind(console)); });