]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#625] Regex match the url to skirt Safari string evaluation issue
authorRick Waldron <waldron.rick@gmail.com>
Wed, 20 Jul 2011 19:46:37 +0000 (15:46 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 20 Jul 2011 19:46:37 +0000 (15:46 -0400)
plugins/webpage/popcorn.webpage.unit.js

index beaf6f29238b4f001f429d86a1654cbb45495805..2937f46ea5e9508da72746155a62910551a329db 100755 (executable)
@@ -1,40 +1,40 @@
 test("Popcorn Webpage Plugin", function () {
-  
+
   var popped = Popcorn("#video"),
-      expects = 11, 
+      expects = 11,
       count = 0,
       setupId,
-      theiFrame = document.getElementsByTagName('iframe');
+      theiFrame = document.getElementsByTagName("iframe");
 
   expect(expects);
-  
+
   function plus() {
     if ( ++count===expects) {
       start();
     }
   }
-  
+
   stop();
-   
-  ok ('webpage' in popped, "webpages is a mehtod of the popped instance");
+
+  ok ("webpage" in popped, "webpages is a mehtod of the popped instance");
   plus();
-  
-  equals (theiFrame.length, 0, "initially, there is no iframes on the page" );
+
+  equal( theiFrame.length, 0, "initially, there is no iframes on the page" );
   plus();
-  
+
   popped.webpage({
-    id: "webpages-a", 
+    id: "webpages-a",
     start: 0, // seconds
     end: 1, // seconds
-    src: 'http://webmademovies.org',
-    target: 'webpagediv'
+    src: "http://webmademovies.org",
+    target: "webpagediv"
   })
   .webpage({
-    id: "webpages-b", 
+    id: "webpages-b",
     start: 1, // seconds
     end: 2, // seconds
-    src: 'http://zenit.senecac.on.ca/wiki/index.php/Processing.js',
-    target: 'webpagediv'
+    src: "http://zenit.senecac.on.ca/wiki/index.php/Processing.js",
+    target: "webpagediv"
   })
   .volume(0);
 
@@ -43,25 +43,25 @@ test("Popcorn Webpage Plugin", function () {
   popped.exec( 0, function() {
     ok (!!theiFrame[0], "iframe was created" );
     plus();
-    equals (theiFrame.length, 2, "there is only two iframes on the page" );
+    equal( theiFrame.length, 2, "there is only two iframes on the page" );
     plus();
-    equals (theiFrame[0].id, "webpages-a", "the first iframe has the id 'webpages-a'" );
+    equal( theiFrame[0].id, "webpages-a", "the first iframe has the id 'webpages-a'" );
     plus();
-    equals (theiFrame[0].src, "http://webmademovies.org/", "iframe has the src 'http://webmademovies.org/'" );
+    ok( /webmademovies/.test(theiFrame[0].src), "iframe has the src 'http://webmademovies.org/'" );
     plus();
   });
 
   popped.exec( 1, function() {
     ok (!!theiFrame[1], "iframe was created" );
     plus();
-    equals (theiFrame[1].id, "webpages-b", "iframe second has the id 'webpages-b'" );
+    equal( theiFrame[1].id, "webpages-b", "iframe second has the id 'webpages-b'" );
     plus();
-    equals (theiFrame[1].src,"http://zenit.senecac.on.ca/wiki/index.php/Processing.js", "iframe has the src 'http://zenit.senecac.on.ca/wiki/index.php/Processing.js'" );
+    equal( theiFrame[1].src,"http://zenit.senecac.on.ca/wiki/index.php/Processing.js", "iframe has the src 'http://zenit.senecac.on.ca/wiki/index.php/Processing.js'" );
     plus();
   });
 
   popped.exec( 2, function() {
-    ok (theiFrame[0].style.display === 'none' && theiFrame[1].style.display === 'none', "both iframes are hidden" );
+    ok (theiFrame[0].style.display === "none" && theiFrame[1].style.display === "none", "both iframes are hidden" );
     plus();
 
     popped.pause().removeTrackEvent( setupId );