Merge 132371 - Crash when trying to write exception message to null console
Patch by Toni Barzic <firstname.lastname@example.org>
; on 2012-10-24
Reviewed by Adam Barth.
DOMWindow::console may return NULL, so we should do a NULL check before adding message to it.
This may happen e.g. if a worker throws an exception just as the document is being replaced in the view.
The exception task could be processes after current window in the frame changes, and console in the document window is nulled.
The test creates bunch of workers that throw an exception as soon as they are loaded and then tries to change the current document.
The test passes if there is no crash.
Unfortuantely, the test is inherently flaky and may produce some false positive results (but should never fail if there is no bug).
* fast/workers/resources/worker-exception.js: Added.
* fast/workers/worker-exception-during-navigation-expected.txt: Added.
* fast/workers/worker-exception-during-navigation.html: Added.