From 52bd7511724ff07f68a6ef961a5e3e6e739326ed Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 2 Mar 2001 05:00:34 +0000 Subject: [PATCH] [not part of build] Added metadata test. --- netwerk/test/TestDiskCache.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/netwerk/test/TestDiskCache.js b/netwerk/test/TestDiskCache.js index 3b51fb81ebc..91a55877b44 100644 --- a/netwerk/test/TestDiskCache.js +++ b/netwerk/test/TestDiskCache.js @@ -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();