Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
runat-1128988: Fix isRemote test detection
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
joewalker committed Feb 12, 2015
1 parent 7127930 commit f488696
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions lib/gcli/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
};

Expand Down
2 changes: 1 addition & 1 deletion remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down

1 comment on commit f488696

@joewalker
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code doesn't reach mozilla-central. No need for review.

Please sign in to comment.