Bug 658738 - browser_inspector_iframeTest.js cleanup
authorDão Gottwald <dao@mozilla.com>
Mon, 27 Jun 2011 13:29:06 +0200
changeset 71837 e338daa71bc2fdb9c05a276ef1a477e1730f0aca
parent 71836 b2d50f779d6c87d031ecd8a709949f25559da0a5
child 71873 f999ca02a6875609a8eb7734379ae7ffddce08d9
push idunknown
push userunknown
push dateunknown
bugs658738
milestone7.0a1
Bug 658738 - browser_inspector_iframeTest.js cleanup
browser/base/content/test/inspector/browser_inspector_iframeTest.js
browser/components/sessionstore/test/browser/browser_394759_basic.js
browser/components/sessionstore/test/browser/browser_394759_behavior.js
browser/components/sessionstore/test/browser/browser_394759_purge.js
--- a/browser/base/content/test/inspector/browser_inspector_iframeTest.js
+++ b/browser/base/content/test/inspector/browser_inspector_iframeTest.js
@@ -119,32 +119,30 @@ function performTestComparisons1()
 function performTestComparisons2()
 {
   Services.obs.removeObserver(performTestComparisons2,
     INSPECTOR_NOTIFICATIONS.HIGHLIGHTING, false);
 
   is(InspectorUI.selection, div2, "selection matches div2 node");
   is(InspectorUI.highlighter.highlitNode, div2, "highlighter matches selection");
 
-  finishUp();
-}
-
-function finishUp() {
-  InspectorUI.closeInspectorUI(true);
-
-  doc = div1 = div2 = iframe1 = iframe2 = highlighterFrame = null;
-  gBrowser.removeCurrentTab();
   finish();
 }
 
-function test()
-{
+function test() {
   waitForExplicitFinish();
+
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
     doc = content.document;
-    waitForFocus(createDocument, content);
+    gBrowser.selectedBrowser.focus();
+    createDocument();
   }, true);
 
   content.location = "data:text/html,iframe tests for inspector";
+
+  registerCleanupFunction(function () {
+    InspectorUI.closeInspectorUI(true);
+    gBrowser.removeCurrentTab();
+  });
 }