| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 function testMessageValidation(prefix, filters) { | 221 function testMessageValidation(prefix, filters) { |
| 222 var testFiles = getMessageTestFiles(prefix); | 222 var testFiles = getMessageTestFiles(prefix); |
| 223 expect(testFiles.length).toBeGreaterThan(0); | 223 expect(testFiles.length).toBeGreaterThan(0); |
| 224 | 224 |
| 225 for (var i = 0; i < testFiles.length; i++) { | 225 for (var i = 0; i < testFiles.length; i++) { |
| 226 // TODO(hansmuller) Temporarily skipping array pointer overflow tests | 226 // TODO(hansmuller) Temporarily skipping array pointer overflow tests |
| 227 // because JS numbers are limited to 53 bits. | 227 // because JS numbers are limited to 53 bits. |
| 228 // TODO(yzshen) Skipping struct versioning tests (tests with "mthd11" | 228 // TODO(yzshen) Skipping struct versioning tests (tests with "mthd11" |
| 229 // in the name) because the feature is not supported in JS yet. | 229 // in the name) because the feature is not supported in JS yet. |
| 230 // TODO(yzshen) Skipping enum validation tests (tests with "enum" in the | |
| 231 // name) because the feature is not supported in JS yet. crbug.com/581390 | |
| 232 // TODO(rudominer): Temporarily skipping 'no-such-method', | 230 // TODO(rudominer): Temporarily skipping 'no-such-method', |
| 233 // 'invalid_request_flags', and 'invalid_response_flags' until additional | 231 // 'invalid_request_flags', and 'invalid_response_flags' until additional |
| 234 // logic in *RequestValidator and *ResponseValidator is ported from | 232 // logic in *RequestValidator and *ResponseValidator is ported from |
| 235 // cpp to js. | 233 // cpp to js. |
| 236 // TODO(crbug/640298): Implement max recursion depth for JS. | 234 // TODO(crbug/640298): Implement max recursion depth for JS. |
| 237 // TODO(crbug/628104): Support struct map keys for JS. | 235 // TODO(crbug/628104): Support struct map keys for JS. |
| 238 if (testFiles[i].indexOf("overflow") != -1 || | 236 if (testFiles[i].indexOf("overflow") != -1 || |
| 239 testFiles[i].indexOf("mthd11") != -1 || | 237 testFiles[i].indexOf("mthd11") != -1 || |
| 240 testFiles[i].indexOf("conformance_mthd19") != -1 || | 238 testFiles[i].indexOf("conformance_mthd19") != -1 || |
| 241 testFiles[i].indexOf("conformance_mthd20") != -1 || | 239 testFiles[i].indexOf("conformance_mthd20") != -1 || |
| 242 testFiles[i].indexOf("enum") != -1 || | |
| 243 testFiles[i].indexOf("no_such_method") != -1 || | 240 testFiles[i].indexOf("no_such_method") != -1 || |
| 244 testFiles[i].indexOf("invalid_request_flags") != -1 || | 241 testFiles[i].indexOf("invalid_request_flags") != -1 || |
| 245 testFiles[i].indexOf("invalid_response_flags") != -1) { | 242 testFiles[i].indexOf("invalid_response_flags") != -1) { |
| 246 console.log("[Skipping " + testFiles[i] + "]"); | 243 console.log("[Skipping " + testFiles[i] + "]"); |
| 247 continue; | 244 continue; |
| 248 } | 245 } |
| 249 | 246 |
| 250 var testMessage = readTestMessage(testFiles[i]); | 247 var testMessage = readTestMessage(testFiles[i]); |
| 251 var handles = new Array(testMessage.handleCount); | 248 var handles = new Array(testMessage.handleCount); |
| 252 var message = new codec.Message(testMessage.buffer, handles); | 249 var message = new codec.Message(testMessage.buffer, handles); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 testConformanceMessageValidation(); | 341 testConformanceMessageValidation(); |
| 345 testBoundsCheckMessageValidation(); | 342 testBoundsCheckMessageValidation(); |
| 346 testResponseConformanceMessageValidation(); | 343 testResponseConformanceMessageValidation(); |
| 347 testResponseBoundsCheckMessageValidation(); | 344 testResponseBoundsCheckMessageValidation(); |
| 348 testIntegratedMessageHeaderValidation(); | 345 testIntegratedMessageHeaderValidation(); |
| 349 testIntegratedResponseMessageValidation(); | 346 testIntegratedResponseMessageValidation(); |
| 350 testIntegratedRequestMessageValidation(); | 347 testIntegratedRequestMessageValidation(); |
| 351 | 348 |
| 352 this.result = "PASS"; | 349 this.result = "PASS"; |
| 353 }); | 350 }); |
| OLD | NEW |