https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e92ca1fad000cdc17052357ec324e6cfa20b5585 authored by Kenichi Ishibashi on 29 March 2018, 08:11:29 UTC
Remove create_file_system_file()
Tip revision: e92ca1f
storage_local_setitem_quotaexceedederr.html
<!DOCTYPE HTML>
<html>
 <head>
  <title>WebStorage Test: localStorage - 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_local_setItem_QUOTA_EXCEEDED_ERR</h1>
    <div id="log"></div>
    <script>
        test(function() {
            localStorage.clear();

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

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

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