1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/indexedDB/test/browser_bug839193.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +let gTestRoot = getRootDirectory(gTestPath); 1.9 +let gBugWindow = null; 1.10 +let gIterations = 5; 1.11 + 1.12 +function onLoad() { 1.13 + gBugWindow.close(); 1.14 +} 1.15 + 1.16 +function onUnload() { 1.17 + if (!gIterations) { 1.18 + gBugWindow = null; 1.19 + Services.obs.removeObserver(onLoad, "bug839193-loaded"); 1.20 + Services.obs.removeObserver(onUnload, "bug839193-unloaded"); 1.21 + 1.22 + window.focus(); 1.23 + finish(); 1.24 + } else { 1.25 + gBugWindow = window.openDialog(gTestRoot + "bug839193.xul"); 1.26 + gIterations--; 1.27 + } 1.28 +} 1.29 + 1.30 +// This test is about leaks, which are handled by the test harness, so 1.31 +// there are no actual checks here. Whether or not this test passes or fails 1.32 +// will be apparent by the checks the harness performs. 1.33 +function test() { 1.34 + waitForExplicitFinish(); 1.35 + Services.obs.addObserver(onLoad, "bug839193-loaded", false); 1.36 + Services.obs.addObserver(onUnload, "bug839193-unloaded", false); 1.37 + 1.38 + gBugWindow = window.openDialog(gTestRoot + "bug839193.xul"); 1.39 +}