Bug 490152 - test_framerecursion.html | Error thrown during test: onLoad 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 58227 8cde8889726d2f7bf769e4092560a3e28a374761
parent 58226 2131158a71267e176d373607cec9c15da8bd6256
child 58228 bb5091f2e6a175d7ae507f0bcfc0a1d16ae483d6
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
bugs490152
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 490152 - test_framerecursion.html | Error thrown during test: onLoad is not defined - got 0, expected 1; r=gavin a=orange-fix
toolkit/components/microformats/tests/test_framerecursion.html
--- a/toolkit/components/microformats/tests/test_framerecursion.html
+++ b/toolkit/components/microformats/tests/test_framerecursion.html
@@ -5,16 +5,41 @@
 <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">
+
+  // Start the test once the iFrame loads
+  function onLoad() {
+    test_MicroformatsAPI();
+  }
+
+  function test_MicroformatsAPI() {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    Components.utils.import("resource://gre/modules/Microformats.js");
+
+    count = Microformats.count("geo",
+                              document.getElementById("contentbody"),
+                              {recurseExternalFrames: false},
+                              0);
+    is(count, 1, "Only one geo - we don't count external frames");
+
+    count = Microformats.count("geo",
+                              document.getElementById("contentbody"),
+                              {recurseExternalFrames: true});
+    is(count, 2, "Two Geo's - one in frame and one in iframe");
+  }
+  </script>
+  </pre>
 
   <frameset>
     <frame id="frame1">
       <div>
         <span class="notAMicroformat" id="notme">
           <abbr class="foo">I am not a microformat</abbr>
           <abbr class="title">Foolish title, not a format</abbr>
         </span>
@@ -31,36 +56,10 @@
         <span>Testing is Fun!</span>
       </div>
     </frame>
   </frameset>
 
   <!-- Geo -->
   <iframe id="iframe" src="geo.html" onload="onLoad();">
   </iframe>
-
-  <!-- Ok, the test, here we go -->
-  <pre id="test">
-  <script class="testbody" type="text/javascript">
-
-  // Start the test once the iFrame loads
-  function onLoad() {
-    test_MicroformatsAPI();
-  }
-
-  function test_MicroformatsAPI() {
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-    Components.utils.import("resource://gre/modules/Microformats.js");
-
-    count = Microformats.count("geo",
-                              document.getElementById("contentbody"),
-                              {recurseExternalFrames: false},
-                              0);
-    is(count, 1, "Only one geo - we don't count external frames");
-
-    count = Microformats.count("geo",
-                              document.getElementById("contentbody"),
-                              {recurseExternalFrames: true});
-    is(count, 2, "Two Geo's - one in frame and one in iframe");
-  }
-  </script>
 </body>
 </html>