Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/blizzard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Blizzard.prototype.createSession = function (socket, instigator) {
* @protected
*/
Blizzard.prototype.onClientUpgrade = function (cb, req, socket) {
//this.emit("connect", socket);
cb(null, this.createSession(socket, true));
};

Expand All @@ -85,9 +84,6 @@ Blizzard.prototype.onClientUpgrade = function (cb, req, socket) {
* @protected
*/
Blizzard.prototype.serverUpgrade = function (req, socket) {
// console.log("Recieved upgrade.");
// console.log("Headers =", req.headers);

var self = this,
version = req.headers["sec-blizzard-version"];

Expand Down
3 changes: 2 additions & 1 deletion lib/hub/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var TestSpecification = require("./test-specification");
var TestServer = require("./http/test-server");

var WebDriverCollection = require("./webdriver-collection");
var path = require("path");

/**
* A Batch represents a collection of tests on the Hub.
Expand Down Expand Up @@ -319,7 +320,7 @@ Batch.prototype.handleFileRequest = function (server, agentId, filename) {
}

fileInBatch = batch.spec.tests.some(function (test) {
return test === filename;
return path.normalize(test) === path.normalize(filename);
});

this.getFile(filename, function (err, buffer) {
Expand Down
1 change: 0 additions & 1 deletion lib/hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ Hub.prototype._onTowerConnection = function (socket) {

client.on("register", function (message) {
var id = message.agentId;

if (!id || id === "undefined") {
client.emit("error", "ID required");
}
Expand Down
3 changes: 2 additions & 1 deletion lib/hub/null-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var util = require("util");

var Test = require("./test");
var path = require("path");

/**
* NullTest represents the absence of a Test.
Expand Down Expand Up @@ -34,7 +35,7 @@ util.inherits(NullTest, Test);
* @return {String} Relative URL for the capture page, relative to the mountpoint.
*/
NullTest.prototype.getUrlForAgentId = function (agentId) {
return this.mountpoint + "agent/" + agentId;
return this.mountpoint + "agent" + path.sep + agentId;
};

/**
Expand Down
7 changes: 4 additions & 3 deletions lib/hub/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";

var path = require("path");
/**
* @module test
*/
Expand Down Expand Up @@ -34,9 +35,9 @@ function Test(options) {
*/
Test.prototype.getUrlForAgentId = function (agentId) {
var url = this.mountpoint;
url += "agent/" + agentId;
url += "/batch/" + this.batchId;
url += "/test/" + this.location;
url += "agent" + path.sep + agentId;
url += path.sep + "batch" + path.sep + this.batchId;
url += path.sep + "test" + path.sep + this.location;
if (this.query) { url += "?" + this.query; }
return url;
};
Expand Down
6 changes: 3 additions & 3 deletions lib/hub/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var Test = require("./test");
var LiteralTest = require("./literal-test");
var NullTest = require("./null-test");
var path = require("path");

/**
* Tests represent a collection of Test objects.
Expand Down Expand Up @@ -47,9 +48,9 @@ Tests.prototype.getByUrl = function (url) {
location;

for (; index < length; index += 1) {
location = locations[index];
location = path.normalize(locations[index]);

if (url.indexOf(location) !== -1) {
if (path.normalize(url).indexOf(location) !== -1) {
return this.children[location];
}
}
Expand Down Expand Up @@ -114,7 +115,6 @@ Tests.prototype.initializeFromSpecification = function (spec) {
options.query = spec.query;
options.mountpoint = self.mountpoint;
}

self.children[location] = new TestCtor(options);
});
};
Expand Down
12 changes: 7 additions & 5 deletions lib/hub/url-builder.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
"use strict";

var path = require("path");

module.exports = function makeURLFromComponents(mountpoint, agentId, batchId, test) {
var url = mountpoint;

if (url !== "/") {
if (url !== path.sep) {
// XXX So hacky.
url += "/";
url += path.sep;
}

url += "agent/" + agentId;
url += "agent" + path.sep + agentId;

if (test && batchId) {
// XXX if test is true,
// batchId should always be set
url += "/batch/" + batchId;
url += "/test/" + test;
url += path.sep + "batch" + path.sep + batchId;
url += path.sep + "test" + path.sep + test;
}

return url;
Expand Down