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