Merge pull request #7122 from Snuffleupagus/issue-7117

Allow unit-tests to use linked PDF files, by having the `unittest` command download unavailable ones (issue 7117)
This commit is contained in:
Yury Delendik 2016-03-28 10:19:17 -05:00
commit 27dd386248
2 changed files with 5 additions and 2 deletions

View File

@ -1249,6 +1249,7 @@ target.unittest = function(options, callback) {
echo(); echo();
echo('### Running unit tests'); echo('### Running unit tests');
var PDF_TEST = env['PDF_TEST'] || 'test_manifest.json';
var PDF_BROWSERS = env['PDF_BROWSERS'] || var PDF_BROWSERS = env['PDF_BROWSERS'] ||
'resources/browser_manifests/browser_manifest.json'; 'resources/browser_manifests/browser_manifest.json';
@ -1260,7 +1261,7 @@ target.unittest = function(options, callback) {
callback = callback || function() {}; callback = callback || function() {};
cd('test'); cd('test');
exec('node test.js --unitTest --browserManifestFile=' + exec('node test.js --unitTest --browserManifestFile=' +
PDF_BROWSERS, {async: true}, callback); PDF_BROWSERS + ' --manifestFile=' + PDF_TEST, {async: true}, callback);
}; };
// //

View File

@ -730,7 +730,9 @@ function main() {
} else if (!options.browser && !options.browserManifestFile) { } else if (!options.browser && !options.browserManifestFile) {
startServer(); startServer();
} else if (options.unitTest) { } else if (options.unitTest) {
startUnitTest('/test/unit/unit_test.html', 'unit'); ensurePDFsDownloaded(function() { // Allows linked PDF files in unit-tests.
startUnitTest('/test/unit/unit_test.html', 'unit');
});
} else if (options.fontTest) { } else if (options.fontTest) {
startUnitTest('/test/font/font_test.html', 'font'); startUnitTest('/test/font/font_test.html', 'font');
} else { } else {