Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma chameleon #1187

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
b7cc2a8
Prevent mousemove spam
download13 Mar 9, 2014
204bb84
Array traversing for children opts - closes #1070
Akkuma Mar 18, 2014
799f176
Fixed some formatting issues & added .each doc
Akkuma Mar 20, 2014
61eb54a
Replaced webkitRequestFullScreen with webkitReplaceFullscreen
michelt Mar 20, 2014
aeb4aa3
Removed dist files
heff Mar 27, 2014
06e141d
Merge branch 'stable'
heff Mar 27, 2014
efe25c0
Removed dist files
heff Mar 27, 2014
6a097c0
Basic UI for Live
tomjohnson916 Apr 2, 2014
d784f9d
Added line to the changelog
heff Apr 2, 2014
c7e35e5
Making sure that the title element gets placed into the UL element
jnwng Mar 26, 2014
95c29e6
Reset player on source change. closes #1050 closes #1124
Apr 3, 2014
aa8d50b
Don't force sliders to get evaluated on load. closes #1122
dmlap Apr 3, 2014
4e0c2b3
Updated volume slider to use ems intead of percent for default value …
heff Apr 3, 2014
35d7258
Merge branch 'feature/fix-menu-title' of git://github.com/coursera/vi…
jnwng Apr 3, 2014
9d25874
Adjusting menu to use title given in options
jnwng Apr 4, 2014
d8f721a
getElementsById -> getElementById
stin7 Apr 5, 2014
2fca844
Merge pull request #1130 from stin7/patch-1
heff Apr 11, 2014
2473d5b
Merge branch 'stable'
heff Apr 12, 2014
3bafdee
Merge branch 'master' of github.com:videojs/video.js
heff Apr 12, 2014
31918fc
Included self-hosting MIME type instructions
bosoniq Apr 16, 2014
4660573
Merge branch 'feature/fix-menu-title' of github.com:coursera/video.js…
heff Apr 18, 2014
c1029ea
Update setup.md
bosoniq Apr 18, 2014
e8722ff
Included self-hosting MIME type instructions
bosoniq Apr 18, 2014
65833f5
Making sure a tech exists when starting manual progress and timeupdat…
heff Apr 25, 2014
f98012a
Trigger one last timepudate when stopping manual timeupdates. fixes #…
heff Apr 25, 2014
8c9a4cc
Merge branch 'mousespam' of github.com:download13/video.js into downl…
heff Apr 25, 2014
f4704ee
Merge branch 'feature/tech-error' of github.com:heff/video-js into he…
heff Apr 25, 2014
16eea0a
Merge branch 'feature/fix-timeupdates' of github.com:heff/video-js in…
heff Apr 25, 2014
923ce03
Fixed compilation failure with LESS v1.7.0 and GRUNT v0.4.4. The oper…
fobiaxx Apr 29, 2014
227700a
Added a more informative and styled fallback message for non-html5 br…
heff Apr 29, 2014
22d306a
initial karma and saucelabs work
gkatsev Apr 30, 2014
e379afc
add sauce encrypted values
gkatsev Apr 30, 2014
321b005
remove options from grunt karma. Non-verbose grunt test
gkatsev Apr 30, 2014
0737ea2
Add the karma config files
gkatsev Apr 30, 2014
70f5c6f
Update karma dependencies. Add karma-sauce-launcher
gkatsev Apr 30, 2014
4679b4d
add saucelabs config to karma
gkatsev May 1, 2014
3eb2d8f
actually run the sauce_connect script
gkatsev May 1, 2014
391fc26
use correct access key
gkatsev May 1, 2014
6baa603
Add irc notifications
gkatsev May 1, 2014
3dcb902
Run phantomjs with karma on PRs from forks
gkatsev May 1, 2014
929e87b
rename old test task to test-qunit
gkatsev May 1, 2014
38c25b1
test task only does saucelabs, qunit in phantom with karma or in chrome
gkatsev May 1, 2014
bdcc638
Test if it's a PR before running sauce_connect
gkatsev May 1, 2014
d96e008
Updated setup.md and demo.html with fallback paragraph
heff May 5, 2014
3e5ef19
Merge branch 'master' of github.com:Akkuma/video.js into Akkuma-master
heff May 5, 2014
27f0f78
Updated to match comments in #1093
heff May 6, 2014
e7617bf
Merge pull request #1 from heff/Akkuma-master
Akkuma May 6, 2014
a5bc688
Merge branch 'Akkuma-master'
heff May 6, 2014
adf4e50
Added line to the changelog
heff May 6, 2014
269f7b1
Merge branch 'master' of github.com:michelt/video.js into michelt-master
heff May 7, 2014
ef25557
Added line to changelog
heff May 7, 2014
dbff62e
Made tap events on mobile less sensitive to touch moves. closes #1111
May 7, 2014
1df28ff
Fixed the default flag for captions/subtitles tracks. closes #1153 cl…
May 7, 2014
a671891
Merge pull request #1149 from bosoniq/master
mmcc May 7, 2014
3fd0c92
Added line to changelog
heff May 7, 2014
bcb69a0
Merge branch 'master' of github.com:videojs/video.js
heff May 7, 2014
92eac13
More explicit MIME type note
mmcc May 7, 2014
7782eda
Merge branch 'master' of github.com:fobiaxx/video.js into fobiaxx-master
heff May 9, 2014
4bb3a23
Made negative LESS calculations a little more readable.
heff May 9, 2014
0156742
Merge branch 'stable'
heff May 9, 2014
3667d38
remove bunyip example and browsers.json files
gkatsev May 12, 2014
d7f840a
Better error handling. closes #1197
heff May 13, 2014
047bd8f
Made vjs.get work with xDomain in IE < 10. closes #1095
May 13, 2014
8dfe0a4
Added support for playbackRate switching. closes #1132
H1D May 13, 2014
617319e
No need for a separate localkarma conf
gkatsev May 14, 2014
d97f143
Rename localkarma conf files to karma conf files
gkatsev May 14, 2014
e999af5
Add a bunch of browsers for running with test task
gkatsev May 14, 2014
bad5130
Fixed the loadstart event listener order so it's attached before the …
heff May 14, 2014
0c3fb04
Fixed issues from comments on d7f840a9693a73a4764eba2d5c7c0cb4b7120c80
heff May 14, 2014
97c1f83
Added a missing changelog item
heff May 14, 2014
8c6dc84
Merge branch 'karma-chameleon' of github.com:gkatsev/video.js into gk…
heff May 15, 2014
6c7a914
Added sinon to the test files
heff May 15, 2014
6dfc9a7
Merge pull request #1 from heff/gkatsev-karma-chameleon
gkatsev May 15, 2014
16a263e
use karma-sinon
gkatsev May 15, 2014
070edd6
Add a common 'pretask'
gkatsev May 16, 2014
1a64dbd
Init and dispose of tech on setup and teardown.
gkatsev May 16, 2014
891f39f
Add some comments explaining the test task
gkatsev May 16, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 0 additions & 21 deletions .bunyipconfig.js.example

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -15,9 +15,6 @@ npm-debug.log
sandbox/*
!sandbox/*.example

# ignore any Karma conf.js files in the test/ directory
test/*.conf.js

*.swp
*.swo

Expand Down
1 change: 1 addition & 0 deletions .jshintrc
Expand Up @@ -22,6 +22,7 @@
"define",
"module",
"exports",
"process",

"PlayerTest",
"asyncTest",
Expand Down
13 changes: 12 additions & 1 deletion .travis.yml
@@ -1,3 +1,14 @@
language: node_js
node_js:
- 0.8
- 0.10
before_script:
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any threat of this URL being changed/compromised?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is, but it's unlikely. This is the recommended approach from saucelabs themselves.

notifications:
irc:
channels:
- "chat.freenode.net#videojs"
use_notice: true
env:
global:
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U=
- secure: GIbhjUJapvC70nIZVlhVyK+3KAD2TVKpiY/q412OO7V2izbvcM1tvU3LBoMZbROzrt5TT84tCoJDvHnrpL0OvxPwrzL5CUU7h4UTxhTOyQkEinbYAnWlW9wdrvtdczsEvANkFPqBZ53B3hVHZHMLOG8QRWaTBicF68vSHEJFqb4=
9 changes: 8 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,14 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* Updated the UI to support live video ([view](https://github.com/videojs/video.js/pull/1121))
* The UI now resets after a source change ([view](https://github.com/videojs/video.js/pull/1124))
* Now assuming smart CSS defaults for sliders to prevent reflow on player init ([view](https://github.com/videojs/video.js/pull/1122))
* Fixed the title element placement in menus [[view](https://github.com/videojs/video.js/pull/1114)]
* Fixed title support for menu buttons ([view](https://github.com/videojs/video.js/pull/1128))
* Fixed extra mousemove events on Windows caused by certain apps, not users [[view](https://github.com/videojs/video.js/pull/1068)]
* Fixed error due to undefined tech when no source is supported [[view](https://github.com/videojs/video.js/pull/1172)]
* Fixed the progress bar not finishing when manual timeupdate events are used [[view](https://github.com/videojs/video.js/pull/1173)]

--------------------

Expand Down
136 changes: 130 additions & 6 deletions Gruntfile.js
Expand Up @@ -135,16 +135,97 @@ module.exports = function(grunt) {
}
},
karma: {
// this config file applies to all following configs except if overwritten
options: {
configFile: 'test/karma.conf.js'
},

// this only runs on PRs from the mainrepo on saucelabs
saucelabs: {
browsers: ['chrome_sl', 'ipad_sl']
},

// these are run locally on local browsers
dev: {
configFile: 'test/karma.conf.js',
autoWatch: true
browsers: ['Chrome', 'Firefox', 'Safari']
},
chromecanary: {
browsers: ['ChromeCanary']
},
chrome: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does having these individual browser definitions get us?

browsers: ['Chrome']
},
firefox: {
browsers: ['Firefox']
},
safari: {
browsers: ['Safari']
},
ie: {
browsers: ['IE']
},
phantomjs: {
browsers: ['PhantomJS']
},

// This is all the minified tests run locally on local browsers
minified_dev: {
browsers: ['Chrome', 'Firefox', 'Safari'],
configFile: 'test/karma.minified.conf.js'
},
minified_chromecanary: {
browsers: ['ChromeCanary'],
configFile: 'test/karma.minified.conf.js'
},
minified_chrome: {
browsers: ['Chrome'],
configFile: 'test/karma.minified.conf.js'
},
minified_firefox: {
browsers: ['Firefox'],
configFile: 'test/karma.minified.conf.js'
},
minified_safari: {
browsers: ['Safari'],
configFile: 'test/karma.minified.conf.js'
},
minified_ie: {
browsers: ['IE'],
configFile: 'test/karma.minified.conf.js'
},
minified_phantomjs: {
browsers: ['PhantomJS'],
configFile: 'test/karma.minified.conf.js'
},

// This is all the minified api tests run locally on local browsers
minified_api_dev: {
browsers: ['Chrome', 'Firefox', 'Safari'],
configFile: 'test/karma.minified.api.conf.js'
},
ci: {
configFile: 'test/karma.conf.js',
autoWatch: false
minified_api_chromecanary: {
browsers: ['ChromeCanary'],
configFile: 'test/karma.minified.api.conf.js'
},
minified_api_chrome: {
browsers: ['Chrome'],
configFile: 'test/karma.minified.api.conf.js'
},
minified_api_firefox: {
browsers: ['Firefox'],
configFile: 'test/karma.minified.api.conf.js'
},
minified_api_safari: {
browsers: ['Safari'],
configFile: 'test/karma.minified.api.conf.js'
},
minified_api_ie: {
browsers: ['IE'],
configFile: 'test/karma.minified.api.conf.js'
},
minified_api_phantomjs: {
browsers: ['PhantomJS'],
configFile: 'test/karma.minified.api.conf.js'
}
},
vjsdocs: {
Expand Down Expand Up @@ -235,7 +316,50 @@ module.exports = function(grunt) {
grunt.registerTask('default', ['jshint', 'less', 'build', 'minify', 'usebanner', 'dist']);
// Development watch task
grunt.registerTask('dev', ['jshint', 'less', 'build', 'qunit:source']);
grunt.registerTask('test', ['jshint', 'less', 'build', 'minify', 'usebanner', 'qunit']);
grunt.registerTask('test-qunit', ['jshint', 'less', 'build', 'minify', 'usebanner', 'qunit']);

// The test task will run `karma:saucelabs` when running in travis,
// when running via a PR from a fork, it'll run qunit tests in phantom using karma
// otherwise, it'll run the tests in chrome via karma
grunt.registerTask('test', function() {
var tasks = this.args,
tasksMinified,
tasksMinifiedApi;

grunt.task.run(['jshint', 'less', 'build', 'minify', 'usebanner']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had issues with assuming grunt.task.run would happen synchronously inside a function like this. It seems to be working fine here, but just a warning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grunt.task.run queues up the list of tasks to be ran after this function exits. So, basically, this function queues up

  1. jshint
  2. less
  3. build
  4. minify
  5. usebanner
  6. karma:chrome
  7. karma:minified_chrome
  8. karma:minfied_api_chrome

to be run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. Sorry, I didn't look deep enough to realize you were manipulating the tasks array with this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now I understand my previous issues with grunt.task.run... :-P. I was assuming the tasks would be run inline.


if (process.env.TRAVIS_PULL_REQUEST) {
grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']);
} else if (process.env.TRAVIS) {
grunt.task.run(['karma:saucelabs']);
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool stuff. It could also use some more comments I think. It's a little hard to jump in and know what's going on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a comment explaining this.

if (tasks.length === 0) {
tasks.push('chrome');
}
if (tasks.length === 1) {
tasks = tasks[0].split(',');
}

tasksMinified = tasks.slice();
tasksMinifiedApi = tasks.slice();

tasksMinified = tasksMinified.map(function(task) {
return 'minified_' + task;
});

tasksMinifiedApi = tasksMinifiedApi.map(function(task) {
return 'minified_api_' + task;
});

tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi);
tasks = tasks.map(function(el) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

el?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an element of the list but probably should be renamed to task. Especially since it'll then be consistent with the above maps.

return 'karma:' + el;
});


grunt.task.run(tasks);
}
});

var fs = require('fs'),
gzip = require('zlib').gzip;
Expand Down
37 changes: 0 additions & 37 deletions browsers.json

This file was deleted.

1 change: 1 addition & 0 deletions build/source-loader.js
Expand Up @@ -26,6 +26,7 @@ var sourceFiles = [
"src/js/menu.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",
Expand Down
41 changes: 0 additions & 41 deletions dist/video-js/demo.captions.vtt

This file was deleted.

31 changes: 0 additions & 31 deletions dist/video-js/demo.html

This file was deleted.

Binary file removed dist/video-js/font/.DS_Store
Binary file not shown.
Binary file removed dist/video-js/font/vjs.eot
Binary file not shown.