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 "file", | 6 "file", |
7 "gin/test/expect", | 7 "gin/test/expect", |
| 8 "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom", |
8 "mojo/public/js/bindings/buffer", | 9 "mojo/public/js/bindings/buffer", |
9 "mojo/public/js/bindings/codec", | 10 "mojo/public/js/bindings/codec", |
10 "mojo/public/js/bindings/tests/validation_test_input_parser", | 11 "mojo/public/js/bindings/tests/validation_test_input_parser", |
11 "mojo/public/js/bindings/validator", | 12 "mojo/public/js/bindings/validator", |
12 ], function(file, expect, buffer, codec, parser, validator) { | 13 ], function(file, expect, testInterface, buffer, codec, parser, validator) { |
13 | 14 |
14 function checkTestMessageParser() { | 15 function checkTestMessageParser() { |
15 function TestMessageParserFailure(message, input) { | 16 function TestMessageParserFailure(message, input) { |
16 this.message = message; | 17 this.message = message; |
17 this.input = input; | 18 this.input = input; |
18 } | 19 } |
19 | 20 |
20 TestMessageParserFailure.prototype.toString = function() { | 21 TestMessageParserFailure.prototype.toString = function() { |
21 return 'Error: ' + this.message + ' for "' + this.input + '"'; | 22 return 'Error: ' + this.message + ' for "' + this.input + '"'; |
22 } | 23 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 var actualResult = new validator.Validator(message).validateMessage(); | 208 var actualResult = new validator.Validator(message).validateMessage(); |
208 var expectedResult = readTestExpected(testFiles[i]); | 209 var expectedResult = readTestExpected(testFiles[i]); |
209 expect(actualResult).toEqual(expectedResult); | 210 expect(actualResult).toEqual(expectedResult); |
210 } | 211 } |
211 } | 212 } |
212 | 213 |
213 testValidateMessageHeader(); | 214 testValidateMessageHeader(); |
214 expect(checkTestMessageParser()).toBeNull(); | 215 expect(checkTestMessageParser()).toBeNull(); |
215 this.result = "PASS"; | 216 this.result = "PASS"; |
216 }); | 217 }); |
OLD | NEW |