dom/tests/mochitest/sessionstorage/test_sessionStorageFromChrome.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageFromChrome.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<head>
     1.6 +<title>sessionStorage basic test</title>
     1.7 +
     1.8 +<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +<script type="text/javascript">
    1.12 +
    1.13 +function startTest()
    1.14 +{
    1.15 +  // Check that we do not crash when we access the sessionStorage object from
    1.16 +  // chrome and that we throw.  See bug 404453.
    1.17 +  var exceptionCaught = false;
    1.18 +  try {
    1.19 +    sessionStorage;
    1.20 +  }
    1.21 +  catch (e) {
    1.22 +    is(e.result, Components.results.NS_ERROR_NOT_AVAILABLE,
    1.23 +       "Testing that we get the expected exception.");
    1.24 +    exceptionCaught = true;
    1.25 +  }
    1.26 +  is(exceptionCaught, true, "Testing that an exception was thrown.");
    1.27 +
    1.28 +  SimpleTest.finish();
    1.29 +}
    1.30 +
    1.31 +</script>
    1.32 +
    1.33 +</head>
    1.34 +
    1.35 +<body onload="startTest();">
    1.36 +</body>
    1.37 +</html>

mercurial