<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
    jsTestIsAsync = true;
    description("Tests how the performance object works when it's owning window is not fully active due to navigation.");

    var perfFromInitialFrame;

    // Called by initialFrame.html
    function initialFrameLoaded()
    {
        var otherWindow = document.getElementById("frame").contentWindow;
        perfFromInitialFrame = otherWindow.performance;
        otherWindow.location.href = "secondFrame.html";
    }

    // Called by secondFrame.html
    function secondFrameLoaded()
    {
        // This should not crash.
        value = perfFromInitialFrame.now();

        shouldNotBe('value', 'undefined');

        finishJSTest();
    }
</script>
<script src="../../resources/js-test-post.js"></script>
<iframe id="frame" src="resources/initialFrame.html"></iframe>
</body>
</html>
