From cef9fe17acd83cfe98481782d805ff3ececd2c8e Mon Sep 17 00:00:00 2001 From: "mark.finkle@gmail.com" Date: Tue, 21 Aug 2007 12:59:46 -0700 Subject: [PATCH] b=391902. r=gavin. FUEL Application.console.open() fails --- browser/fuel/src/fuelApplication.js | 2 +- browser/fuel/test/browser_Application.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/browser/fuel/src/fuelApplication.js b/browser/fuel/src/fuelApplication.js index 31667f971f9..e7eed53378c 100644 --- a/browser/fuel/src/fuelApplication.js +++ b/browser/fuel/src/fuelApplication.js @@ -67,7 +67,7 @@ Console.prototype = { var wWatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Ci.nsIWindowWatcher); wWatch.openWindow(null, "chrome://global/content/console.xul", "_blank", - "chrome,dialog=no,all", cmdLine); + "chrome,dialog=no,all", null); } else { // console was already open console.focus(); diff --git a/browser/fuel/test/browser_Application.js b/browser/fuel/test/browser_Application.js index 377cd91f266..fedfae6fc07 100644 --- a/browser/fuel/test/browser_Application.js +++ b/browser/fuel/test/browser_Application.js @@ -1,3 +1,6 @@ +const Ci = Components.interfaces; +const Cc = Components.classes; + function test() { ok(Application, "Check global access to Application"); @@ -5,4 +8,19 @@ function test() { ok(Application.id, "Check to see if an ID exists for the Application"); ok(Application.name, "Check to see if a name exists for the Application"); ok(Application.version, "Check to see if a version exists for the Application"); + + var wMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); + var console = wMediator.getMostRecentWindow("global:console"); + if (!console) { + Application.console.open(); + setTimeout(checkConsole, 500); + } +} + +function checkConsole() { + var wMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); + var console = wMediator.getMostRecentWindow("global:console"); + ok(console, "Check to see if the console window opened"); + if (console) + console.close(); }