netwerk/test/unit/test_cache2-15-conditional-304.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   // Open for write, write
     6   asyncOpenCacheEntry("http://304/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
     7     new OpenCallback(NEW, "31m", "31d", function(entry) {
     8       // Open normally but wait for validation from the server
     9       asyncOpenCacheEntry("http://304/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    10         new OpenCallback(REVAL, "31m", "31d", function(entry) {
    11           // emulate 304 from the server
    12           do_execute_soon(function() {
    13             entry.setValid(); // this will trigger OpenCallbacks bellow
    14           });
    15         })
    16       );
    18       var mc = new MultipleCallbacks(3, finish_cache2_test);
    20       asyncOpenCacheEntry("http://304/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    21         new OpenCallback(NORMAL, "31m", "31d", function(entry) {
    22           mc.fired();
    23         })
    24       );
    25       asyncOpenCacheEntry("http://304/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    26         new OpenCallback(NORMAL, "31m", "31d", function(entry) {
    27           mc.fired();
    28         })
    29       );
    30       asyncOpenCacheEntry("http://304/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
    31         new OpenCallback(NORMAL, "31m", "31d", function(entry) {
    32           mc.fired();
    33         })
    34       );
    35     })
    36   );
    38   do_test_pending();
    39 }

mercurial