5 var data = "0123456789ABCDEFGHIJLKMNO";
6 for (i = 0; i < 13; i++) {
12 // Keep the output stream of the first entry in a global variable, so the
13 // CacheFile and its buffer isn't released before we write the data to the
20 // set max chunks memory so that only one full chunk fits within the limit
21 Services.prefs.setIntPref("browser.cache.disk.max_chunks_memory_usage", 300);
26 Ci.nsICacheStorage.OPEN_NORMALLY,
28 function (status, entry) {
29 Assert.equal(status, Cr.NS_OK);
30 var data = gen_200k();
31 oStr = entry.openOutputStream(0, data.length);
32 Assert.equal(data.length, oStr.write(data, data.length));
37 Ci.nsICacheStorage.OPEN_NORMALLY,
39 function (status1, entry1) {
40 Assert.equal(status1, Cr.NS_OK);
41 var oStr2 = entry1.openOutputStream(0, data.length);
42 do_check_throws_nsIException(
43 () => oStr2.write(data, data.length),
44 "NS_ERROR_OUT_OF_MEMORY"