Skip to content

Instantly share code, notes, and snippets.

@mjschranz
Created July 4, 2012 20:25
Show Gist options
  • Save mjschranz/3049382 to your computer and use it in GitHub Desktop.
Save mjschranz/3049382 to your computer and use it in GitHub Desktop.
Media
document.addEventListener( "DOMContentLoaded", function() {
var _butter,
_iframe,
_media;
function startTests() {
asyncTest( "Media - Remove Track", function() {
var tracks = _media.tracks;
_butter.listen( "trackremoved", function() {
ok( true, "DERP" );
});
_media.removeTrack( tracks[ 0 ] );
});
}
// Halt the tests from running
stop();
// load iframe into current doc
_iframe = document.createElement( "iframe" );
_iframe.onload = function() {
_butter = _iframe.contentWindow.Butter.instances[ 0 ];
_media = _butter.media[ 0 ];
start();
startTests();
}
_iframe.src = "../../templates/test.html";
document.body.appendChild( _iframe );
}, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment