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

Side by Side Diff: mojo/public/js/bindings/tests/codec_unittests.js

Issue 411553003: Validate incoming JS Message Headers: test message parser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Factored common Buffer class, moved JS binding tests 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 define([ 5 define([
abarth-chromium 2014/07/23 02:13:52 Sorry, I was unclear. I think it's fine for the _
hansmuller 2014/07/23 18:06:35 OK, I've moved the unit tests up the parent direct
6 "gin/test/expect", 6 "gin/test/expect",
7 "mojo/public/js/bindings/codec", 7 "mojo/public/js/bindings/codec",
8 "mojo/public/interfaces/bindings/tests/sample_service.mojom", 8 "mojo/public/interfaces/bindings/tests/sample_service.mojom",
9 ], function(expect, codec, sample) { 9 ], function(expect, codec, sample) {
10 testBar(); 10 testBar();
11 testFoo(); 11 testFoo();
12 testTypes(); 12 testTypes();
13 testAlign(); 13 testAlign();
14 testUtf8(); 14 testUtf8();
15 this.result = "PASS"; 15 this.result = "PASS";
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 expect(actualMemory.length).toEqual(expectedMemory.length); 219 expect(actualMemory.length).toEqual(expectedMemory.length);
220 expect(actualMemory).toEqual(expectedMemory); 220 expect(actualMemory).toEqual(expectedMemory);
221 221
222 var reader = new codec.MessageReader(message); 222 var reader = new codec.MessageReader(message);
223 expect(reader.payloadSize).toBe(payloadSize); 223 expect(reader.payloadSize).toBe(payloadSize);
224 expect(reader.messageName).toBe(messageName); 224 expect(reader.messageName).toBe(messageName);
225 var str2 = reader.decoder.decodeStringPointer(); 225 var str2 = reader.decoder.decodeStringPointer();
226 expect(str2).toEqual(str); 226 expect(str2).toEqual(str);
227 } 227 }
228 }); 228 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698