michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: let gTestRoot = getRootDirectory(gTestPath); michael@0: let gBugWindow = null; michael@0: let gIterations = 5; michael@0: michael@0: function onLoad() { michael@0: gBugWindow.close(); michael@0: } michael@0: michael@0: function onUnload() { michael@0: if (!gIterations) { michael@0: gBugWindow = null; michael@0: Services.obs.removeObserver(onLoad, "bug839193-loaded"); michael@0: Services.obs.removeObserver(onUnload, "bug839193-unloaded"); michael@0: michael@0: window.focus(); michael@0: finish(); michael@0: } else { michael@0: gBugWindow = window.openDialog(gTestRoot + "bug839193.xul"); michael@0: gIterations--; michael@0: } michael@0: } michael@0: michael@0: // This test is about leaks, which are handled by the test harness, so michael@0: // there are no actual checks here. Whether or not this test passes or fails michael@0: // will be apparent by the checks the harness performs. michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: Services.obs.addObserver(onLoad, "bug839193-loaded", false); michael@0: Services.obs.addObserver(onUnload, "bug839193-unloaded", false); michael@0: michael@0: gBugWindow = window.openDialog(gTestRoot + "bug839193.xul"); michael@0: }