netwerk/test/unit/test_cache2-18-not-valid.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 function run_test()
     2 {
     3   do_get_profile();
     5   if (!newCacheBackEndUsed()) {
     6     do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
     7     return;
     8   }
    10   // Open for write, write but expect it to fail, since other callback will recreate (and doom)
    11   // the first entry before it opens output stream (note: in case of problems the DOOMED flag
    12   // can be removed, it is not the test failure when opening the output stream on recreated entry.
    13   asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    14     new OpenCallback(NEW|DOOMED, "v1m", "v1d", function(entry) {
    15       // Open for rewrite (don't validate), write different meta and data
    16       asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    17         new OpenCallback(NOTVALID|RECREATE, "v2m", "v2d", function(entry) {
    18           // And check...
    19           asyncOpenCacheEntry("http://nv/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    20             new OpenCallback(NORMAL, "v2m", "v2d", function(entry) {
    21               finish_cache2_test();
    22             })
    23           );
    24         })
    25       );
    26     })
    27   );
    29   do_test_pending();
    30 }

mercurial