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/bindings/buffer", | 10 "mojo/public/js/bindings/buffer", |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 expect(testFiles.length).toBeGreaterThan(0); | 201 expect(testFiles.length).toBeGreaterThan(0); |
202 | 202 |
203 var noError = validator.validationError.NONE; | 203 var noError = validator.validationError.NONE; |
204 for (var i = 0; i < testFiles.length; i++) { | 204 for (var i = 0; i < testFiles.length; i++) { |
205 // TODO(hansmuller): Temporarily skipping array pointer overflow tests. | 205 // TODO(hansmuller): Temporarily skipping array pointer overflow tests. |
206 if (testFiles[i].indexOf("overflow") != -1) { | 206 if (testFiles[i].indexOf("overflow") != -1) { |
207 console.log("[Skipping " + testFiles[i] + "]"); | 207 console.log("[Skipping " + testFiles[i] + "]"); |
208 continue; | 208 continue; |
209 } | 209 } |
210 | 210 |
211 // TODO(hansmuller): Temporarily skipping array unexpected null tests. | |
212 if (testFiles[i].indexOf("unexpected_null") != -1 || | |
213 testFiles[i].indexOf("unexpected_invalid") != -1) { | |
214 console.log("[Skipping " + testFiles[i] + "]"); | |
215 continue; | |
216 } | |
217 | |
218 var testMessage = readTestMessage(testFiles[i]); | 211 var testMessage = readTestMessage(testFiles[i]); |
219 var handles = new Array(testMessage.handleCount); | 212 var handles = new Array(testMessage.handleCount); |
220 var message = new codec.Message(testMessage.buffer, handles); | 213 var message = new codec.Message(testMessage.buffer, handles); |
221 var messageValidator = new validator.Validator(message); | 214 var messageValidator = new validator.Validator(message); |
222 | 215 |
223 var err = messageValidator.validateMessageHeader(); | 216 var err = messageValidator.validateMessageHeader(); |
224 for (var j = 0; err === noError && j < filters.length; ++j) | 217 for (var j = 0; err === noError && j < filters.length; ++j) |
225 err = filters[j](messageValidator); | 218 err = filters[j](messageValidator); |
226 | 219 |
227 var actualResult = (err === noError) ? "PASS" : err; | 220 var actualResult = (err === noError) ? "PASS" : err; |
(...skipping 15 matching lines...) Expand all Loading... |
243 testInterface.validateIntegrationTestInterface1Request, | 236 testInterface.validateIntegrationTestInterface1Request, |
244 testInterface.validateIntegrationTestInterface2Response | 237 testInterface.validateIntegrationTestInterface2Response |
245 ]); | 238 ]); |
246 } | 239 } |
247 | 240 |
248 testConformanceMessageValidation(); | 241 testConformanceMessageValidation(); |
249 testIntegrationMessageValidation(); | 242 testIntegrationMessageValidation(); |
250 expect(checkTestMessageParser()).toBeNull(); | 243 expect(checkTestMessageParser()).toBeNull(); |
251 this.result = "PASS"; | 244 this.result = "PASS"; |
252 }); | 245 }); |
OLD | NEW |