summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webstorage/storage_local_setitem_quotaexceedederr.window.js
blob: fff7d6444a039e4fbc9795c5fbab823c80b170de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
test(function() {
    localStorage.clear();

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

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

    localStorage.clear();
}, "Throws QuotaExceededError when the quota has been exceeded");