Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove dead code around old urlQueue.
  • Loading branch information
reid committed Feb 26, 2013
1 parent 8294dd0 commit 33f8e2c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
3 changes: 1 addition & 2 deletions lib/hub/agent.js
Expand Up @@ -38,7 +38,6 @@ function Agent(allAgents, registration) {
this.seen = new Date();
this.connected = true;

this.dispatchedTests = 0;
this.target = null;
this.currentUrl = null;

Expand Down Expand Up @@ -229,7 +228,7 @@ Agent.prototype.removeTarget = function () {

/**
* Get the value for the next URL,
* removing it from `this.urlQueue`.
* removing it from the Target's queue.
*
* Fires our complete event when no more
* URLs are in the queue, then returns
Expand Down
19 changes: 0 additions & 19 deletions lib/hub/target.js
Expand Up @@ -33,7 +33,6 @@ function Target(allAgents, agents) {
this.testSpec = null;
this.nullTests = new NullTests.createForMountpoint(allAgents.hub.mountpoint);
this.tests = this.nullTests;
this.urlQueue = [];

this.debug("Setup agentEmitter for", agents);
this.agentEmitter = new EventYoshi();
Expand Down Expand Up @@ -144,16 +143,6 @@ Target.prototype.nextURL = function (agentId) {
return this.tests.next().getUrlForAgentId(agentId);
};

/**
* Determine if this Target has tests ready to run.
*
* @method hasTests
* @return {Boolean} True if tests are available, false otherwise.
*/
Target.prototype.hasTests = function () {
return !!this.urlQueue.length;
};

/**
* Set the URL queue to the given URL array
* and advance the browser to the first test.
Expand All @@ -165,15 +154,7 @@ Target.prototype.hasTests = function () {
Target.prototype.dispatch = function (batchId, testSpec) {
this.batchId = batchId;
this.testSpec = testSpec;

var urls = testSpec.createURLs();

// TODO: Remove these
this.dispatchedTests = urls.length;
this.urlQueue = urls;
// END TODO
this.tests = testSpec.createTests();

this.debug("Emit dispatch for batchId", batchId);
this.emit("dispatch", batchId);

Expand Down
31 changes: 0 additions & 31 deletions lib/hub/test-specification.js
Expand Up @@ -66,37 +66,6 @@ TestSpecification.prototype.getTimeoutMilliseconds = function () {
return this.timeout * 1000;
};

/**
* Creates an array of tests for a Target.
*
* TODO: This should create Test objects for the Target
* that can retain test results.
*
* @method createURLs
* @return {String[]} Array of URLs.
*/
TestSpecification.prototype.createURLs = function () {
var urls = [],
query = this.query;

if (query) {
query = "?" + query;
} else {
query = "";
}

if (this.useProxy) {
this.tests.forEach(function (test) {
urls.push(test + query);
});
} else {
// Get a copy of the tests, not a reference.
urls = this.tests.slice();
}

return urls;
};

TestSpecification.prototype.createTests = function () {
return new Tests(this);
};
Expand Down

0 comments on commit 33f8e2c

Please sign in to comment.