// Popcorn.js does not support archaic browsers
if ( !document.addEventListener ) {
- global.Popcorn = {};
+ global.Popcorn = {
+ isSupported: false
+ };
var methods = ( "forEach extend effects error guid sizeOf isArray nop position disable enable destroy " +
"addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId " +
return new Popcorn.p.init( entity, options || null );
};
- // Popcorn API version, automatically inserted via build system.
+ // Popcorn API version, automatically inserted via build system.
Popcorn.version = "@VERSION";
+ // Boolean flag allowing a client to determine if Popcorn can be supported
+ Popcorn.isSupported = true;
+
// Instance caching
Popcorn.instances = [];
module("Core");
test("Dummy", function () {
- expect(1);
+ expect( 1 );
ok( Popcorn, "Popcorn dummy exists");
});
+test("isSupported", function () {
+
+ expect( 2 );
+
+ ok( "isSupported" in Popcorn, "Popcorn.isSupported boolean flag exists");
+ ok( !Popcorn.isSupported, "Popcorn.isSupported boolean flag is false");
+});
+
+
module("Static Methods");
(function() {
- var method,
+ var method,
methods = ( "removeInstance addInstance getInstanceById removeInstanceById " +
"forEach extend effects error guid sizeOf isArray nop position disable enable " +
"addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId " +
test( method, function () {
- expect(1);
+ expect( 1 );
ok( Popcorn[ method ], "Popcorn." + method + " exists");
});
module("Attempt");
(function() {
- var method,
+ var method,
methods = ( "removeInstance addInstance getInstanceById removeInstanceById " +
"forEach extend effects error guid sizeOf isArray nop position disable enable " +
"addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId " +
test( method, function () {
- expect(1);
+ expect( 1 );
equal( Popcorn[ method ](), undefined, "Popcorn." + method + "() dummy returns undefined without throwing exception");
Popcorn = $$;
});
+test("isSupported", function () {
+ expect( 2 );
+
+ ok( "isSupported" in Popcorn, "Popcorn.isSupported boolean flag exists");
+ ok( Popcorn.isSupported, "Popcorn.isSupported boolean flag is true");
+});
test("Popcorn.* Static Methods", function() {