<?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>213190</bug_id>
          
          <creation_ts>2020-06-15 05:19:47 -0700</creation_ts>
          <short_desc>[GTK]  WebKitPolicyClient new-window-policy is racey</short_desc>
          <delta_ts>2020-06-15 05:22:56 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=184845</see_also>
          <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="Charlie Turner">cturner</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1662609</commentid>
    <comment_count>0</comment_count>
    <who name="Charlie Turner">cturner</who>
    <bug_when>2020-06-15 05:19:47 -0700</bug_when>
    <thetext>In this function in WebKitPolicyClient test,

void beforeAll()
{
    kServer = new WebKitTestServer();
    kServer-&gt;run(serverCallback);

    PolicyClientTest::add(&quot;WebKitPolicyClient&quot;, &quot;navigation-policy&quot;, testNavigationPolicy);   // 1
    PolicyClientTest::add(&quot;WebKitPolicyClient&quot;, &quot;response-policy&quot;, testResponsePolicy);       // 2
    PolicyClientTest::add(&quot;WebKitPolicyClient&quot;, &quot;new-window-policy&quot;, testNewWindowPolicy);    // 3
}

If you run any permutations where 3 is not last, you will hit assertions. Placing 3 first gives it the best chance of failing.

The issue is caused due to the piggy timeouts in the new window policy test, they come with a comment,

    // Using a short timeout is a bit ugly here, but it&apos;s hard to get around because if we block
    // the new window signal we cannot halt the main loop in the create callback. If we
    // halt the main loop in the policy decision, the create callback never executes.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>