Webfonts analyzis (#209)

Add 3 new rules about webfonts
This commit is contained in:
Gaël Métais
2016-12-20 12:16:28 +08:00
committed by GitHub
parent 9898a8424a
commit 5273dfbbf3
24 changed files with 999 additions and 69 deletions
+4 -5
View File
@@ -195,7 +195,7 @@ describe('redownload', function() {
newEntry.weightCheck.uncompressedSize.should.equal(newEntry.weightCheck.bodySize);
newEntry.weightCheck.isCompressed.should.equal(false);
newEntry.weightCheck.headersSize.should.be.above(200).and.below(400);
newEntry.weightCheck.body.toString().should.have.string('1.8.3');
newEntry.weightCheck.bodyBuffer.toString().should.have.string('1.8.3');
done();
})
@@ -226,12 +226,11 @@ describe('redownload', function() {
.then(function(newEntry) {
newEntry.weightCheck.bodySize.should.equal(4193);
newEntry.weightCheck.body.should.equal(fileContent.toString('binary'));
newEntry.weightCheck.bodyBuffer.should.deep.equal(fileContent);
// Opening the image in lwip to check if the format is good
var lwip = require('lwip');
var buffer = new Buffer(newEntry.weightCheck.body, 'binary');
lwip.open(buffer, 'png', function(err, image) {
lwip.open(newEntry.weightCheck.bodyBuffer, 'png', function(err, image) {
image.width().should.equal(620);
image.height().should.equal(104);
done(err);
@@ -312,7 +311,7 @@ describe('redownload', function() {
type: 'html',
contentLength: 999,
weightCheck: {
body: 'blabla',
bodyBuffer: 'blabla',
headersSize: 200,
bodySize: 500,
isCompressed: false,