https://github.com/web-platform-tests/wpt
Raw File
Tip revision: fa324625246ca3fa5e5d8fdb9caf43650b2943b9 authored by Guido Urdaneta on 03 October 2017, 11:44:18 UTC
Add SpeechRecognition Web Platform Tests
Tip revision: fa32462
storage_session_setitem_quotaexceedederr.html
<!DOCTYPE HTML>
<html>
 <head>
  <title>WebStorage Test: sessionStorage - setItem throws QuotaExceededError</title>
  <meta name="timeout" content="long">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
    <h1>storage_session_setItem_QUOTA_EXCEEDED_ERR</h1>
    <div id="log"></div>
    <script>
        test(function() {
            sessionStorage.clear();

            var index = 0;
            var key = "name";
            var val = "x".repeat(1024);

            assert_throws("QUOTA_EXCEEDED_ERR", function() {
                while (true) {
                    index++;
                    sessionStorage.setItem("" + key + index, "" + val + index);
                }
            });

            sessionStorage.clear();
        }, "Throws QuotaExceededError when the quota has been exceeded");
    </script>
 </body>
</html>
back to top