Bug 641738 - Intermittent test_pluginstream_seek_close.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined, r=bsmedberg, a=test
authorPhil Ringnalda <philringnalda>
Mon, 14 Mar 2011 23:33:00 -0700
changeset 63433 fdfd2af3498e56a2cc5e011ce9229c924c107d4b
parent 63432 9251100de4b20fa7d506da1ea15e975680232b4c
child 63434 fca718600ca09414177785caa5f937505e1b7c46
child 63437 b69c496831220a2a9bbc72eabc5a8cb83851c653
push id74
push userphilringnalda@gmail.com
push dateThu, 14 Apr 2011 01:42:25 +0000
reviewersbsmedberg, test
bugs641738
milestone2.0.1pre
Bug 641738 - Intermittent test_pluginstream_seek_close.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined, r=bsmedberg, a=test
modules/plugin/test/mochitest/test_pluginstream_seek_close.html
--- a/modules/plugin/test/mochitest/test_pluginstream_seek_close.html
+++ b/modules/plugin/test/mochitest/test_pluginstream_seek_close.html
@@ -2,16 +2,27 @@
 <head>
   <title>NPAPI Seekable NPStream Test</title>
   <script type="text/javascript" 
           src="/MochiKit/packed.js"></script>
   <script type="text/javascript" 
           src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" 
         href="/tests/SimpleTest/test.css" />
+<script type="application/javascript>
+  function frameLoaded() {
+    var testframe = document.getElementById('testframe');
+    var content = testframe.contentDocument.body.innerHTML;
+    if (!content.length)
+      return;
+
+    ok(true, "We didn't crash");
+    SimpleTest.finish();
+  }
+</script>
 </head>
 <body>
   <p id="display"></p>
 
   <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
 
   <!--
    - Tests a seekable stream.  Calls NPN_RequestRead with the specified
@@ -22,23 +33,12 @@
    - NPN_GetURL.
    -->
   <embed src="neverending.sjs" streammode="seek" closestream
          frame="testframe" streamchunksize="1024" range="100,100"
          id="embedtest" style="width: 400px; height: 100px;"
          type="application/x-test"></embed>
 
   <script class="testbody" type="application/javascript">
-  SimpleTest.waitForExplicitFinish();
-
-  var testframe = document.getElementById('testframe');
-
-  function frameLoaded() {
-    var content = testframe.contentDocument.body.innerHTML;
-    if (!content.length)
-      return;
-
-    ok(true, "We didn't crash");
-    SimpleTest.finish();
-  }
+    SimpleTest.waitForExplicitFinish();
   </script>
 </body>
 </html>