summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-09-17 22:58:49 +0200
committerJose <jose@zeroc.com>2015-09-17 22:58:49 +0200
commitfd91507e8cfdc85eeed3e697123db15b1761f194 (patch)
tree9ecc2e6260b972ca2192ad862c22f9aafedc8415 /js
parentMissing js:ice-build metadata (diff)
downloadice-fd91507e8cfdc85eeed3e697123db15b1761f194.tar.bz2
ice-fd91507e8cfdc85eeed3e697123db15b1761f194.tar.xz
ice-fd91507e8cfdc85eeed3e697123db15b1761f194.zip
Update for JS browser test suite server languages
Diffstat (limited to 'js')
-rw-r--r--js/.gitignore2
-rw-r--r--js/bin/HttpServer.js1
-rw-r--r--js/gulpfile.js17
-rw-r--r--js/test/Common/TestSuite.js42
-rw-r--r--js/test/Common/index.html3
5 files changed, 45 insertions, 20 deletions
diff --git a/js/.gitignore b/js/.gitignore
index fb98c16d8a2..b5266448959 100644
--- a/js/.gitignore
+++ b/js/.gitignore
@@ -2,7 +2,7 @@ bower_components
lib
node_modules
npm-debug.log
-
+server-languages.json
# Licnese files which are coppied in during prepublish
ICE_LICENSE
LICENSE
diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js
index 5a7239e2cb8..7dd5a2241ce 100644
--- a/js/bin/HttpServer.js
+++ b/js/bin/HttpServer.js
@@ -34,6 +34,7 @@ function Init()
html: "text/html",
ico: "image/x-icon",
js: "text/javascript",
+ json: "application/json",
};
var libraries = ["/lib/Ice.js", "/lib/Ice.min.js",
diff --git a/js/gulpfile.js b/js/gulpfile.js
index c8d75ac5402..7417cef61a2 100644
--- a/js/gulpfile.js
+++ b/js/gulpfile.js
@@ -373,17 +373,26 @@ gulp.task("watch", ["test:watch"].concat(useBinDist ? [] : ["dist:watch"]));
gulp.task("test:run-with-browser", ["watch"].concat(useBinDist ? ["test"] : ["build"]),
function(){
+ var serverLanguages =
+ {
+ languages: [{value: "cpp", name: "C++"}, {value: "java", name: "Java"}]
+ };
+ if(process.platform == "win32")
+ {
+ serverLanguages.languages.push({value: "csharp", name: "C#"});
+ }
+ fs.writeFileSync("server-languages.json", JSON.stringify(serverLanguages, null, 4));
require("./bin/HttpServer")();
var p = require("child_process").spawn("python", ["../scripts/TestController.py"], {stdio: "inherit"});
- process.on(process.platform == "win32" ? "SIGBREAK" : "SIGINT",
+ process.on(process.platform == "win32" ? "SIGBREAK" : "SIGINT",
function()
{
process.exit();
});
process.on("exit", function()
{
- p.kill();
+ p.kill();
});
return gulp.src("./test/Ice/acm/index.html")
.pipe(open("", {url: "http://127.0.0.1:8080/test/Ice/acm/index.html"}));
@@ -392,14 +401,14 @@ gulp.task("test:run-with-browser", ["watch"].concat(useBinDist ? ["test"] : ["bu
gulp.task("test:run-with-node", (useBinDist ? ["test"] : ["build"]),
function(){
var p = require("child_process").spawn("python", ["allTests.py", "--all"], {stdio: "inherit"});
- process.on(process.platform == "win32" ? "SIGBREAK" : "SIGINT",
+ process.on(process.platform == "win32" ? "SIGBREAK" : "SIGINT",
function()
{
process.exit();
});
process.on("exit", function()
{
- p.kill();
+ p.kill();
});
});
diff --git a/js/test/Common/TestSuite.js b/js/test/Common/TestSuite.js
index c77eb61c1a6..7d1d38576c4 100644
--- a/js/test/Common/TestSuite.js
+++ b/js/test/Common/TestSuite.js
@@ -263,6 +263,35 @@ $(document).ready(
}
$("#test").val("/test/" + current + "/index.html");
+ var nextLanguage;
+ $.ajax(
+ {
+ url: "/server-languages.json",
+ dataType: "json"
+ }
+ ).done(
+ function(data)
+ {
+ data.languages.forEach(
+ function(lang)
+ {
+ $("#language").append("<option value=\"" + lang.value + "\">" + lang.name + "</option>");
+ });
+
+ nextLanguage = function(language)
+ {
+ var i = 0;
+ for(; i < data.languages.length; ++i)
+ {
+ if(data.languages[i].value == language)
+ {
+ break;
+ }
+ }
+ return data.languages[i < data.languages.length - 1 ? i + 1 : 0].value;
+ };
+ });
+
var out =
{
write: function(msg)
@@ -441,18 +470,7 @@ $(document).ready(
protocol = "ws";
href = href.replace("https", "http");
href = href.replace("9090", "8080");
- if(language == "cpp")
- {
- language = "java";
- }
- else if(language == "java")
- {
- language = "csharp";
- }
- else
- {
- language = "cpp";
- }
+ language = nextLanguage(language);
}
}
diff --git a/js/test/Common/index.html b/js/test/Common/index.html
index adc6ef5400d..fb26feb2447 100644
--- a/js/test/Common/index.html
+++ b/js/test/Common/index.html
@@ -53,9 +53,6 @@
</div>
<div class="small-9 columns">
<select id="language">
- <option value="cpp">C++</option>
- <option value="java">Java</option>
- <option value="csharp">C#</option>
</select>
</div>
</div>