chromium/third_party/blink/web_tests/fast/frames/iframe-js-url-clientWidth.html

<script>
if (window.testRunner)
    testRunner.dumpAsText();
    
function log(s)
{
    document.getElementById('console').appendChild(document.createTextNode(s));
}

function shouldBe(a, b)
{
    var evalA;
    try {
        evalA = eval(a)
    } catch (e) {
        evalA = 'Caught exception: ' + e;
    }
    
    if (evalA == b)
        log('PASS: ' + a + ' should be ' + b + ' and is.\n');
    else
        log('FAIL: ' + a + ' should be ' + b + ' but instead is ' + evalA + '.\n');
}
</script>
<p>
This page tests whether an iframe correctly reports renderer-dependent values
when executing a javascript: load. If the test passes, you'll see a series of
'PASS' messages below.
</p>
<hr>
<pre id="console"></pre>
<iframe
    name="iframe"
    style="width: 250px; height: 250px; border: 1px solid black; background-color:red;"
    src="javascript:
        top.shouldBe('iframe.frameElement.clientWidth', 250);
        top.shouldBe('iframe.frameElement.clientHeight', 250);
    "
></iframe>