Bug 620991 - test_windowed_invalidate.html runs after mochitest shutdown, trips assertion / JS_Assert; r=ehsan a=NPOTB
☠☠ backed out by 064c6937f64e ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Sun, 23 Jan 2011 23:27:18 -0500
changeset 61162 afe951130c656a404cce775b78a89992086b5d25
parent 61161 1c89c6d9574cff4c07195565b9c3736b048a19dc
child 61163 6149b3a93e1b2f436601bb3375ff8620137eaa0f
child 61165 064c6937f64e461372d3d772003a11695b0979c3
push id18252
push usereakhgari@mozilla.com
push dateMon, 24 Jan 2011 04:32:05 +0000
treeherdermozilla-central@4e57b18dd908 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, NPOTB
bugs620991
milestone2.0b10pre
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 620991 - test_windowed_invalidate.html runs after mochitest shutdown, trips assertion / JS_Assert; r=ehsan a=NPOTB
modules/plugin/test/mochitest/Makefile.in
modules/plugin/test/mochitest/test_visibility.html
--- a/modules/plugin/test/mochitest/Makefile.in
+++ b/modules/plugin/test/mochitest/Makefile.in
@@ -115,21 +115,21 @@ endif
   utils.js \
   test_npruntime.xul   \
   test_privatemode.xul \
   test_wmode.xul \
   test_bug479979.xul \
   $(NULL)
 
 ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-ifneq ($(OS_ARCH),WINNT)
 _MOCHITEST_FILES += \
   test_visibility.html \
   $(NULL)
 
+ifneq ($(OS_ARCH),WINNT)
 _MOCHICHROME_FILES += \
   test_xulbrowser_plugin_visibility.xul \
   xulbrowser_plugin_visibility.xul \
   plugin_visibility_loader.html \
   $(NULL)
 endif
 endif
 
--- a/modules/plugin/test/mochitest/test_visibility.html
+++ b/modules/plugin/test/mochitest/test_visibility.html
@@ -80,15 +80,24 @@
 
     clearInterval(part4Interval);
 
     ok(true, "Plugin became invisible again.");
     p.setColor('FF00FF00');
     setTimeout(SimpleTest.finish, 500);
     // wait to make sure we don't actually paint
   }
+
+  function inPaint() {
+    // We're actually in the middle of painting the plugin so don't do anything
+    // complex here, for the sake of cases where async plugin painting isn't
+    // enabled yet
+    setTimeout(didPaint, 0);
+    // Don't run that didPaint callback again
+    didPaint = function() {};
+  }
   </script>
 
-  <embed id="theplugin" class="hidden" type="application/x-test" drawmode="solid" color="FFFF0000" paintscript="setTimeout(didpaint, 0)"></embed>
+  <embed id="theplugin" class="hidden" type="application/x-test" drawmode="solid" color="FFFF0000" paintscript="inPaint()"></embed>
   
   <script type="application/javascript">
   var p = document.getElementById('theplugin');
   </script>