Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: LayoutTests/fast/storage/resources/serialized-script-value.js

Issue 23992003: blob hacking webcore style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/storage/serialized-script-value.html » ('j') | public/web/WebBlob.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/storage/resources/serialized-script-value.js
diff --git a/LayoutTests/fast/storage/resources/serialized-script-value.js b/LayoutTests/fast/storage/resources/serialized-script-value.js
index 48731e85f5ded40d6e26e811aefe00240dde90c0..17a719422192df442d68dc00acecf224ac3d333e 100644
--- a/LayoutTests/fast/storage/resources/serialized-script-value.js
+++ b/LayoutTests/fast/storage/resources/serialized-script-value.js
@@ -93,3 +93,24 @@ function _testSerialization(bytesPerElement, obj, values, oldFormat, serializeEx
}
expectBufferValue(bytesPerElement, values, serialized);
}
+
+function testBlobSerialization() {
+ debug("");
+ self.blobObj1 = new Blob(['Hi'], {type: 'text/plain'});
+ self.blobObj2 = internals.deserializeBuffer(internals.serializeObject(blobObj1));
+ shouldBeTrue("areValuesIdentical(blobObj1, blobObj2)");
+ self.dictionaryWithBlob1 = {blob: blobObj1, string: 'stringValue'};
+ self.dictionaryWithBlob2 = internals.deserializeBuffer(internals.serializeObject(dictionaryWithBlob1));
+ shouldBeTrue("areValuesIdentical(dictionaryWithBlob1, dictionaryWithBlob2)");
+
+ // Compare contents too.
+ var xhr1 = new XMLHttpRequest();
+ xhr1.open("GET", URL.createObjectURL(self.blobObj1), false);
+ xhr1.send();
+ self.blobContent1 = xhr1.response;
+ var xhr2 = new XMLHttpRequest();
+ xhr2.open("GET", URL.createObjectURL(self.blobObj2), false);
+ xhr2.send();
+ self.blobContent2 = xhr2.response;
+ shouldBe("self.blobContent1", "self.blobContent2");
+}
« no previous file with comments | « no previous file | LayoutTests/fast/storage/serialized-script-value.html » ('j') | public/web/WebBlob.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698