Skip to content

Commit

Permalink
Cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed May 23, 2015
1 parent 901f6cb commit da2d639
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,6 @@ class Component {
* @return {Component}
*/
triggerReady() {

// // Ready should only be fired once
// if (this.isReady_) {
// return;
// }

this.isReady_ = true;

// Ensure ready is triggerd asynchronously
Expand Down
1 change: 0 additions & 1 deletion src/js/tracks/text-track-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class TextTrackDisplay extends Component {
player.on('fullscreenchange', Fn.bind(this, this.updateDisplay));

let tracks = player.options_['tracks'] || [];

for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
this.player_.addRemoteTextTrack(track);
Expand Down
5 changes: 3 additions & 2 deletions test/globals-shim.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import document from 'global/document';
import window from 'global/window';
import sinon from 'sinon';

Expand All @@ -6,5 +7,5 @@ window.sinon = sinon;

// This may not be needed anymore, but double check before removing
window.fixture = document.createElement('div');
fixture.id = 'qunit-fixture';
document.body.appendChild(fixture);
window.fixture.id = 'qunit-fixture';
document.body.appendChild(window.fixture);
18 changes: 18 additions & 0 deletions test/unit/tracks/tracks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ test('Player track methods call the tech', function() {
equal(calls, 2, 'both textTrack and addTextTrack defer to the tech');
});

test('TextTrackDisplay initializes tracks on player ready', function() {
var calls = 0,
ttd = new TextTrackDisplay({
on: Function.prototype,
addTextTracks: function() {
calls--;
},
getChild: function() {
calls--;
},
ready: function() {
calls++;
}
}, {});

equal(calls, 1, 'only a player.ready call was made');
});

test('listen to remove and add track events in native text tracks', function() {
var oldTestVid = Html5.TEST_VID,
player,
Expand Down

0 comments on commit da2d639

Please sign in to comment.