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

Side by Side Diff: mojo/edk/js/tests/js_to_cpp_tests.js

Issue 2844143002: Mojo C++ bindings: reject messages version 2 with null payload pointer. (Closed)
Patch Set: . Created 3 years, 7 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
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/public/cpp/bindings/lib/message.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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('mojo/edk/js/tests/js_to_cpp_tests', [ 5 define('mojo/edk/js/tests/js_to_cpp_tests', [
6 'console', 6 'console',
7 'mojo/edk/js/tests/js_to_cpp.mojom', 7 'mojo/edk/js/tests/js_to_cpp.mojom',
8 'mojo/public/js/bindings', 8 'mojo/public/js/bindings',
9 'mojo/public/js/connector', 9 'mojo/public/js/connector',
10 'mojo/public/js/core', 10 'mojo/public/js/core',
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 stopSignalled = true; 108 stopSignalled = true;
109 return false; 109 return false;
110 }; 110 };
111 111
112 while (!stopSignalled) { 112 while (!stopSignalled) {
113 messagePipe = core.createMessagePipe(); 113 messagePipe = core.createMessagePipe();
114 writeMessagePipe(messagePipe, sampleMessage); 114 writeMessagePipe(messagePipe, sampleMessage);
115 arg.message_handle = messagePipe.handle1; 115 arg.message_handle = messagePipe.handle1;
116 116
117 this.cppSide_.bitFlipResponse(createEchoArgsList(arg)); 117 this.cppSide_.bitFlipResponse(createEchoArgsList(arg), null);
118 118
119 core.close(messagePipe.handle0); 119 core.close(messagePipe.handle0);
120 iteration += 1; 120 iteration += 1;
121 } 121 }
122 122
123 proto.accept = proto.realAccept; 123 proto.accept = proto.realAccept;
124 proto.realAccept = null; 124 proto.realAccept = null;
125 this.cppSide_.testFinished(); 125 this.cppSide_.testFinished();
126 }; 126 };
127 127
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 sampleData[i] = i; 206 sampleData[i] = i;
207 } 207 }
208 sampleMessage = new Uint8Array(DATA_PIPE_PARAMS.capacityNumBytes); 208 sampleMessage = new Uint8Array(DATA_PIPE_PARAMS.capacityNumBytes);
209 for (i = 0; i < sampleMessage.length; ++i) { 209 for (i = 0; i < sampleMessage.length; ++i) {
210 sampleMessage[i] = 255 - i; 210 sampleMessage[i] = 255 - i;
211 } 211 }
212 retainedJsSide = new JsSideConnection; 212 retainedJsSide = new JsSideConnection;
213 retainedJsSide.binding.bind(jsSideRequestHandle); 213 retainedJsSide.binding.bind(jsSideRequestHandle);
214 }; 214 };
215 }); 215 });
OLDNEW
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/public/cpp/bindings/lib/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698