From 3126abe3cfe9d1242580f5e4955e98aaae8d7e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Mon, 27 Jun 2011 13:29:06 +0200 Subject: [PATCH] Bug 658738 - browser_inspector_iframeTest.js cleanup --HG-- extra : rebase_source : 78326a6f8794354e1aba9be4c178f2f66da438e0 --- .../inspector/browser_inspector_iframeTest.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/browser/base/content/test/inspector/browser_inspector_iframeTest.js b/browser/base/content/test/inspector/browser_inspector_iframeTest.js index 01df7fedeeda..afd9a933a828 100644 --- a/browser/base/content/test/inspector/browser_inspector_iframeTest.js +++ b/browser/base/content/test/inspector/browser_inspector_iframeTest.js @@ -124,27 +124,25 @@ function performTestComparisons2() 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(); + }); }