From 5bd3ae640422816ba18d491626c4773ef83e6a0d Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 3 Jun 2011 16:48:31 -0400 Subject: [PATCH] Bug 612448 - Protect the progress listener object from being garbage collected too soon which could cause a test timeout; r=roc --- .../test/mochitest/xulbrowser_plugin_visibility.xul | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul b/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul index 2e5a672e06f..0b4a3a35618 100644 --- a/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul +++ b/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul @@ -52,10 +52,14 @@ var browser1 = document.getElementById('browser1'); var browser2 = document.getElementById('browser2'); + var progressListener1, progressListener2; + function setup() { - browser1.addProgressListener(new ProgressListener(), nsIWebProgress.NOTIFY_STATE_WINDOW); + progressListener1 = new ProgressListener(); + browser1.addProgressListener(progressListener1, nsIWebProgress.NOTIFY_STATE_WINDOW); browser1.loadURI(kURI, null, null); - browser2.addProgressListener(new ProgressListener(), nsIWebProgress.NOTIFY_STATE_WINDOW); + progressListener2 = new ProgressListener(); + browser2.addProgressListener(progressListener2, nsIWebProgress.NOTIFY_STATE_WINDOW); browser2.loadURI(kURI, null, null); }