Skip to content

Commit

Permalink
removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelduran committed Nov 7, 2012
1 parent b580a69 commit b9daa19
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 106 deletions.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------- WebPagetest (http://code.google.com/p/webpagetest/) -------------

Copyright (c) 2005-2010, AOL, LLC. All rights reserved.
Copyrights licensed under the BSD License.
Copyrights licensed under the BSD License.

-------------- node-jsonml (http://github.com/raszi/node-jsonml) ---------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ $ webpagetest locations

#### 2. Run test on http://twitter.com/marcelduran from San Jose on IE9
```bash
$ webpagetest test http://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9
$ webpagetest test http://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9
```
```javascript
{
Expand Down
18 changes: 9 additions & 9 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ function parseNumber(s) {
if (typeof s !== 'string' || !reNumber.test(s) || reInvalidDec.test(s)) {
return s;
}

return reDec.test(s) ? parseFloat(s, 10) : parseInt(s, 10);
}

function xmlToObj(xml) {
var obj = {},

rec = function xmlToObjRecursion(a, o) {
var val, newObj, i,
len = a.length;

if (len === 2) {
if (typeof a[1] !== 'object') {
o[a[0]] = parseNumber(a[1]);
Expand All @@ -54,17 +54,17 @@ function xmlToObj(xml) {
}
}
};

rec(jsonml.parse(xml), obj);

return obj;
}

function svToObj(delimiter, headers, sv) {
var data,
start = 0,
obj = {};

delimiter = delimiter || ',';

if (!sv) {
Expand All @@ -84,19 +84,19 @@ function svToObj(delimiter, headers, sv) {
if (data[0].split(delimiter)[3] === 'IP Address') {
start = 2;
}

headers.forEach(function headersEach(header) {
obj[header] = [];
});

data.slice(start).forEach(function dataEach(row) {
row.split(delimiter).forEach(function rowEach(value, index) {
if (headers[index]) {
obj[headers[index]].push(parseNumber(value));
}
});
});

return obj;
}

Expand Down
40 changes: 20 additions & 20 deletions test/command-line-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function mock(command) {

vows.describe('Command Line').addBatch({
'A WebPageTest Command Line': {

'gets a test status input': {
topic: function() {
exec(mock('status 120816_V2_2'), this.callback);
Expand All @@ -32,7 +32,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'testStatus.php?test=120816_V2_2');
}
},

'gets a test results input': {
topic: function() {
exec(mock('results 120816_V2_2'), this.callback);
Expand All @@ -43,7 +43,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'xmlResult.php?test=120816_V2_2');
}
},

'gets the locations list input ': {
topic: function() {
exec(mock('locations'), this.callback);
Expand All @@ -54,7 +54,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getLocations.php');
}
},

'gets a simple test input ': {
topic: function() {
exec(mock('test http://foobar.com'), this.callback);
Expand All @@ -65,7 +65,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'runtest.php?url=http%3A%2F%2Ffoobar.com&f=json');
}
},

'gets a custom test input ': {
topic: function() {
exec(mock(
Expand All @@ -85,7 +85,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'runtest.php?url=http%3A%2F%2Ftwitter.com%2Fmarcelduran&location=Local_Firefox_Chrome%3AChrome&runs=3&fvonly=1&label=test%20123&pngss=1&timeline=1&netlog=1&f=json');
}
},

'gets a script test input ': {
topic: function() {
var script = WebPageTest.scriptToString([
Expand All @@ -107,7 +107,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'runtest.php?script=logData%090%0Anavigate%09http%3A%2F%2Ffoo.com%2Flogin%0A%2F%2F%20log%20some%20data%0AlogData%091%0AsetValue%09name%3Dusername%09johndoe%0AsetValue%09name%3Dpassword%0912345%0AsubmitForm%09action%3Dhttp%3A%2F%2Ffoo.com%2Fmain%0AwaitForComplete&f=json');
}
},

'gets a script file test input ': {
topic: function() {
var filename = path.join(__dirname, './fixtures/script.txt');
Expand All @@ -120,7 +120,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'runtest.php?script=logData%090%0Anavigate%09http%3A%2F%2Ffoo.com%2Flogin%0A%2F%2F%20log%20some%20data%0AlogData%091%0AsetValue%09name%3Dusername%09johndoe%0AsetValue%09name%3Dpassword%0912345%0AsubmitForm%09action%3Dhttp%3A%2F%2Ffoo.com%2Fmain%0AwaitForComplete%0A&f=json');
}
},

'gets a cancel test input': {
topic: function() {
exec(mock('cancel 120816_V2_2'), this.callback);
Expand All @@ -131,7 +131,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'cancelTest.php?test=120816_V2_2');
}
},

'gets page speed data input ': {
topic: function() {
exec(mock('pagespeed 120816_V2_2'), this.callback);
Expand All @@ -142,7 +142,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_pagespeed.txt');
}
},

'gets HAR data input ': {
topic: function() {
exec(mock('har 120816_V2_2'), this.callback);
Expand All @@ -153,7 +153,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'export.php?test=120816_V2_2');
}
},

'gets utilization data input ': {
topic: function() {
exec(mock('utilization 120816_V2_2'), this.callback);
Expand All @@ -164,7 +164,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_progress.csv');
}
},

'gets request data input ': {
topic: function() {
exec(mock('request 120816_V2_2'), this.callback);
Expand All @@ -175,7 +175,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_IEWTR.txt');
}
},

'gets timeline data input ': {
topic: function() {
exec(mock('timeline 120816_V2_2'), this.callback);
Expand All @@ -186,7 +186,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_timeline.json');
}
},

'gets net log data input ': {
topic: function() {
exec(mock('netlog 120816_V2_2'), this.callback);
Expand All @@ -197,7 +197,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_netlog.txt');
}
},

'gets console log data input ': {
topic: function() {
exec(mock('console 120816_V2_2'), this.callback);
Expand All @@ -208,7 +208,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_console_log.json');
}
},

'gets a waterfall image input ': {
topic: function() {
exec(mock('waterfall 120816_V2_2'), this.callback);
Expand All @@ -219,7 +219,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'waterfall.php?test=120816_V2_2&run=1&cached=0');
}
},

'gets a waterfall thumbnail input ': {
topic: function() {
exec(mock('waterfall 120816_V2_2 --thumbnail'), this.callback);
Expand All @@ -230,7 +230,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'thumbnail.php?test=120816_V2_2&run=1&cached=0&file=1_waterfall.png');
}
},

'gets a screenshot input ': {
topic: function() {
exec(mock('screenshot 120816_V2_2'), this.callback);
Expand All @@ -241,7 +241,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_screen.jpg');
}
},

'gets a screenshot thumbnail input ': {
topic: function() {
exec(mock('screenshot 120816_V2_2 --thumbnail'), this.callback);
Expand All @@ -252,7 +252,7 @@ vows.describe('Command Line').addBatch({
assert.equal(data.url, wptServer + 'thumbnail.php?test=120816_V2_2&file=1_screen.jpg&run=1&cached=0');
}
},

'gets a screenshot in full resolution input ': {
topic: function() {
exec(mock('screenshot 120816_V2_2 --full'), this.callback);
Expand Down
Loading

0 comments on commit b9daa19

Please sign in to comment.