Created attachment 528271 [details] [diff] [review] Proposed patch waitForBrowserState and waitForSaveState use listener and observer but those are removed in its function. We should also use registerCleanupFunction in case of timeout.
Comment on attachment 528271 [details] [diff] [review] Proposed patch Patch looks good. Do you have any idea if there are cases where we're actually hitting this?
It happened once on my local Windows XP VM, but at that time the VM was getting slow down due to unknown reason, and I do not remember which test case causes this, but anyway it happens if user runs tests which use waitForBrowserState or waitForSaveSatate on a slow machine. ;-)