<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>53868</bug_id>
          
          <creation_ts>2011-02-06 02:42:03 -0800</creation_ts>
          <short_desc>fast/notifications/notifications-document-close-crash.html fails and flakes after r77738</short_desc>
          <delta_ts>2024-02-18 16:49:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Hogan">robert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>eric</cc>
    
    <cc>inferno</cc>
    
    <cc>japhet</cc>
    
    <cc>mihaip</cc>
    
    <cc>ossy</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>zmo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>346260</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2011-02-06 02:42:03 -0800</bug_when>
    <thetext>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
PASS

Failure is because of:

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

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

}

&apos;context&apos; above used to be a local copy of ActiveDomObject::scriptExecutionContext() but is now the scriptExectionContext() (an upcast of Document) for the page&apos;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 &apos;if (!exec-&gt;argument(0).isObject())&apos; instead.

Not clear to me why this is happening only for Qt, so skipping for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346261</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2011-02-06 02:47:19 -0800</bug_when>
    <thetext>Committed r77764: &lt;http://trac.webkit.org/changeset/77764&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346262</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2011-02-06 02:49:14 -0800</bug_when>
    <thetext>Reopening for fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>346271</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-02-06 05:46:17 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/77764 might have broken Leopard Intel Release (Tests)
The following tests are not passing:
platform/mac/fast/AppleScript/date.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349371</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Hogan">robert</who>
    <bug_when>2011-02-10 14:14:19 -0800</bug_when>
    <thetext>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 &apos;if (!exec-&gt;argument(0).isObject())&apos; instead is because &apos;script()-&gt;clearScriptObjects();&apos; has been called in &apos;void Frame::pageDestroyed()&apos; on the way to calling NotificationCenter::disconnectFrame(). So any crash is still safely avoided.

Unless there&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>357595</commentid>
    <comment_count>5</comment_count>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2011-02-24 17:25:18 -0800</bug_when>
    <thetext>Re-titling bug since the crash affects Chromium too (and perhaps other platforms):

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&amp;tests=fast%2Fnotifications%2Fnotifications-document-close-crash.html&amp;showExpectations=true&amp;group=%40ToT%20-%20chromium.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014981</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-18 16:49:28 -0800</bug_when>
    <thetext>Test is gone with - https://github.com/WebKit/WebKit/commit/34d6c0d0c6a163321646de3e58e9e2dee5f9d739

Nothing to do it - it was for legacy Notifications.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>