chromium/third_party/blink/web_tests/fullscreen/model/fully-exit-fullscreen-nested.html

<!DOCTYPE html>
<title>Fully exit fullscreen with two elements on stack</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<script src="fully-exit-fullscreen.js"></script>
<div id="log"></div>
<div id="first">
    <div id="last"></div>
</div>
<script>
async_test(function(t)
{
    var first = document.getElementById("first");
    trusted_request(t, first);
    document.onfullscreenchange = t.step_func(function()
    {
        assert_equals(document.fullscreenElement, first);
        var last = document.getElementById("last");
        trusted_request(t, last);
        document.onfullscreenchange = t.step_func(function()
        {
            assert_equals(document.fullscreenElement, last);
            trusted_click(t, fully_exit_fullscreen.bind(null, document), last);
            document.onfullscreenchange = t.step_func(function()
            {
                assert_equals(document.fullscreenElement, null);
                t.done();
            });
        });
    });
});
</script>