Skip to content

Commit

Permalink
Revert gatherer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Jul 28, 2016
1 parent a8c5602 commit b313795
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
7 changes: 3 additions & 4 deletions lighthouse-core/driver/gatherers/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ class ScreenshotFilmstrip extends Gather {
}

afterPass(options, tracingData) {
return this.getScreenshots(tracingData.traceContents)
.then(screenshots => {
this.artifact = screenshots;
});
return this.getScreenshots(tracingData.traceContents).then(screenshots => {
this.artifact = screenshots;
});
}
}

Expand Down
16 changes: 8 additions & 8 deletions lighthouse-core/driver/gatherers/speedline.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const Gather = require('./gather');
const speedline = require('speedline');

class Speedline extends Gather {

afterPass(options, tracingData) {
return speedline(tracingData.traceContents)
.then(results => {
this.artifact = results;
}).catch(err => {
this.artifact = {
debugString: err.message
};
});
return speedline(tracingData.traceContents).then(results => {
this.artifact = results;
}).catch(err => {
this.artifact = {
debugString: err.message
};
});
}
}

Expand Down
4 changes: 1 addition & 3 deletions lighthouse-core/test/driver/gatherers/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ describe('Screenshot gatherer', () => {
// Currently this test must rely on knowing the phase hook for the gatherer.
// A little unfortunate, but we need a "run scheduler with this gatherer, this mocked driver,
// and this trace" test class to do that right
return screenshotsGather.afterPass(undefined, {
traceContents: traceData
}).then(_ => {
return screenshotsGather.afterPass(undefined, {traceContents: traceData}).then(_ => {
assert.ok(Array.isArray(screenshotsGather.artifact));
assert.equal(screenshotsGather.artifact.length, 7);

Expand Down
4 changes: 1 addition & 3 deletions lighthouse-core/test/driver/gatherers/speedline.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ describe('Speedline gatherer', () => {
it('returns an error debugString on faulty trace data', done => {
const speedlineGather = new SpeedlineGather();

speedlineGather.afterPass({}, {
traceContents: {boo: 'ya'}
}).then(_ => {
speedlineGather.afterPass({}, {traceContents: {boo: 'ya'}}).then(_ => {
assert.ok(speedlineGather.artifact.debugString);
assert.ok(speedlineGather.artifact.debugString.length);
done();
Expand Down

0 comments on commit b313795

Please sign in to comment.