chromium/third_party/blink/web_tests/fast/dom/Window/resources/closure-access-after-navigation-window-child-2.html

<script>
    opener.logTitle("Child 2 loaded.");
    opener.test("getObjectOfChild1", "myVal");
    opener.test("getGlobalOfChild1", "myGlobalVal");

    Object.prototype.myVal = "child2";
    var myGlobal = {
        myGlobalVal: "child2"
    };

    opener.logTitle("Child 2 objects set.");

    opener.getObjectOfChild2 = function()
    {
        return {};
    };

    opener.getGlobalOfChild2 = function()
    {
        return myGlobal;
    };

    opener.test("getObjectOfChild1", "myVal");
    opener.test("getGlobalOfChild1", "myGlobalVal");
    opener.test("getObjectOfChild2", "myVal");
    opener.test("getGlobalOfChild2", "myGlobalVal");
    opener.test("getObjectOfParent", "myVal");
    opener.test("getGlobalOfParent", "myGlobalVal");

    onload = function()
    {
        opener.done();
    }
</script>
Child 2