cache-offline.js revision df4c27342962c3f93a19eb762cb2c22584b186c6
// Set up the page
ARRAYASSERT = Y.ArrayAssert,
tearDown = function() {
};
name: "Class Tests",
testDefaults: function() {
this.cache = new Y.CacheOffline();
},
testDestructor: function() {
this.cache = new Y.CacheOffline();
}
});
name: "Basic Tests",
testMaxDefault: function() {
this.cache = new Y.CacheOffline();
},
testMaxConfig: function() {
},
testMaxSet: function() {
this.cache = new Y.CacheOffline();
},
testMaxSetNull: function() {
this.cache = new Y.CacheOffline();
},
testMaxSetNegative: function() {
},
testRetrieve: function() {
this.cache = new Y.CacheOffline(),
},
testNoExpires: function() {
},
testExpiresNumber: function() {
this.wait(function(){
}, 50);
},
testExpiresDate: function() {
},
testNoMatch: function() {
this.cache = new Y.CacheOffline();
},
testFlush: function() {
this.cache = new Y.CacheOffline();
},
testFlushAll: function() {
this.cache = new Y.CacheOffline();
if(window.localStorage) {
}
Y.CacheOffline.flushAll();
if(window.localStorage) {
}
}
});
name: "Event Tests",
testAdd: function() {
method: "handleAdd",
})]
});
this.cache = new Y.CacheOffline();
},
testFlush: function() {
method: "handleFlush",
});
this.cache = new Y.CacheOffline();
},
testRequest: function() {
method: "handleRequest",
})]
});
this.cache = new Y.CacheOffline();
},
testRetrieveSuccess: function() {
method: "handleRetrieve",
})]
});
this.cache = new Y.CacheOffline();
},
testRetrieveFailure: function() {
method: "handleRetrieve",
callCount: 0
});
this.cache = new Y.CacheOffline();
},
testCancelAdd: function() {
this.cache = new Y.CacheOffline();
e.preventDefault();
}, this, true);
// Test the cancel
},
testCancelFlush: function() {
this.cache = new Y.CacheOffline();
e.preventDefault();
}, this, true);
// Test the cancel
}
});
name: "Entry Management Tests",
testNonUniqueKeys: function() {
},
testUniqueKeys: function() {
}/*,
NOT SUPPORTED IN CACHEOFFLINE
testFreshness: function() {
this.cache = new Y.CacheOffline();
this.cache.add(1, "a");
this.cache.add(2, "b");
this.cache.add(3, "c");
this.cache.retrieve(1);
ASSERT.areSame(3, this.cache.get("size"), "Expected 3 entries.");
ASSERT.areSame(1, this.cache.get("entries")[2].request, "Expected entry to be refreshed.");
}*/
});
name: "Invalid Value Tests",
testUndefinedRequest: function() {
this.cache = new Y.CacheOffline();
},
testNullRequest: function() {
this.cache = new Y.CacheOffline();
},
testNaNRequest: function() {
this.cache = new Y.CacheOffline();
},
testEmptyStringRequest: function() {
this.cache = new Y.CacheOffline();
}
});
});