From 6afad7e984f4cebb7367f47f8220a1b374170c05 Mon Sep 17 00:00:00 2001 From: Philip Chee Date: Wed, 9 Jun 2010 11:57:53 +0800 Subject: [PATCH] Bug 542950 [SeaMonkey trunk] mochitest-browser-chrome: new test fails with "browser_bug511456.js:99 - TypeError: win2 is undefined", browser_bug537449.js fails too. r=dtownsend --- .../components/startup/tests/browser/browser_bug511456.js | 8 +++++++- .../components/startup/tests/browser/browser_bug537449.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/toolkit/components/startup/tests/browser/browser_bug511456.js b/toolkit/components/startup/tests/browser/browser_bug511456.js index 582676b6dfb4..8b2363407243 100644 --- a/toolkit/components/startup/tests/browser/browser_bug511456.js +++ b/toolkit/components/startup/tests/browser/browser_bug511456.js @@ -93,7 +93,13 @@ function test() { Services.wm.addListener(Watcher); - var win2 = OpenBrowserWindow(); + var chromeURL = Services.prefs.getCharPref("browser.chromeURL"); + var argString = Cc["@mozilla.org/supports-string;1"] + .createInstance(Ci.nsISupportsString); + argString.data = "about:blank"; + + var win2 = Services.ww.openWindow(null, chromeURL, "_blank", + "chrome,dialog=no,all", argString); win2.addEventListener("load", function() { win2.removeEventListener("load", arguments.callee, false); gBrowser.selectedTab = gBrowser.addTab(TEST_URL); diff --git a/toolkit/components/startup/tests/browser/browser_bug537449.js b/toolkit/components/startup/tests/browser/browser_bug537449.js index eae4f7648ac8..caea883a902b 100644 --- a/toolkit/components/startup/tests/browser/browser_bug537449.js +++ b/toolkit/components/startup/tests/browser/browser_bug537449.js @@ -105,7 +105,13 @@ function test() { Watcher.allowClose = true; ok(Watcher.seen, "Should have seen a prompt dialog"); ok(!window.closed, "Shouldn't have closed the window"); - var win2 = OpenBrowserWindow(); + var chromeURL = Services.prefs.getCharPref("browser.chromeURL"); + var argString = Cc["@mozilla.org/supports-string;1"] + .createInstance(Ci.nsISupportsString); + argString.data = "about:blank"; + + var win2 = Services.ww.openWindow(null, chromeURL, "_blank", + "chrome,dialog=no,all", argString); ok(win2 != null, "Should have been able to open a new window"); win2.addEventListener("load", function() { win2.removeEventListener("load", arguments.callee, false);