W3C home > Mailing lists > Public > public-html-commits@w3.org > January 2010

html5/tests/submission/Microsoft/windowobject security_location_0.htm,NONE,1.1

From: Kris Krueger via cvs-syncmail <cvsmail@w3.org>
Date: Sun, 10 Jan 2010 23:49:21 +0000
To: public-html-commits@w3.org
Message-Id: <E1NU7X7-00053y-19@lionel-hutz.w3.org>
Update of /sources/public/html5/tests/submission/Microsoft/windowobject
In directory hutz:/tmp/cvs-serv19257/submission/Microsoft/windowobject

Added Files:
	security_location_0.htm 
Log Message:
Create simple folder structure and simple test case for testing the window object.


--- NEW FILE: security_location_0.htm ---
<!DOCTYPE html>
<html>
    <head>
        <title>HTML 5 Test Suite: Window Object Security</title>
        <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
        <link rel="help" href="http://www.w3.org/TR/html5/browsers.html" />
        <meta name="assert" content="access location object from different origins doesn't raise SECURITY_ERR exception" />
    </head>
    <body>
        <div id='testdescription'>Test passes if the word PASS appears below.</div>
        <script type="text/javascript">
            function RunTest()
            {
                // Add more tests upon passing increment the 'count'
                var ExpectedPasses = 1;
                var ActualPasses   = 0;
            
                ActualPasses = locationObjectTest();
                
                if (ExpectedPasses == ActualPasses)
                {
                    document.getElementById('testresult').innerText = 'Pass';
                }

                document.getElementById('testspassed').innerText = ActualPasses + "/" + ExpectedPasses;

            }
            function locationObjectTest()
            {
                var frame = document.getElementById('testframe');

                try
                {
                    frame.setAttribute('onload', '');
                    frame.contentWindow.location = 'http://dev.w3.org/';

                    return 1;
                }
                catch(exc)
                {
                    return 0;
                }
            }
        </script>
        <span id='testresult'>FAIL</span>
        <span id='testspassed'>0</span>
        <iframe id='testframe' src="http://www.w3.org/" style="visibility: hidden; width: 0px; height:0px;" onload="RunTest()">Test Frame</iframe>
    </body>
</html> 
Received on Sunday, 10 January 2010 23:49:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 10 January 2010 23:49:26 GMT