Skip to content

Commit 8a1c26c

Browse files
committed
updated devtools timeline (dedicated) url
1 parent 7292902 commit 8a1c26c

4 files changed

Lines changed: 32 additions & 11 deletions

File tree

lib/webpagetest.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ var paths = {
3434
videoCreation: 'video/create.php',
3535
videoView: 'video/view.php',
3636
googleCsi: 'google/google_csi.php',
37-
responseBody: 'response_body.php'
37+
responseBody: 'response_body.php',
38+
timeline: 'getTimeline.php'
3839
};
3940

4041
var filenames = {
4142
pageSpeed: 'pagespeed.txt',
4243
utilization: 'progress.csv',
4344
request: 'IEWTR.txt',
44-
timeline: 'timeline.json',
4545
netLog: 'netlog.txt',
4646
consoleLog: 'console_log.json',
4747
testInfo: 'testinfo.json',
@@ -500,13 +500,13 @@ function getRequestData(id, options, callback) {
500500
}
501501

502502
function getTimelineData(id, options, callback) {
503+
var query;
504+
503505
callback = callback || options;
504506
options = options === callback ? undefined : options;
507+
query = setFilename({test: id}, options, true);
505508

506-
return api.call(this, paths.gzip, callback, {
507-
test: id,
508-
file: setFilename(filenames.timeline, options)
509-
}, options);
509+
return api.call(this, paths.timeline, callback, query, options);
510510
}
511511

512512
function getNetLogData(id, options, callback) {

test/command-line-test.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,20 @@ describe('WebPageTest Command Line', function() {
196196
});
197197
});
198198

199-
it('gets a timeline data input returns the API url', function(done) {
199+
it('gets a timeline data input returns the default API url', function(done) {
200200
exec(mock('timeline 120816_V2_2'), function(err, data) {
201201
if (err) return done(err);
202202
data = JSON.parse(data);
203-
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_timeline.json');
203+
assert.equal(data.url, wptServer + 'getTimeline.php?test=120816_V2_2');
204+
done();
205+
});
206+
});
207+
208+
it('gets a custom timeline data input returns the API url', function(done) {
209+
exec(mock('timeline 120816_V2_2 -r 2 --cached'), function(err, data) {
210+
if (err) return done(err);
211+
data = JSON.parse(data);
212+
assert.equal(data.url, wptServer + 'getTimeline.php?test=120816_V2_2&run=2&cached=1');
204213
done();
205214
});
206215
});

test/dryrun-test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,22 @@ describe('Dry Run', function() {
204204
});
205205
});
206206

207-
it('gets timeline data request', function(done) {
207+
it('gets default timeline data request', function(done) {
208208
wpt.getTimelineData('120816_V2_2', {dryRun: true}, function (err, data) {
209209
if (err) return done(err);
210-
assert.equal(data.url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_timeline.json');
210+
assert.equal(data.url, wptServer + 'getTimeline.php?test=120816_V2_2');
211+
done();
212+
});
213+
});
214+
215+
it('gets custom timeline data request', function(done) {
216+
wpt.getTimelineData('120816_V2_2', {
217+
run: 2,
218+
cached: true,
219+
dryRun: true
220+
}, function (err, data) {
221+
if (err) return done(err);
222+
assert.equal(data.url, wptServer + 'getTimeline.php?test=120816_V2_2&run=2&cached=1');
211223
done();
212224
});
213225
});

test/helpers/nock-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var reqResMap = {
2222
'/export.php?test=120816_V2_2': 'har.json',
2323
'/getgzip.php?test=120816_V2_2&file=1_progress.csv': 'utilization.csv',
2424
'/getgzip.php?test=120816_V2_2&file=1_IEWTR.txt': 'request.txt',
25-
'/getgzip.php?test=120816_V2_2&file=1_timeline.json': 'timeline.json',
25+
'/getTimeline.php?test=120816_V2_2': 'timeline.json',
2626
'/getgzip.php?test=120816_V2_2&file=1_netlog.txt': 'netLog.txt',
2727
'/getgzip.php?test=120816_V2_2&file=1_console_log.json': 'consoleLog.json',
2828
'/getgzip.php?test=120816_V2_2&file=testinfo.json': 'testInfo.json',

0 commit comments

Comments
 (0)