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

Side by Side Diff: mojo/public/bindings/sample/sample_service_unittests.js

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/sample/sample_service_unittests.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/apps/js/test/hexdump", 7 "mojo/apps/js/test/hexdump",
8 "gin/test/expect", 8 "gin/test/expect",
9 "mojom/sample_service" 9 "mojom/sample_service"
10 ], function(console, hexdump, expect, sample) { 10 ], function(console, hexdump, expect, sample) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 expect(foo.source).toBe(0xFFFF); 85 expect(foo.source).toBe(0xFFFF);
86 } 86 }
87 87
88 function ServiceImpl() { 88 function ServiceImpl() {
89 } 89 }
90 90
91 ServiceImpl.prototype = Object.create(sample.ServiceStub.prototype); 91 ServiceImpl.prototype = Object.create(sample.ServiceStub.prototype);
92 92
93 ServiceImpl.prototype.frobinate = function(foo, baz, port) { 93 ServiceImpl.prototype.frobinate = function(foo, baz, port) {
94 checkFoo(foo); 94 checkFoo(foo);
95 expect(baz).toBeTruthy(); 95 expect(baz).toBe(sample.ServiceStub.BazOptions.BAZ_EXTRA);
96 expect(port).toBe(10); 96 expect(port).toBe(10);
97 global.result = "PASS"; 97 global.result = "PASS";
98 }; 98 };
99 99
100 function SimpleMessageReceiver() { 100 function SimpleMessageReceiver() {
101 } 101 }
102 102
103 SimpleMessageReceiver.prototype.accept = function(message) { 103 SimpleMessageReceiver.prototype.accept = function(message) {
104 if (dumpMessageAsHex) 104 if (dumpMessageAsHex)
105 console.log(hexdump.dumpArray(message.memory)); 105 console.log(hexdump.dumpArray(message.memory));
106 // Imagine some IPC happened here. 106 // Imagine some IPC happened here.
107 var serviceImpl = new ServiceImpl(); 107 var serviceImpl = new ServiceImpl();
108 serviceImpl.accept(message); 108 serviceImpl.accept(message);
109 }; 109 };
110 110
111 var receiver = new SimpleMessageReceiver(); 111 var receiver = new SimpleMessageReceiver();
112 var serviceProxy = new sample.ServiceProxy(receiver); 112 var serviceProxy = new sample.ServiceProxy(receiver);
113 113
114 var foo = makeFoo(); 114 var foo = makeFoo();
115 checkFoo(foo); 115 checkFoo(foo);
116 116
117 var port = 10; 117 var port = 10;
118 serviceProxy.frobinate(foo, true, port); 118 serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.BAZ_EXTRA, port);
119 }); 119 });
OLDNEW
« no previous file with comments | « mojo/public/bindings/sample/sample_service_unittests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698