OLD | NEW |
---|---|
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 Loading... | |
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 } | |
OLD | NEW |