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

Unified Diff: mojo/bindings/js/codec_unittests.js

Issue 377713004: Support packed arrays of booleans in Mojo messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified Decoder.prototype.decodeBoolArray() Created 6 years, 5 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 | mojo/public/interfaces/bindings/tests/sample_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/bindings/js/codec_unittests.js
diff --git a/mojo/bindings/js/codec_unittests.js b/mojo/bindings/js/codec_unittests.js
index fd49c73ad000183e165839b3cae595456e8a9ba7..e30acb52f511dd5b4acca43e91d398fc70afdb06 100644
--- a/mojo/bindings/js/codec_unittests.js
+++ b/mojo/bindings/js/codec_unittests.js
@@ -87,9 +87,13 @@ define([
foo.array_of_array_of_bools = [
[true], [false, true]
];
+ foo.array_of_bools = [
+ true, false, true, false, true, false, true, true
+ ];
+
var messageName = 31;
- var payloadSize = 280;
+ var payloadSize = 304;
var builder = new codec.MessageBuilder(messageName, payloadSize);
builder.encodeStruct(sample.Foo, foo);
@@ -99,10 +103,10 @@ define([
var expectedMemory = new Uint8Array([
/* 0: */ 16, 0, 0, 0, 2, 0, 0, 0,
/* 8: */ 31, 0, 0, 0, 0, 0, 0, 0,
- /* 16: */ 88, 0, 0, 0, 14, 0, 0, 0,
+ /* 16: */ 96, 0, 0, 0, 15, 0, 0, 0,
/* 24: */ 0xD5, 0xB4, 0x12, 0x02, 0x93, 0x6E, 0x01, 0,
/* 32: */ 5, 0, 0, 0, 0, 0, 0, 0,
- /* 40: */ 64, 0, 0, 0, 0, 0, 0, 0,
+ /* 40: */ 72, 0, 0, 0, 0, 0, 0, 0,
]);
// TODO(abarth): Test more of the message's raw memory.
var actualMemory = new Uint8Array(message.buffer.arrayBuffer,
@@ -135,6 +139,8 @@ define([
expect(foo2.extra_bars).toEqual(foo.extra_bars);
expect(foo2.name).toBe(foo.name);
expect(foo2.source).toEqual(foo.source);
+
+ expect(foo2.array_of_bools).toEqual(foo.array_of_bools);
}
function testTypes() {
« no previous file with comments | « no previous file | mojo/public/interfaces/bindings/tests/sample_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698