forked from videojs/video.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Travis CI config, and also supporting package.json.
Removed flwplayer folder. Added phantomjs for Travis CI test running, including temp makefile.
- Loading branch information
Showing
11 changed files
with
144 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
dist/* | ||
dev.html | ||
projects | ||
.zenflow-log | ||
.zenflow-log | ||
|
||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
{ | ||
"validthis": true, | ||
"laxcomma" : true, | ||
"laxbreak" : true, | ||
"browser" : true, | ||
"eqnull" : true, | ||
"debug" : true, | ||
"devel" : true, | ||
"boss" : true, | ||
"expr" : true, | ||
"asi" : true | ||
"eqnull" : true, | ||
"quotmark" : "double", | ||
"sub" : true, | ||
"trailing" : true, | ||
"undef" : true, | ||
"predef" : [ // Extra globals. | ||
"_V_", | ||
"VideoJS" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- 0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Using makefile temporarily to run tests on Travis CI | ||
|
||
test: | ||
# jshint src/*.js --config .jshintrc | ||
node test/server.js & | ||
phantomjs test/phantom.js "http://localhost:3000/test/unit.html" | ||
kill -9 `cat test/pid.txt` | ||
rm test/pid.txt | ||
|
||
.PHONY: test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "Video.js" | ||
, "description": "An HTML5 and Flash video player with a common API and skin for both." | ||
, "version": "3.2.3" | ||
, "keywords": ["html5", "flash", "video", "player"] | ||
, "homepage": "http://videojs.com" | ||
, "author": "Steve Heffernan" | ||
, "scripts": { "test": "make test" } | ||
, "repository": { | ||
"type": "git" | ||
, "url": "https://github.com/zencoder/video-js.git" | ||
} | ||
, "devDependencies": { | ||
, "jshint": "0.6.1" | ||
, "connect": "2.1.3" | ||
, "phantomjs": "1.7.0" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Simple phantom.js integration script | ||
// Adapted from Modernizr & Bootstrap | ||
|
||
function waitFor(testFx, onReady, timeOutMillis) { | ||
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5001 //< Default Max Timout is 5s | ||
, start = new Date().getTime() | ||
, condition = false | ||
, interval = setInterval(function () { | ||
if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) { | ||
// If not time-out yet and condition not yet fulfilled | ||
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code | ||
} else { | ||
if (!condition) { | ||
// If condition still not fulfilled (timeout but condition is 'false') | ||
console.log("'waitFor()' timeout") | ||
phantom.exit(1) | ||
} else { | ||
// Condition fulfilled (timeout and/or condition is 'true') | ||
typeof(onReady) === "string" ? eval(onReady) : onReady() //< Do what it's supposed to do once the condition is fulfilled | ||
clearInterval(interval) //< Stop this interval | ||
} | ||
} | ||
}, 100) //< repeat check every 100ms | ||
} | ||
|
||
|
||
if (phantom.args.length === 0 || phantom.args.length > 2) { | ||
console.log('Usage: phantom.js URL') | ||
phantom.exit() | ||
} | ||
|
||
var page = new WebPage() | ||
|
||
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") | ||
page.onConsoleMessage = function(msg) { | ||
console.log(msg) | ||
}; | ||
|
||
page.open(phantom.args[0], function(status){ | ||
if (status !== "success") { | ||
console.log("Unable to access network") | ||
phantom.exit() | ||
} else { | ||
waitFor(function(){ | ||
return page.evaluate(function(){ | ||
var el = document.getElementById('qunit-testresult') | ||
if (el && el.innerText.match('completed')) { | ||
return true | ||
} | ||
return false | ||
}) | ||
}, function(){ | ||
var failedNum = page.evaluate(function(){ | ||
var el = document.getElementById('qunit-testresult') | ||
try { | ||
return el.getElementsByClassName('failed')[0].innerHTML | ||
} catch (e) { } | ||
return 10000 | ||
}); | ||
phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Simple connect server for phantom.js | ||
* Adapted from Modernizr & Bootstrap | ||
*/ | ||
|
||
var connect = require('connect') | ||
, http = require('http') | ||
, fs = require('fs') | ||
, app = connect() | ||
.use(connect.static(__dirname + '/../')); | ||
|
||
http.createServer(app).listen(3000); | ||
|
||
fs.writeFileSync(__dirname + '/pid.txt', process.pid, 'utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Logging setup for phantom integration | ||
// adapted from Modernizr & Bootstrap | ||
|
||
QUnit.begin = function () { | ||
console.log("Starting test suite") | ||
console.log("================================================\n") | ||
} | ||
|
||
QUnit.moduleDone = function (opts) { | ||
if (opts.failed === 0) { | ||
console.log("\u2714 All tests passed in '" + opts.name + "' module") | ||
} else { | ||
console.log("\u2716 " + opts.failed + " tests failed in '" + opts.name + "' module") | ||
} | ||
} | ||
|
||
QUnit.done = function (opts) { | ||
console.log("\n================================================") | ||
console.log("Tests completed in " + opts.runtime + " milliseconds") | ||
console.log(opts.passed + " tests of " + opts.total + " passed, " + opts.failed + " failed.") | ||
} |