Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: mojo/public/js/bindings/validation_unittests.js

Issue 488173006: Integrate Mojo JS validation bindings with the Router (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final changes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « mojo/public/js/bindings/router.js ('k') | mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698