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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 var actualResult = (err === noError) ? "PASS" : err; | 220 var actualResult = (err === noError) ? "PASS" : err; |
221 var expectedResult = readTestExpected(testFiles[i]); | 221 var expectedResult = readTestExpected(testFiles[i]); |
222 if (actualResult != expectedResult) | 222 if (actualResult != expectedResult) |
223 console.log("[Test message validation failed: " + testFiles[i] + " ]"); | 223 console.log("[Test message validation failed: " + testFiles[i] + " ]"); |
224 expect(actualResult).toEqual(expectedResult); | 224 expect(actualResult).toEqual(expectedResult); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 function testConformanceMessageValidation() { | 228 function testConformanceMessageValidation() { |
229 testMessageValidation("conformance_", [ | 229 testMessageValidation("conformance_", [ |
230 testInterface.validateConformanceTestInterfaceRequest, | 230 testInterface.ConformanceTestInterfaceStub.prototype.validator]); |
231 ]); | |
232 } | 231 } |
233 | 232 |
234 function testIntegrationMessageValidation() { | 233 function testIntegrationMessageValidation() { |
235 testMessageValidation("integration_", [ | 234 testMessageValidation("integration_", [ |
236 testInterface.validateIntegrationTestInterface1Request, | 235 testInterface.IntegrationTestInterface1Stub.prototype.validator, |
237 testInterface.validateIntegrationTestInterface2Response | 236 testInterface.IntegrationTestInterface2Proxy.prototype.validator]); |
238 ]); | |
239 } | 237 } |
240 | 238 |
| 239 expect(checkTestMessageParser()).toBeNull(); |
241 testConformanceMessageValidation(); | 240 testConformanceMessageValidation(); |
242 testIntegrationMessageValidation(); | 241 testIntegrationMessageValidation(); |
243 expect(checkTestMessageParser()).toBeNull(); | |
244 this.result = "PASS"; | 242 this.result = "PASS"; |
245 }); | 243 }); |
OLD | NEW |