Bug 488233 - test_Microformats_getters.html | Error thrown during test: test_MicroformatsAPI is not defined - got 0, expected 1; r=gavin a=orange-fix
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 22 Nov 2010 03:13:37 -0500
changeset 58226 2131158a71267e176d373607cec9c15da8bd6256
parent 58225 4e66b4cb5e3a95a30bbf572c4810861dd657e511
child 58227 8cde8889726d2f7bf769e4092560a3e28a374761
push id17211
push usereakhgari@mozilla.com
push dateThu, 25 Nov 2010 20:46:30 +0000
treeherdermozilla-central@8cde8889726d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, orange-fix
bugs488233
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 488233 - test_Microformats_getters.html | Error thrown during test: test_MicroformatsAPI is not defined - got 0, expected 1; r=gavin a=orange-fix
toolkit/components/microformats/tests/test_Microformats_getters.html
--- a/toolkit/components/microformats/tests/test_Microformats_getters.html
+++ b/toolkit/components/microformats/tests/test_Microformats_getters.html
@@ -2,16 +2,62 @@
 <head>
   <title>Testing Mixed Up Microformat APIs</title>
   <script type="text/javascript" src="/MochiKit/packed.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"></link>
 </head>
 <body id="contentbody">
+  <pre id="test">
+  <script class="testbody" type="text/javascript">
+
+  // Called from onload in iframe
+  function test_MicroformatsAPI() {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    Components.utils.import("resource://gre/modules/Microformats.js");
+
+    // Test that we can get them all
+    var mfs = [];
+    mfs = Microformats.get("adr",
+                           document.getElementById("content"),
+                           {showHidden: true});
+
+    is(mfs.length, 2, "Two adr's in our array");
+
+    mfs = Microformats.get("geo",
+                           document.getElementById("content"),
+                           {recurseExternalFrames: true});
+    is(mfs.length, 3, "Three geo's in our array");
+
+    mfs = Microformats.get("hCalendar",
+                            document.getElementById("content"),
+                            {recurseExternalFrames: false});
+    // Should get the hCalendar whether we recurseExternalFrames or not.
+    is(mfs.length, 2, "Two hCalendar returned not recursing frames");
+
+    mfs = Microformats.get("hCalendar",
+                           document.getElementById("content"),
+                           {recurseExternalFrames: true});
+    is(mfs.length, 2, "Two hCalendars returned recursing frames");
+
+    mfs = Microformats.get("hCard",
+                           document.getElementById("content"),
+                           {recurseExternalFrames: true},
+                           mfs);
+    is(mfs.length, 3, "Two hCalendars and one hCard");
+
+    mfs = Microformats.get("hCalendar", document.getElementById("secondnode"));
+
+    is(mfs[0].summary, "Pseudo Conference", 
+       "Make sure we get the proper hCalendar from the second level node");
+    is(mfs.length, 1, "And we should only get one hCalendar not two from this node.");
+  }
+  </script>
+  </pre>
   <div id="content">
     <!-- hCard -->
     <p class="vcard" id="23-abbr-title-everything">
       <!-- perhaps the most annoying test ever -->
       <abbr class="fn" title="John Doe">foo</abbr>
       <span class="n">
         <abbr class="honorific-prefix" title="Mister">Mr.</abbr>
         <abbr class="given-name" title="Jonathan">John</abbr>
@@ -103,56 +149,10 @@
           <abbr class="dtstart" title="2008-04-01">April 1</abbr>-
           <abbr class="dtend" title="2008-04-03">April 3</abbr>,
           at the <span class="location">Argent Hotel, San Francisco, CA</span>
           </a>
         </span>
       </div>
     </div>
   </div>
-  <!-- Ok, the test, here we go -->
-  <pre id="test">
-  <script class="testbody" type="text/javascript">
-
-  // Called from onload in iframe
-  function test_MicroformatsAPI() {
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-    Components.utils.import("resource://gre/modules/Microformats.js");
-
-    // Test that we can get them all
-    var mfs = [];
-    mfs = Microformats.get("adr",
-                           document.getElementById("content"),
-                           {showHidden: true});
-
-    is(mfs.length, 2, "Two adr's in our array");
-
-    mfs = Microformats.get("geo",
-                           document.getElementById("content"),
-                           {recurseExternalFrames: true});
-    is(mfs.length, 3, "Three geo's in our array");
-
-    mfs = Microformats.get("hCalendar",
-                            document.getElementById("content"),
-                            {recurseExternalFrames: false});
-    // Should get the hCalendar whether we recurseExternalFrames or not.
-    is(mfs.length, 2, "Two hCalendar returned not recursing frames");
-
-    mfs = Microformats.get("hCalendar",
-                           document.getElementById("content"),
-                           {recurseExternalFrames: true});
-    is(mfs.length, 2, "Two hCalendars returned recursing frames");
-
-    mfs = Microformats.get("hCard",
-                           document.getElementById("content"),
-                           {recurseExternalFrames: true},
-                           mfs);
-    is(mfs.length, 3, "Two hCalendars and one hCard");
-
-    mfs = Microformats.get("hCalendar", document.getElementById("secondnode"));
-
-    is(mfs[0].summary, "Pseudo Conference", 
-       "Make sure we get the proper hCalendar from the second level node");
-    is(mfs.length, 1, "And we should only get one hCalendar not two from this node.");
-  }
-  </script>
 </body>
 </html>