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

Side by Side 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 unified diff | Download patch
OLDNEW
1 function expectBufferValue(bytesPerElement, expectedValues, buffer) { 1 function expectBufferValue(bytesPerElement, expectedValues, buffer) {
2 expectedBufferValues = expectedValues; 2 expectedBufferValues = expectedValues;
3 var arrayClass; 3 var arrayClass;
4 if (bytesPerElement == 1) 4 if (bytesPerElement == 1)
5 arrayClass = Uint8Array; 5 arrayClass = Uint8Array;
6 else 6 else
7 arrayClass = Uint16Array; 7 arrayClass = Uint16Array;
8 bufferView = new arrayClass(buffer); 8 bufferView = new arrayClass(buffer);
9 shouldBe("bufferView.length", "expectedBufferValues.length"); 9 shouldBe("bufferView.length", "expectedBufferValues.length");
10 var success = (bufferView.length == expectedBufferValues.length); 10 var success = (bufferView.length == expectedBufferValues.length);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return; 86 return;
87 } else { 87 } else {
88 self.thrownException = e; 88 self.thrownException = e;
89 self.expectedException = serializeExceptionValue; 89 self.expectedException = serializeExceptionValue;
90 shouldBe("thrownException.code", "expectedException"); 90 shouldBe("thrownException.code", "expectedException");
91 return; 91 return;
92 } 92 }
93 } 93 }
94 expectBufferValue(bytesPerElement, values, serialized); 94 expectBufferValue(bytesPerElement, values, serialized);
95 } 95 }
96
97 function _testBlobSerialization() {
kinuko 2013/10/02 15:41:39 nit: Unlike _testSerialization we're calling this
michaeln 2013/10/02 20:09:01 Do you know the reasons for that layer of indirect
98 debug("");
99 self.blobObj1 = new Blob(['Hi'], {type: 'text/plain'});
100 self.blobObj2 = internals.deserializeBuffer(internals.serializeObject(blobOb j1));
101 shouldBeTrue("areValuesIdentical(blobObj1, blobObj2)");
kinuko 2013/10/02 15:41:39 areValuesIdentical only checks object properties,
michaeln 2013/10/02 20:09:01 i could use sync xhr with public blob urls to test
michaeln 2013/10/02 20:30:40 Done.
102 self.dictionaryWithBlob1 = {blob: blobObj1, string: 'stringValue'};
103 self.dictionaryWithBlob2 = internals.deserializeBuffer(internals.serializeOb ject(dictionaryWithBlob1));
104 shouldBeTrue("areValuesIdentical(dictionaryWithBlob1, dictionaryWithBlob2)") ;
105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698