<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - webkitDisplayingFullscreen may return false in webkitfullscreenchange event handler"
   href="https://bugs.webkit.org/show_bug.cgi?id=165755">165755</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>webkitDisplayingFullscreen may return false in webkitfullscreenchange event handler
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Media Elements
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>graouts&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The test at media/modern-media-controls/fullscreen-support/fullscreen-support-click.html is flaky, try running it as follows:

Tools/Scripts/run-webkit-tests --release --time-out-ms=5000 --no-sample-on-timeout --exit-after-n-failures=1 --iterations=200 media/modern-media-controls/fullscreen-support/fullscreen-support-click.html

When it fails, you can see that the cause is that media.webkitDisplayingFullscreen returns false whereas it should return true. By deferring the assertion to the next run loop, the test never fails:

media.addEventListener(&quot;webkitfullscreenchange&quot;, () =&gt; {
    // We use a timeout here as sometimes media.webkitDisplayingFullscreen
    // wouldn't return true just yet after entering fullscreen.
    setTimeout(() =&gt; {
        shouldBeTrue(&quot;media.webkitDisplayingFullscreen&quot;);
        container.remove();
        media.remove();
        finishJSTest();
    });
});

While I can work around this to fix this test, we should find what the root cause for this is.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>