Add getStats unit test

Since some Telemetry data depends on `getStats`, having a unit test should make it more diffucult to accidentally break this without noticing.
This commit is contained in:
Jonas Jenwald 2014-08-30 22:12:34 +02:00
parent 8042a4b783
commit fb7489ffd0

View File

@ -1,6 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor */ /* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor,
isArray */
'use strict'; 'use strict';
@ -141,6 +142,13 @@ describe('api', function() {
expect(data.length).toEqual(105779); expect(data.length).toEqual(105779);
}); });
}); });
it('gets stats', function() {
var promise = doc.getStats();
waitsForPromise(promise, function (stats) {
expect(isArray(stats.streamTypes)).toEqual(true);
expect(isArray(stats.fontTypes)).toEqual(true);
});
});
}); });
describe('Page', function() { describe('Page', function() {
var resolvePromise; var resolvePromise;