browser_bug839193.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. var gTestRoot = getRootDirectory(gTestPath);
  5. var gBugWindow = null;
  6. var gIterations = 5;
  7. function onLoad() {
  8. gBugWindow.close();
  9. }
  10. function onUnload() {
  11. if (!gIterations) {
  12. gBugWindow = null;
  13. Services.obs.removeObserver(onLoad, "bug839193-loaded");
  14. Services.obs.removeObserver(onUnload, "bug839193-unloaded");
  15. window.focus();
  16. finish();
  17. } else {
  18. gBugWindow = window.openDialog(gTestRoot + "bug839193.xul");
  19. gIterations--;
  20. }
  21. }
  22. // This test is about leaks, which are handled by the test harness, so
  23. // there are no actual checks here. Whether or not this test passes or fails
  24. // will be apparent by the checks the harness performs.
  25. function test() {
  26. waitForExplicitFinish();
  27. // This test relies on the test timing out in order to indicate failure so
  28. // let's add a dummy pass.
  29. ok(true, "Each test requires at least one pass, fail or todo so here is a pass.");
  30. Services.obs.addObserver(onLoad, "bug839193-loaded", false);
  31. Services.obs.addObserver(onUnload, "bug839193-unloaded", false);
  32. gBugWindow = window.openDialog(gTestRoot + "bug839193.xul");
  33. }