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

Side by Side Diff: mojo/public/bindings/js/core_unittests.js

Issue 69843003: Implement Mojo message codec in JavaScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Aaron's comments Created 7 years, 1 month 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
« no previous file with comments | « mojo/public/bindings/js/core.cc ('k') | mojo/public/bindings/js/global.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(["gtest", "core"], function(gtest, core) { 5 define([
6 "gtest",
7 "mojo/public/bindings/js/core",
8 ], function(gtest, core) {
6 runWithPipe(testNop); 9 runWithPipe(testNop);
7 runWithPipe(testReadAndWriteMessage); 10 runWithPipe(testReadAndWriteMessage);
8 this.result = "PASS"; 11 this.result = "PASS";
9 12
10 function runWithPipe(test) { 13 function runWithPipe(test) {
11 var pipe = core.createMessagePipe(); 14 var pipe = core.createMessagePipe();
12 15
13 test(pipe); 16 test(pipe);
14 17
15 var result0 = core.close(pipe.handle0); 18 var result0 = core.close(pipe.handle0);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 "mesage.bytesRead is " + mesage.bytesRead); 52 "mesage.bytesRead is " + mesage.bytesRead);
50 gtest.expectEqual(mesage.handles.length, 0, 53 gtest.expectEqual(mesage.handles.length, 0,
51 "mesage.handles.length is " + mesage.handles.length); 54 "mesage.handles.length is " + mesage.handles.length);
52 55
53 for (var i = 0; i < mesage.bytesRead; ++i) { 56 for (var i = 0; i < mesage.bytesRead; ++i) {
54 gtest.expectEqual(receiverData[i], (i * i) & 0xFF, 57 gtest.expectEqual(receiverData[i], (i * i) & 0xFF,
55 "receiverData[" + i + "] is " + receiverData[i]); 58 "receiverData[" + i + "] is " + receiverData[i]);
56 } 59 }
57 } 60 }
58 }); 61 });
OLDNEW
« no previous file with comments | « mojo/public/bindings/js/core.cc ('k') | mojo/public/bindings/js/global.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698