Bug 53868 - fast/notifications/notifications-document-close-crash.html fails and flakes after r77738
Summary: fast/notifications/notifications-document-close-crash.html fails and flakes a...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2011-02-06 02:42 PST by Robert Hogan
Modified: 2011-02-24 17:25 PST (History)
9 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hogan 2011-02-06 02:42:03 PST
Fails after http://trac.webkit.org/changeset/77738

-CONSOLE MESSAGE: line 36: INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
+CONSOLE MESSAGE: line 36: TypeError: Type error

Failure is because of:

JSValue JSNotificationCenter::requestPermission(ExecState* exec)
    ScriptExecutionContext* context = impl()->scriptExecutionContext();

    // Make sure that script execution context is valid.
    if (!context) {
        setDOMException(exec, INVALID_STATE_ERR);
        return jsUndefined();
    if (!exec->argument(0).isObject())
        return throwTypeError(exec);


'context' above used to be a local copy of ActiveDomObject::scriptExecutionContext() but is now the scriptExectionContext() (an upcast of Document) for the page's Document object.

On Qt, apparently unlike other platforms, this context object is not destroyed by the time the test calls requestPermission(), so instead Qt fails in the above function at 'if (!exec->argument(0).isObject())' instead.

Not clear to me why this is happening only for Qt, so skipping for now.
Comment 1 Robert Hogan 2011-02-06 02:47:19 PST
Committed r77764: <http://trac.webkit.org/changeset/77764>
Comment 2 Robert Hogan 2011-02-06 02:49:14 PST
Reopening for fix.
Comment 3 WebKit Review Bot 2011-02-06 05:46:17 PST
http://trac.webkit.org/changeset/77764 might have broken Leopard Intel Release (Tests)
The following tests are not passing:
Comment 4 Robert Hogan 2011-02-10 14:14:19 PST
This test is flaky on Chromium now. 

Until r77738 the test could depend on the ScriptExecutionContext being null because NotificationCenter held a local copy which got nulled on NotificationCenter::disconnectFrame(). Now NotificationCenter will return a valid ScriptExecutionContext until the Document/ScriptExecutionContext the DomWindow originally associated it with is destroyed.

I believe the reason Qt is now failing on 'if (!exec->argument(0).isObject())' instead is because 'script()->clearScriptObjects();' has been called in 'void Frame::pageDestroyed()' on the way to calling NotificationCenter::disconnectFrame(). So any crash is still safely avoided.

Unless there's a good reason to expect the Document/ScriptExecutionContext to be destroyed by the time notification.RequestPermission() is called in the test the new result is valid.

Can anyone point to why it should be destroyed by that time?