Bug 913823 - enable some net xpcshell tests that have been disabled because of cache2, r=michal

--HG--
extra : rebase_source : fba8cea900333bee5ef026446fbf48ed56a518ae
This commit is contained in:
Honza Bambas 2016-07-18 09:03:00 +02:00
parent b02c59194a
commit 9ce4e1672b
3 changed files with 0 additions and 82 deletions

View File

@ -75,12 +75,6 @@ function append_datafile(status, entry)
}
function run_test() {
if (newCacheBackEndUsed()) {
// Needs limit preferences
do_check_true(true, "This test doesn't run with the new cache backend, the test or the cache needs to be fixed");
return;
}
do_get_profile();
// clear the cache

View File

@ -1,75 +0,0 @@
var _ios;
var KEY_CORRUPT_SECINFO = "http://corruptSecurityInfo/";
var ENTRY_DATA = "foobar";
function create_scriptable_input(unscriptable_input) {
var istream = Cc["@mozilla.org/scriptableinputstream;1"].
createInstance(Ci.nsIScriptableInputStream);
istream.init(unscriptable_input);
return istream;
}
function write_data(entry) {
var ostream = entry.openOutputStream(0);
if (ostream.write(ENTRY_DATA, ENTRY_DATA.length) != ENTRY_DATA.length) {
do_throw("Could not write all data!");
}
ostream.close();
}
function continue_failure(status, entry) {
// Make sure we couldn't open this for reading
do_check_eq(status, Cr.NS_ERROR_CACHE_KEY_NOT_FOUND);
// Make sure the cache is empty
get_device_entry_count("disk", null, function(count, consumption) {
do_check_eq(count, 0);
do_check_eq(consumption, 0);
run_next_test();
});
}
function try_read_corrupt_secinfo() {
asyncOpenCacheEntry(KEY_CORRUPT_SECINFO,
"disk", Ci.nsICacheStorage.OPEN_READONLY, null,
continue_failure);
}
function write_corrupt_secinfo(status, entry) {
entry.setMetaDataElement("security-info", "blablabla");
write_data(entry);
try {
entry.close();
} catch (e) {
do_throw("Unexpected exception closing corrupt entry: " + e);
}
try_read_corrupt_secinfo();
}
function test_corrupt_secinfo() {
asyncOpenCacheEntry(KEY_CORRUPT_SECINFO,
"disk", Ci.nsICacheStorage.OPEN_TRUNCATE, null,
write_corrupt_secinfo);
}
function run_test() {
if (newCacheBackEndUsed()) {
// broken sec info should doom a cache entry (when broken sec info is written, load should fail with NOT_FOUND)
do_check_true(true, "This test doesn't run with the new cache backend, the test or the cache needs to be fixed");
return;
}
// Make sure we have a cache to use
do_get_profile();
// Make sure the cache is empty
evict_cache_entries();
// Add new tests at the end of this section
add_test(test_corrupt_secinfo);
// Let's get going!
run_next_test();
}

View File

@ -165,7 +165,6 @@ skip-if = os == "android"
[test_bug667907.js]
[test_bug667818.js]
[test_bug669001.js]
[test_bug712914_secinfo_validation.js]
[test_bug770243.js]
[test_bug894586.js]
# Allocating 4GB might actually succeed on 64 bit machines