Permalink
Please sign in to comment.
Browse files
More build and testing cleanup. Also some reorganization.
- Loading branch information...
Showing
with
217 additions
and 931 deletions.
- +1 −0 .gitignore
- +115 −194 Gruntfile.js
- +1 −1 LICENSE
- +4 −13 {src/js → build}/cdn.js
- +11 −0 build/license-header.txt
- +0 −84 build/source-loader.js
- 0 { → build}/tasks/cdn-links.js
- +22 −0 build/tasks/dist-cdn.js
- 0 { → build}/tasks/saucelabs.js
- 0 { → build}/tasks/test.js
- 0 { → build}/tasks/vjs-version.js
- 0 build/demo-files/demo.captions.vtt → docs/examples/shared/example-captions.vtt
- +5 −6 build/demo-files/demo.html → docs/examples/simple-embed/index.html
- +7 −12 package.json
- +11 −5 sandbox/index.html.example
- +2 −2 sandbox/language.html.example
- +2 −2 sandbox/plugin.html.example
- +1 −1 src/css/video-js.less
- +4 −4 src/js/core.js
- +0 −47 tasks/build.js
- +0 −61 tasks/dist-copy.js
- +0 −82 tasks/next-issue.js
- +24 −10 test/{unit → api}/api.js
- +0 −97 test/es6.html
- +0 −97 test/index.html
- +1 −1 test/karma-qunit-shim.js
- +4 −18 test/karma.conf.js
- +0 −48 test/karma.minified.api.conf.js
- +0 −46 test/karma.minified.conf.js
- +0 −63 test/minified-api.html
- +0 −35 test/minified.html
- +1 −1 test/unit/poster.js
- +1 −1 test/unit/test-helpers.js
1
.gitignore
309
Gruntfile.js
2
LICENSE
17
src/js/cdn.js → build/cdn.js
11
build/license-header.txt
@@ -0,0 +1,11 @@ | ||
+/** | ||
+ * @license | ||
+ * Video.js <%= pkg.version %> <http://videojs.com/> | ||
+ * <%= pkg.copyright %> | ||
+ * Available under Apache License Version 2.0 | ||
+ * <https://github.com/videojs/video.js/blob/master/LICENSE> | ||
+ * | ||
+ * Includes vtt.js <https://github.com/mozilla/vtt.js> | ||
+ * Available under Apache License Version 2.0 | ||
+ * <https://github.com/mozilla/vtt.js/blob/master/LICENSE> | ||
+ */ |
84
build/source-loader.js
@@ -1,84 +0,0 @@ | ||
-// This file is used to load the video.js source files into a page | ||
-// in the correct order based on dependencies. | ||
-// When you create a new source file you will need to add | ||
-// it to the list below to use it in sandbox/index.html and | ||
-// test/index.html | ||
- | ||
-// You can use the projectRoot variable to adjust relative urls | ||
-// that this script loads. By default it's "../", which is what /sandbox | ||
-// and /test need. If you had sandbox/newDir/index.html, in index.html you | ||
-// would set projectRoot = "../../" | ||
- | ||
-// We could use somehting like requireJS to load files, and at one point | ||
-// we used goog.require/provide to load dependencies, but that seems like | ||
-// overkill with the small number of files we actually have. | ||
- | ||
-// ADD NEW SOURCE FILES HERE | ||
-var sourceFiles = [ | ||
- "src/js/core.js", | ||
- "src/js/core-object.js", | ||
- "src/js/events.js", | ||
- "src/js/lib.js", | ||
- "src/js/xhr.js", | ||
- "src/js/util.js", | ||
- "src/js/event-emitter.js", | ||
- "src/js/component.js", | ||
- "src/js/button.js", | ||
- "src/js/slider.js", | ||
- "src/js/menu.js", | ||
- "src/js/media-error.js", | ||
- "src/js/fullscreen-api.js", | ||
- "src/js/player.js", | ||
- "src/js/control-bar/control-bar.js", | ||
- "src/js/control-bar/live-display.js", | ||
- "src/js/control-bar/play-toggle.js", | ||
- "src/js/control-bar/time-display.js", | ||
- "src/js/control-bar/fullscreen-toggle.js", | ||
- "src/js/control-bar/progress-control.js", | ||
- "src/js/control-bar/volume-control.js", | ||
- "src/js/control-bar/mute-toggle.js", | ||
- "src/js/control-bar/volume-menu-button.js", | ||
- "src/js/control-bar/playback-rate-menu-button.js", | ||
- "src/js/poster.js", | ||
- "src/js/loading-spinner.js", | ||
- "src/js/big-play-button.js", | ||
- "src/js/error-display.js", | ||
- "src/js/media/media.js", | ||
- "src/js/media/html5.js", | ||
- "src/js/media/flash.js", | ||
- "src/js/media/flash-rtmp.js", | ||
- "src/js/media/loader.js", | ||
- "src/js/tracks/text-track-enums.js", | ||
- "src/js/tracks/text-track.js", | ||
- "src/js/tracks/text-track-list.js", | ||
- "src/js/tracks/text-track-cue-list.js", | ||
- "src/js/tracks/text-track-controls.js", | ||
- "src/js/tracks/text-track-settings.js", | ||
- "src/js/json.js", | ||
- "src/js/setup.js", | ||
- "src/js/plugins.js" | ||
-]; | ||
- | ||
-// Allow overriding the default project root | ||
-var projectRoot = projectRoot || '../'; | ||
- | ||
-function loadScripts(scriptsArr){ | ||
- for (var i = 0; i < scriptsArr.length; i++) { | ||
- // Using document.write because that's the easiest way to avoid triggering | ||
- // asynchrnous script loading | ||
- document.write( "<script src='" + projectRoot + scriptsArr[i] + "'><\/script>" ); | ||
- } | ||
-} | ||
- | ||
-// We use this file in the grunt build script to load the same source file list | ||
-// and don't want to load the scripts there. | ||
-if (typeof blockSourceLoading === 'undefined') { | ||
- loadScripts(sourceFiles); | ||
- | ||
- // Allow for making Flash first | ||
- if (window.location.href.indexOf("?flash") !== -1) { | ||
- // Using doc.write to load this script to, otherwise when it runs videojs | ||
- // is undefined | ||
- document.write('<script>videojs.options.techOrder = ["flash"];videojs.options.flash.swf = "../src/swf/video-js.swf";</script>') | ||
- } | ||
-} |
0
tasks/cdn-links.js → build/tasks/cdn-links.js
File renamed without changes.
22
build/tasks/dist-cdn.js
@@ -0,0 +1,22 @@ | ||
+var uglify = require('uglify-js'); | ||
+ | ||
+module.exports = function(grunt) { | ||
+ grunt.registerTask('dist-cdn', 'Assembling distribution', function(){ | ||
+ var css, jsmin, jsdev, cdnjs; | ||
+ | ||
+ // Replace font urls with CDN versions | ||
+ css = grunt.file.read('dist/cdn/video-js.css'); | ||
+ css = css.replace(/font\//g, '../f/3/'); | ||
+ grunt.file.write('dist/cdn/video-js.css', css); | ||
+ | ||
+ // GA Tracking Pixel (manually building the pixel URL) | ||
+ cdnjs = '\n' + uglify.minify('build/cdn.js').code.replace('v0.0.0', 'v'+ grunt.vjsVersion.full); | ||
+ | ||
+ // Add CDN-specfic JS | ||
+ js = grunt.file.read('dist/cdn/video.js'); | ||
+ grunt.file.write('dist/cdn/video.js', js + cdnjs); | ||
+ | ||
+ jsmin = grunt.file.read('dist/cdn/video.min.js'); | ||
+ grunt.file.write('dist/cdn/video.min.js', jsmin + cdnjs); | ||
+ }); | ||
+} |
0
tasks/saucelabs.js → build/tasks/saucelabs.js
File renamed without changes.
0
tasks/test.js → build/tasks/test.js
File renamed without changes.
0
tasks/vjs-version.js → build/tasks/vjs-version.js
File renamed without changes.
0
build/demo-files/demo.captions.vtt → docs/examples/shared/example-captions.vtt
File renamed without changes.
11
build/demo-files/demo.html → docs/examples/simple-embed/index.html
19
package.json
16
sandbox/index.html.example
4
sandbox/language.html.example
4
sandbox/plugin.html.example
2
src/css/video-js.less
8
src/js/core.js
47
tasks/build.js
@@ -1,47 +0,0 @@ | ||
-module.exports = function(grunt) { | ||
- grunt.registerMultiTask('build', 'Building Source', function(){ | ||
- var vtt, novtt; | ||
- | ||
- // Fix windows file path delimiter issue | ||
- var i = grunt.sourceFiles.length; | ||
- while (i--) { | ||
- grunt.sourceFiles[i] = grunt.sourceFiles[i].replace(/\\/g, '/'); | ||
- } | ||
- | ||
- // Create a combined sources file. https://github.com/zencoder/video-js/issues/287 | ||
- var combined = ''; | ||
- grunt.sourceFiles.forEach(function(result){ | ||
- combined += grunt.file.read(result); | ||
- }); | ||
- // Replace CDN version ref in js. Use major/minor version. | ||
- combined = combined.replace(/GENERATED_CDN_VSN/g, grunt.vjsVersion.majorMinor); | ||
- combined = combined.replace(/GENERATED_FULL_VSN/g, grunt.vjsVersion.full); | ||
- | ||
- vtt = grunt.file.read('node_modules/vtt.js/dist/vtt.js'); | ||
- novtt = combined; | ||
- combined += '\n'+vtt; | ||
- | ||
- grunt.file.write('build/files/combined.video.js', combined); | ||
- grunt.file.write('build/files/combined.video.novtt.js', novtt); | ||
- | ||
- // Copy over other files | ||
- // grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png'); | ||
- grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'build/files/video-js.swf'); | ||
- | ||
- // Inject version number into css file | ||
- var css = grunt.file.read('build/files/video-js.css'); | ||
- css = css.replace(/GENERATED_AT_BUILD/g, grunt.vjsVersion.full); | ||
- grunt.file.write('build/files/video-js.css', css); | ||
- | ||
- // Copy over font files | ||
- grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) { | ||
- // Block .DS_Store files | ||
- if ('filename'.substring(0,1) !== '.') { | ||
- grunt.file.copy(absdir, 'build/files/font/' + filename); | ||
- } | ||
- }); | ||
- | ||
- // Minify CSS | ||
- grunt.task.run(['cssmin']); | ||
- }); | ||
-} |
61
tasks/dist-copy.js
@@ -1,61 +0,0 @@ | ||
-module.exports = function(grunt) { | ||
- grunt.registerTask('dist-copy', 'Assembling distribution', function(){ | ||
- var css, jsmin, jsdev, cdnjs, uglify; | ||
- | ||
- uglify = require('uglify-js'); | ||
- | ||
- // Manually copy each source file | ||
- grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js'); | ||
- grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js'); | ||
- grunt.file.copy('build/files/minified.video.novtt.js', 'dist/video-js/video.novtt.js'); | ||
- grunt.file.copy('build/files/combined.video.novtt.js', 'dist/video-js/video.novtt.dev.js'); | ||
- grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css'); | ||
- grunt.file.copy('build/files/video-js.min.css', 'dist/video-js/video-js.min.css'); | ||
- grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/video-js/video-js.swf'); | ||
- grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html'); | ||
- grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt'); | ||
- grunt.file.copy('src/css/video-js.less', 'dist/video-js/video-js.less'); | ||
- | ||
- | ||
- // Copy over font files | ||
- grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) { | ||
- // Block .DS_Store files | ||
- if ('filename'.substring(0,1) !== '.') { | ||
- grunt.file.copy(absdir, 'dist/video-js/font/' + filename); | ||
- } | ||
- }); | ||
- | ||
- // Copy over language files | ||
- grunt.file.recurse('build/files/lang', function(absdir, rootdir, subdir, filename) { | ||
- // Block .DS_Store files | ||
- if ('filename'.substring(0,1) !== '.') { | ||
- grunt.file.copy(absdir, 'dist/cdn/lang/' + filename); | ||
- grunt.file.copy(absdir, 'dist/video-js/lang/' + filename); | ||
- } | ||
- }); | ||
- | ||
- // ds_store files sometime find their way in | ||
- if (grunt.file.exists('dist/video-js/.DS_Store')) { | ||
- grunt.file['delete']('dist/video-js/.DS_Store'); | ||
- } | ||
- | ||
- // CDN version uses already hosted font files | ||
- // Minified version only, doesn't need demo files | ||
- grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js'); | ||
- grunt.file.copy('build/files/video-js.min.css', 'dist/cdn/video-js.css'); | ||
- grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/cdn/video-js.swf'); | ||
- grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/cdn/demo.captions.vtt'); | ||
- grunt.file.copy('build/demo-files/demo.html', 'dist/cdn/demo.html'); | ||
- | ||
- // Replace font urls with CDN versions | ||
- css = grunt.file.read('dist/cdn/video-js.css'); | ||
- css = css.replace(/font\//g, '../f/3/'); | ||
- grunt.file.write('dist/cdn/video-js.css', css); | ||
- | ||
- // Add CDN-specfic JS | ||
- jsmin = grunt.file.read('dist/cdn/video.js'); | ||
- // GA Tracking Pixel (manually building the pixel URL) | ||
- cdnjs = uglify.minify('src/js/cdn.js').code.replace('v0.0.0', 'v'+ grunt.vjsVersion.full); | ||
- grunt.file.write('dist/cdn/video.js', jsmin + cdnjs); | ||
- }); | ||
-} |
82
tasks/next-issue.js
@@ -1,82 +0,0 @@ | ||
-module.exports = function(grunt) { | ||
- grunt.registerTask('next-issue', 'Get the next issue that needs a response', function(){ | ||
- var done = this.async(); | ||
- var GitHubApi = require('github'); | ||
- var open = require('open'); | ||
- | ||
- var github = new GitHubApi({ | ||
- // required | ||
- version: '3.0.0', | ||
- // optional | ||
- debug: true, | ||
- protocol: 'https', | ||
- // host: 'github.my-GHE-enabled-company.com', | ||
- // pathPrefix: '/api/v3', // for some GHEs | ||
- timeout: 5000 | ||
- }); | ||
- | ||
- github.issues.repoIssues({ | ||
- // optional: | ||
- // headers: { | ||
- // 'cookie': 'blahblah' | ||
- // }, | ||
- user: 'videojs', | ||
- repo: 'video.js', | ||
- sort: 'updated', | ||
- direction: 'asc', | ||
- state: 'open', | ||
- per_page: 100 | ||
- }, function(err, res) { | ||
- var issueToOpen; | ||
- var usersWithWrite = ['heff', 'mmcc']; | ||
- var categoryLabels = ['enhancement', 'bug', 'question', 'feature']; | ||
- | ||
- console.log('Number of issues: '+res.length); | ||
- | ||
- // TODO: Find the best way to exclude an issue where a question has been asked of the | ||
- // issue owner/submitter that hasn't been answerd yet. | ||
- // A stupid simple first step would be to check for the needs: more info label | ||
- // and exactly one comment (the question) | ||
- | ||
- // find issues that need categorizing, no category labels | ||
- res.some(function(issue){ | ||
- if (issue.labels.length === 0) { | ||
- return issueToOpen = issue; // break | ||
- } | ||
- // look for category labels | ||
- var categorized = issue.labels.some(function(label){ | ||
- return categoryLabels.indexOf(label.name) >= 0; | ||
- }); | ||
- if (!categorized) { | ||
- return issueToOpen = issue; // break | ||
- } | ||
- }); | ||
- if (issueToOpen) { | ||
- open(issueToOpen.html_url); | ||
- return done(); | ||
- } | ||
- | ||
- // find issues that need confirming or answering | ||
- res.some(function(issue){ | ||
- // look for confirmed label | ||
- var confirmed = issue.labels.some(function(label){ | ||
- return label.name === 'confirmed'; | ||
- }); | ||
- // Was exluding questions, but that might leave a lot of people hanging | ||
- // var question = issue.labels.some(function(label){ | ||
- // return label.name === 'question'; | ||
- // }); | ||
- if (!confirmed) { // && !question | ||
- return issueToOpen = issue; // break | ||
- } | ||
- }); | ||
- if (issueToOpen) { | ||
- open(issueToOpen.html_url); | ||
- return done(); | ||
- } | ||
- | ||
- grunt.log.writeln('No next issue found'); | ||
- done(); | ||
- }); | ||
- }); | ||
-} |
34
test/unit/api.js → test/api/api.js
97
test/es6.html
@@ -1,97 +0,0 @@ | ||
-<!DOCTYPE HTML> | ||
-<html> | ||
-<head> | ||
- <title>Video.js Test Suite</title> | ||
- | ||
- <!-- Video.js CSS --> | ||
- <link rel="stylesheet" href="../build/files/video-js.css" type="text/css"> | ||
- | ||
- <!-- Sinon --> | ||
- <script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
- <script src="../node_modules/sinon/pkg/sinon-ie.js"></script> | ||
- | ||
- <!-- QUnit --> | ||
- <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" /> | ||
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script> | ||
- | ||
- <script src="../build/files/video-es6.test.js"></script> | ||
- | ||
- <script type="text/javascript"> | ||
- (function(){ | ||
- | ||
- // ADD NEW TEST FILES HERE | ||
- window.tests = [ | ||
- 'test/unit/test-helpers.js', | ||
- 'test/unit/core-object.js', | ||
- 'test/unit/lib.js', | ||
- 'test/unit/util.js', | ||
- 'test/unit/events.js', | ||
- 'test/unit/component.js', | ||
- 'test/unit/button.js', | ||
- 'test/unit/mediafaker.js', | ||
- 'test/unit/player.js', | ||
- 'test/unit/core.js', | ||
- 'test/unit/media.js', | ||
- 'test/unit/media.html5.js', | ||
- 'test/unit/controls.js', | ||
- 'test/unit/poster.js', | ||
- 'test/unit/plugins.js', | ||
- 'test/unit/flash.js', | ||
- 'test/unit/api.js', | ||
- 'test/unit/menu.js', | ||
- 'test/unit/tracks/tracks.js', | ||
- 'test/unit/tracks/text-track.js', | ||
- 'test/unit/tracks/text-track-list.js', | ||
- 'test/unit/tracks/text-track-cue-list.js', | ||
- 'test/unit/tracks/text-track-controls.js', | ||
- 'test/unit/tracks/text-track-settings.js' | ||
- ]; | ||
- | ||
- var projectRoot = '../'; | ||
- var scripts = []; | ||
- | ||
- window.loadScripts = function(scripts) { | ||
- for (var i = 0; i < scripts.length; i++) { | ||
- document.write("<script src='" + projectRoot + scripts[i] + "'><\/script>" ); | ||
- } | ||
- } | ||
- | ||
- // Choose either the raw source and tests | ||
- // Or the compiled source + tests. | ||
- // Use ?comiled to use the compiled tests | ||
- if (QUnit.urlParams.min || QUnit.urlParams.compiled) { | ||
- window.compiled = true; | ||
- } else { | ||
- // Bunyip/Yeti starts tests after it's done loading which can | ||
- // lead to a double Qunit.start error which reads as | ||
- // "Uncaught Error: pushFailure() assertion outside test" | ||
- if (window.$yetify) { | ||
- QUnit.config.autostart = false; | ||
- } | ||
- } | ||
- | ||
- })() | ||
- </script> | ||
- | ||
-</head> | ||
-<body> | ||
- <div> | ||
- <h1 id="qunit-header">Video.js Test Suite</h1> | ||
- <h2 id="qunit-banner"></h2> | ||
- <div id="qunit-testrunner-toolbar"></div> | ||
- <h2 id="qunit-userAgent"></h2> | ||
- <ol id="qunit-tests"></ol> | ||
- <div id="qunit-fixture"></div> | ||
- </div> | ||
- | ||
- <script> | ||
- // Loading tests before the end to give IE time to load vjs before tests | ||
- if (!window.compiled) { | ||
- loadScripts(window.tests); | ||
- } else { | ||
- var compiledTests = "build/files/test.minified.video.js"; | ||
- loadScripts([compiledTests]); | ||
- } | ||
- </script> | ||
-</body> | ||
-</html> |
97
test/index.html
@@ -1,97 +0,0 @@ | ||
-<!DOCTYPE HTML> | ||
-<html> | ||
-<head> | ||
- <title>Video.js Test Suite</title> | ||
- | ||
- <!-- Video.js CSS --> | ||
- <link rel="stylesheet" href="../build/files/video-js.css" type="text/css"> | ||
- | ||
- <!-- Sinon --> | ||
- <script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
- <script src="../node_modules/sinon/pkg/sinon-ie.js"></script> | ||
- | ||
- <!-- QUnit --> | ||
- <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" /> | ||
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script> | ||
- | ||
- <script type="text/javascript"> | ||
- (function(){ | ||
- | ||
- // ADD NEW TEST FILES HERE | ||
- window.tests = [ | ||
- 'test/unit/test-helpers.js', | ||
- 'test/unit/core-object.js', | ||
- 'test/unit/lib.js', | ||
- 'test/unit/util.js', | ||
- 'test/unit/events.js', | ||
- 'test/unit/component.js', | ||
- 'test/unit/button.js', | ||
- 'test/unit/mediafaker.js', | ||
- 'test/unit/player.js', | ||
- 'test/unit/core.js', | ||
- 'test/unit/media.js', | ||
- 'test/unit/media.html5.js', | ||
- 'test/unit/controls.js', | ||
- 'test/unit/poster.js', | ||
- 'test/unit/plugins.js', | ||
- 'test/unit/flash.js', | ||
- 'test/unit/api.js', | ||
- 'test/unit/menu.js', | ||
- 'test/unit/tracks/tracks.js', | ||
- 'test/unit/tracks/text-track.js', | ||
- 'test/unit/tracks/text-track-list.js', | ||
- 'test/unit/tracks/text-track-cue-list.js', | ||
- 'test/unit/tracks/text-track-controls.js', | ||
- 'test/unit/tracks/text-track-settings.js' | ||
- ]; | ||
- | ||
- var projectRoot = '../'; | ||
- var scripts = []; | ||
- | ||
- window.loadScripts = function(scripts) { | ||
- for (var i = 0; i < scripts.length; i++) { | ||
- document.write("<script src='" + projectRoot + scripts[i] + "'><\/script>" ); | ||
- } | ||
- } | ||
- | ||
- // Choose either the raw source and tests | ||
- // Or the compiled source + tests. | ||
- // Use ?comiled to use the compiled tests | ||
- if (QUnit.urlParams.min || QUnit.urlParams.compiled) { | ||
- window.compiled = true; | ||
- } else { | ||
- // Bunyip/Yeti starts tests after it's done loading which can | ||
- // lead to a double Qunit.start error which reads as | ||
- // "Uncaught Error: pushFailure() assertion outside test" | ||
- if (window.$yetify) { | ||
- QUnit.config.autostart = false; | ||
- } | ||
- | ||
- loadScripts(['build/source-loader.js']); | ||
- } | ||
- | ||
- })() | ||
- </script> | ||
- | ||
-</head> | ||
-<body> | ||
- <div> | ||
- <h1 id="qunit-header">Video.js Test Suite</h1> | ||
- <h2 id="qunit-banner"></h2> | ||
- <div id="qunit-testrunner-toolbar"></div> | ||
- <h2 id="qunit-userAgent"></h2> | ||
- <ol id="qunit-tests"></ol> | ||
- <div id="qunit-fixture"></div> | ||
- </div> | ||
- | ||
- <script> | ||
- // Loading tests before the end to give IE time to load vjs before tests | ||
- if (!window.compiled) { | ||
- loadScripts(window.tests); | ||
- } else { | ||
- var compiledTests = "build/files/test.minified.video.js"; | ||
- loadScripts([compiledTests]); | ||
- } | ||
- </script> | ||
-</body> | ||
-</html> |
2
test/karma-qunit-shim.js
22
test/karma.conf.js
48
test/karma.minified.api.conf.js
@@ -1,48 +0,0 @@ | ||
-module.exports = function(config) { | ||
- config.set({ | ||
- frameworks: ['qunit'], | ||
- | ||
- autoWatch: false, | ||
- | ||
- singleRun: true, | ||
- | ||
- files: [ | ||
- '../build/files/video-js.min.css', | ||
- '../test/karma-qunit-shim.js', | ||
- '../node_modules/sinon/pkg/sinon.js', | ||
- '../build/files/minified.video.js', | ||
- '../test/unit/test-helpers.js', | ||
- '../test/unit/api.js' | ||
- ], | ||
- | ||
- plugins: [ | ||
- 'karma-qunit', | ||
- 'karma-chrome-launcher', | ||
- 'karma-firefox-launcher', | ||
- 'karma-ie-launcher', | ||
- 'karma-opera-launcher', | ||
- 'karma-phantomjs-launcher', | ||
- 'karma-safari-launcher' | ||
- ], | ||
- | ||
- // test results reporter to use | ||
- // possible values: 'dots', 'progress', 'junit' | ||
- reporters: ['dots'], | ||
- | ||
- // web server port | ||
- port: 9876, | ||
- | ||
- // cli runner port | ||
- runnerPort: 9100, | ||
- | ||
- // enable / disable colors in the output (reporters and logs) | ||
- colors: true, | ||
- | ||
- // level of logging | ||
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
- logLevel: config.LOG_INFO, | ||
- | ||
- // If browser does not capture in given timeout [ms], kill it | ||
- captureTimeout: 60000 | ||
- }); | ||
-}; |
46
test/karma.minified.conf.js
@@ -1,46 +0,0 @@ | ||
-module.exports = function(config) { | ||
- config.set({ | ||
- frameworks: ['qunit'], | ||
- | ||
- autoWatch: false, | ||
- | ||
- singleRun: true, | ||
- | ||
- files: [ | ||
- '../build/files/video-js.min.css', | ||
- '../test/karma-qunit-shim.js', | ||
- '../node_modules/sinon/pkg/sinon.js', | ||
- '../build/files/test.minified.video.js' | ||
- ], | ||
- | ||
- plugins: [ | ||
- 'karma-qunit', | ||
- 'karma-chrome-launcher', | ||
- 'karma-firefox-launcher', | ||
- 'karma-ie-launcher', | ||
- 'karma-opera-launcher', | ||
- 'karma-phantomjs-launcher', | ||
- 'karma-safari-launcher' | ||
- ], | ||
- | ||
- // test results reporter to use | ||
- // possible values: 'dots', 'progress', 'junit' | ||
- reporters: ['dots'], | ||
- | ||
- // web server port | ||
- port: 9876, | ||
- | ||
- // cli runner port | ||
- runnerPort: 9100, | ||
- | ||
- // enable / disable colors in the output (reporters and logs) | ||
- colors: true, | ||
- | ||
- // level of logging | ||
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
- logLevel: config.LOG_INFO, | ||
- | ||
- // If browser does not capture in given timeout [ms], kill it | ||
- captureTimeout: 60000 | ||
- }); | ||
-}; |
63
test/minified-api.html
@@ -1,63 +0,0 @@ | ||
-<!DOCTYPE HTML> | ||
-<html> | ||
-<head> | ||
- <title>Video.js Test Suite</title> | ||
- | ||
- <!-- Sinon --> | ||
- <script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
- <script src="../node_modules/sinon/pkg/sinon-ie.js"></script> | ||
- | ||
- <!-- QUnit --> | ||
- <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" /> | ||
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script> | ||
- | ||
- <!-- Video.js CSS --> | ||
- <link rel="stylesheet" href="../build/files/video-js.css" type="text/css"> | ||
- | ||
- <!-- LIB COMPILED WITH NOT COMPILED TESTS | ||
- Check publicly available APIs against compiled lib | ||
- --> | ||
- <script type="text/javascript"> | ||
- | ||
- // Test AMD Support | ||
- // window.define = function(a, b){ | ||
- // console.log(a, b); | ||
- // }; | ||
- // define.amd = true; | ||
- | ||
- // Test CJS Support | ||
- // Have to remove qunit and tests to because module becomes a function | ||
- // window.module = window.exports = {}; | ||
- // window.module.exports = {}; | ||
- | ||
- (function(){ | ||
- | ||
- // ADD NEW TEST FILES HERE | ||
- var tests = [ | ||
- 'test/unit/test-helpers.js', | ||
- 'test/unit/api.js' | ||
- ]; | ||
- var projectRoot = '../'; | ||
- var scripts = []; | ||
- | ||
- scripts = scripts.concat(['build/files/minified.video.js'], tests); | ||
- | ||
- for (var i = 0; i < scripts.length; i++) { | ||
- document.write( "<script src='" + projectRoot + scripts[i] + "'><\/script>" ); | ||
- } | ||
- | ||
- })() | ||
- </script> | ||
- | ||
-</head> | ||
-<body> | ||
- <div> | ||
- <h1 id="qunit-header">Video.js Test Suite</h1> | ||
- <h2 id="qunit-banner"></h2> | ||
- <div id="qunit-testrunner-toolbar"></div> | ||
- <h2 id="qunit-userAgent"></h2> | ||
- <ol id="qunit-tests"></ol> | ||
- <div id="qunit-fixture"></div> | ||
- </div> | ||
-</body> | ||
-</html> |
35
test/minified.html
@@ -1,35 +0,0 @@ | ||
-<!DOCTYPE HTML> | ||
-<html> | ||
-<head> | ||
- <title>Video.js Test Suite</title> | ||
- | ||
- <!-- Video.js CSS --> | ||
- <link rel="stylesheet" href="../build/files/video-js.css" type="text/css"> | ||
- | ||
- <!-- Sinon --> | ||
- <script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
- <script src="../node_modules/sinon/pkg/sinon-ie.js"></script> | ||
- | ||
- <!-- QUnit --> | ||
- <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" /> | ||
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script> | ||
- | ||
- <!-- SOURCE COMPILED WITH TESTS | ||
- grunt-contrib-qunit doesn't support query vars, so making this script | ||
- so we can automatically run compiled tests too. | ||
- (in test/index.html you can add ?compiled to also run compiled tests) | ||
- --> | ||
- <script src="../build/files/test.minified.video.js"></script> | ||
- | ||
-</head> | ||
-<body> | ||
- <div> | ||
- <h1 id="qunit-header">Video.js Test Suite</h1> | ||
- <h2 id="qunit-banner"></h2> | ||
- <div id="qunit-testrunner-toolbar"></div> | ||
- <h2 id="qunit-userAgent"></h2> | ||
- <ol id="qunit-tests"></ol> | ||
- <div id="qunit-fixture"></div> | ||
- </div> | ||
-</body> | ||
-</html> |
2
test/unit/poster.js
2
test/unit/test-helpers.js
0 comments on commit
6e5fc8d