Skip to content

Commit

Permalink
[mozilla#324] scratch all that, let's go super simple
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottDowne committed Mar 11, 2011
1 parent 82f1b71 commit 1d67748
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
8 changes: 0 additions & 8 deletions popcorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@
// get video element by id or reference
this.video = matches && matches.length && matches[ 2 ] ? document.getElementById( matches[ 2 ] ) : entity;

this.video instanceof Object || Popcorn.error( entity + " is not a valid reference to a video");

// if a required function does not exist, simply do nothing when it is called
this.video.play = this.video.play || Popcorn.nop;
this.video.pause = this.video.pause || Popcorn.nop;
this.video.addEventListener = this.video.addEventListener || Popcorn.nop;
this.video.dispatchEvent = this.video.dispatchEvent || Popcorn.nop;

Popcorn.addInstance( this );

this.data = {
Expand Down
42 changes: 1 addition & 41 deletions test/popcorn.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ test( "Object", function () {
popObj = Popcorn( document.getElementById( "video" ) ),
methods = "load play pause currentTime mute volume roundTime exec removePlugin",
count = 0,
expects = 34;
expects = 30;

expect( expects );

Expand Down Expand Up @@ -244,46 +244,6 @@ test( "Object", function () {
ok( k in popObj, "instance by reference has method: " + k );
plus();
});

try {

Popcorn( document.getElementById( "videoNotHere" ) );
ok(false, "videoNotHere"); plus();
} catch ( e ) {

equal( e.toString() === "null is not a valid reference to a video", true, e );
plus();
}

try {

Popcorn( "videoNotHere" );
ok(false, "videoNotHere"); plus();
} catch ( e ) {

equal( e.toString() === "videoNotHere is not a valid reference to a video", true, e );
plus();
}

try {

Popcorn( 1 );
ok(false, 1); plus();
} catch ( e ) {

equal( e.toString() === "1 is not a valid reference to a video", true, e );
plus();
}

try {

Popcorn();
ok(false, "undefined"); plus();
} catch ( e ) {

equal( e.toString() === "undefined is not a valid reference to a video", true, e );
plus();
}
});

module("Popcorn Methods");
Expand Down

0 comments on commit 1d67748

Please sign in to comment.