зеркало из https://github.com/mozilla/gecko-dev.git
[not part of build] Added metadata test.
This commit is contained in:
Родитель
7e6b3bd5b2
Коммит
e14f9a7fdc
|
@ -44,15 +44,26 @@ if (output.write("foo", 3) == 3)
|
|||
print("disk cache write works!");
|
||||
else
|
||||
print("disk cache write broken!");
|
||||
|
||||
// store some metadata.
|
||||
outputEntry.setMetaDataElement("size", "3");
|
||||
|
||||
output.close();
|
||||
outputEntry.markValid();
|
||||
outputEntry.close();
|
||||
|
||||
var inputEntry = openCacheEntry(nsICache.ACCESS_READ);
|
||||
var input = wrapInputStream(inputEntry.transport.openInputStream(0, -1, 0));
|
||||
|
||||
if (input.read(input.available()) == "foo")
|
||||
print("disk cache read works!");
|
||||
else
|
||||
print("disk cache read broken!");
|
||||
|
||||
if (inputEntry.getMetaDataElement("size") == "3")
|
||||
print("disk cache metadata works!");
|
||||
else
|
||||
print("disk cache metadata broken!");
|
||||
|
||||
input.close();
|
||||
inputEntry.close();
|
||||
|
|
Загрузка…
Ссылка в новой задаче