OLD | NEW |
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([ | 5 define([ |
6 "console", | 6 "console", |
7 "file", | 7 "file", |
8 "gin/test/expect", | 8 "gin/test/expect", |
9 "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom", | 9 "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom", |
10 "mojo/public/js/buffer", | 10 "mojo/public/js/buffer", |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 testMessageValidation("resp_boundscheck_", [ | 275 testMessageValidation("resp_boundscheck_", [ |
276 testInterface.BoundsCheckTestInterface.validateResponse]); | 276 testInterface.BoundsCheckTestInterface.validateResponse]); |
277 } | 277 } |
278 | 278 |
279 function testIntegratedMessageValidation(testFilesPattern, | 279 function testIntegratedMessageValidation(testFilesPattern, |
280 localFactory, | 280 localFactory, |
281 remoteFactory) { | 281 remoteFactory) { |
282 var testFiles = getMessageTestFiles(testFilesPattern); | 282 var testFiles = getMessageTestFiles(testFilesPattern); |
283 expect(testFiles.length).toBeGreaterThan(0); | 283 expect(testFiles.length).toBeGreaterThan(0); |
284 | 284 |
285 var testMessagePipe = new core.createMessagePipe(); | 285 var testMessagePipe = core.createMessagePipe(); |
286 expect(testMessagePipe.result).toBe(core.RESULT_OK); | 286 expect(testMessagePipe.result).toBe(core.RESULT_OK); |
287 var testConnection = new connection.TestConnection( | 287 var testConnection = new connection.TestConnection( |
288 testMessagePipe.handle1, localFactory, remoteFactory); | 288 testMessagePipe.handle1, localFactory, remoteFactory); |
289 | 289 |
290 for (var i = 0; i < testFiles.length; i++) { | 290 for (var i = 0; i < testFiles.length; i++) { |
291 var testMessage = readTestMessage(testFiles[i]); | 291 var testMessage = readTestMessage(testFiles[i]); |
292 var handles = new Array(testMessage.handleCount); | 292 var handles = new Array(testMessage.handleCount); |
293 | 293 |
294 var writeMessageValue = core.writeMessage( | 294 var writeMessageValue = core.writeMessage( |
295 testMessagePipe.handle0, | 295 testMessagePipe.handle0, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 testConformanceMessageValidation(); | 340 testConformanceMessageValidation(); |
341 testBoundsCheckMessageValidation(); | 341 testBoundsCheckMessageValidation(); |
342 testResponseConformanceMessageValidation(); | 342 testResponseConformanceMessageValidation(); |
343 testResponseBoundsCheckMessageValidation(); | 343 testResponseBoundsCheckMessageValidation(); |
344 testIntegratedMessageHeaderValidation(); | 344 testIntegratedMessageHeaderValidation(); |
345 testIntegratedResponseMessageValidation(); | 345 testIntegratedResponseMessageValidation(); |
346 testIntegratedRequestMessageValidation(); | 346 testIntegratedRequestMessageValidation(); |
347 | 347 |
348 this.result = "PASS"; | 348 this.result = "PASS"; |
349 }); | 349 }); |
OLD | NEW |