Bug 842476: Work around leak resulting from exception that happens during unload by propagating only the prompts we expect and not the later ones. r=jlebar
authorL. David Baron <dbaron@dbaron.org>
Sun, 24 Feb 2013 23:42:38 -0800
changeset 122888 fb5a9401e2d4bf5be9fb9d3a96a9077b55dd8f81
parent 122887 c94ed869af56d446f9c1f4ec14707535dae099b5
child 122889 d1490171893be5c3d8c9328fbd2da8de4cf8512e
push id1387
push userphilringnalda@gmail.com
push dateTue, 26 Feb 2013 22:32:56 +0000
treeherderfx-team@ad4cc4e97774 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs842476
milestone22.0a1
Bug 842476: Work around leak resulting from exception that happens during unload by propagating only the prompts we expect and not the later ones. r=jlebar Make this test less sensitive to the timing of its own unloading by passing on only the expected messages and not any messages that occur during unloading. Such messages might cause exceptions (e.g., "'TypeError: can't access dead object' when calling method: [nsIPrompt::alert]"), and those exceptions might in turn trigger leaks in nsXPConnect that last until shutdown because we store the most recent exception from a call to an XPCWrappedJS on the XPCJSRuntime through shutdown (rather than reporting it, as we probably should, and then freeing it), leaking the window.
dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html
--- a/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html
+++ b/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html
@@ -16,17 +16,17 @@ function handlePrompt(e) {
   }
   else if (numPrompts == 3) {
     if (e.detail.message != 'child2:hidden') {
       alert("parent:fail Didn't get expected 'child2:hidden'.");
     }
 
     alert('parent:ready');
   }
-  else if (numPrompts > 3) {
+  else if (numPrompts == 4 || numPrompts == 5) {
     alert(e.detail.message);
   }
 }
 
 var iframe1 = document.createElement('iframe');
 iframe1.mozbrowser = true;
 iframe1.addEventListener('mozbrowsershowmodalprompt', handlePrompt);