Bug 913823 - enable some net xpcshell tests that have been disabled because of cache2, r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Mon, 18 Jul 2016 09:03:00 +0200
changeset 389932 bc148fa9498e0538ee4ea42e018c302f971490f6
parent 389931 10366f77d1559fd4c0c77da7933b1a74b470677c
child 389933 264ffcf6eb58f0915816e3048fb920f216971ae3
push id23566
push usertkuo@mozilla.com
push dateWed, 20 Jul 2016 10:57:43 +0000
reviewersmichal
bugs913823
milestone50.0a1
Bug 913823 - enable some net xpcshell tests that have been disabled because of cache2, r=michal
netwerk/test/unit/test_bug654926.js
netwerk/test/unit/test_bug712914_secinfo_validation.js
netwerk/test/unit/xpcshell.ini
--- a/netwerk/test/unit/test_bug654926.js
+++ b/netwerk/test/unit/test_bug654926.js
@@ -70,22 +70,16 @@ function append_datafile(status, entry)
   catch (ex) { }
 
   entry.close();
 
   do_test_finished();
 }
 
 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
   evict_cache_entries();
 
   asyncOpenCacheEntry("http://data/",
                       "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
                       write_datafile);
deleted file mode 100644
--- a/netwerk/test/unit/test_bug712914_secinfo_validation.js
+++ /dev/null
@@ -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();
-}
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -160,17 +160,16 @@ skip-if = os == "android"
 [test_bug654926.js]
 [test_bug654926_doom_and_read.js]
 [test_bug654926_test_seek.js]
 [test_bug659569.js]
 [test_bug660066.js]
 [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
 skip-if = bits != 32
 [test_bug935499.js]
 [test_bug1064258.js]
 [test_bug1218029.js]
 [test_udpsocket.js]