From 7aa9c26bc956ba6fb57784a0ba4ff2659ae5439f Mon Sep 17 00:00:00 2001 From: Shawn Wilsher Date: Fri, 27 Jun 2008 11:59:14 -0400 Subject: [PATCH] Bug 441716 - test_retention_is_0_closes.xul is flakey on linux The test now listens for a "domwindowclosed" notification from the window watch service instead of using a timer which is unreliable. Upon receiving the notification, it dispatches an event to the main thread to perform the proper checks to allow time for any other events listening to that topic to process. This also adds a utils.js file that download manager chrome tests can use. So far, only one function has been added that will execute a function on the main thread; executeSoon. r=gavin --- .../downloads/tests/chrome/Makefile.in | 1 + .../chrome/test_retention_is_0_closes.xul | 55 +++++++++-------- .../mozapps/downloads/tests/chrome/utils.js | 60 +++++++++++++++++++ 3 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 toolkit/mozapps/downloads/tests/chrome/utils.js diff --git a/toolkit/mozapps/downloads/tests/chrome/Makefile.in b/toolkit/mozapps/downloads/tests/chrome/Makefile.in index d9c750de851..ea5af1dd276 100644 --- a/toolkit/mozapps/downloads/tests/chrome/Makefile.in +++ b/toolkit/mozapps/downloads/tests/chrome/Makefile.in @@ -61,6 +61,7 @@ _CHROME_FILES = \ test_space_key_pauses_resumes.xul \ test_ui_stays_open_on_alert_clickback.xul \ test_bug_429247.xul \ + utils.js \ $(NULL) ifneq (,$(filter cocoa, $(MOZ_WIDGET_TOOLKIT))) diff --git a/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul b/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul index ade9fdf92ce..04d919f6472 100644 --- a/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul +++ b/toolkit/mozapps/downloads/tests/chrome/test_retention_is_0_closes.xul @@ -53,13 +53,21 @@ src="chrome://mochikit/content/MochiKit/packed.js"/>