Bug 967862 - HTTP cache v2: fix xpcshell tests to be independent on difference between use-new-cache in CacheObserver and in preferences, r=michal

This commit is contained in:
Honza Bambas 2014-01-09 00:27:29 +01:00
parent c5f606dd7b
commit 97ca7571c8
8 changed files with 16 additions and 16 deletions

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Add entry to the memory storage
var mc = new MultipleCallbacks(5, function() {
// Check it's there by visiting the storage

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
asyncOpenCacheEntry("http://b/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
new OpenCallback(NEW|DOOMED, "b1m", "b1d", function(entry) {
entry.asyncDoom(

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
var mc = new MultipleCallbacks(3, function() {
var storage = getCacheStorage("disk");
storage.asyncEvictStorage(

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Open for write, write
asyncOpenCacheEntry("http://200/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
new OpenCallback(NEW, "21m", "21d", function(entry) {

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Open for write, write but expect it to fail, since other callback will recreate (and doom)
// the first entry before it opens output stream (note: in case of problems the DOOMED flag
// can be removed, it is not the test failure when opening the output stream on recreated entry.

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Open for write, write
asyncOpenCacheEntry("http://r206/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
new OpenCallback(NEW, "206m", "206part1-", function(entry) {

View File

@ -1,12 +1,12 @@
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Open for write, write
asyncOpenCacheEntry("http://r200/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
new OpenCallback(NEW, "200m1", "200part1a-", function(entry) {

View File

@ -2,13 +2,13 @@ Components.utils.import('resource://gre/modules/LoadContextInfo.jsm');
function run_test()
{
do_get_profile();
if (!newCacheBackEndUsed()) {
do_check_true(true, "This test doesn't run when the old cache back end is used since the behavior is different");
return;
}
do_get_profile();
// Create and check an entry anon disk storage
asyncOpenCacheEntry("http://anon1/", "disk", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.anonymous,
new OpenCallback(NEW, "an1", "an1", function(entry) {