chromium/third_party/blink/web_tests/http/tests/security/xss-DENIED-defineProperty.html

<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
var o = Object;
function finish()
{
    if (Object.getOwnPropertyDescriptor(this, "Object").value === o)
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of Object constructor not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of Object constructor was allowed!<br/>";

    if (Object.getOwnPropertyDescriptor(this, "newProperty") === undefined)
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of new property not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of new property was allowed!<br/>";

    if (location.hash.length == 0)
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of location.hash not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of location.hash was allowed!<br/>";

    if (location.search.length == 0)
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of location.search not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of location.search was allowed!<br/>";

    if (!("newProperty" in location))
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of location.newProperty not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of location.newProperty was allowed!<br/>";

    if (location.reload != "hax0red")
        document.getElementById("console").innerHTML += "PASS: cross-site assignment of location.reload not allowed<br/>";
    else
        document.getElementById("console").innerHTML += "FAIL: cross-site assignment of location.reload was allowed!<br/>";

    if (window.testRunner)
        testRunner.notifyDone();
}
</script>

<body onload="finish()">
    <iframe width=70% height=300 src="http://localhost:8000/security/resources/xss-DENIED-defineProperty-attacker.html"></iframe>
<div id="console"></div>
</body>
</html>