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

Side by Side Diff: mojo/apps/js/bindings/sample_service_unittests.js

Issue 317073005: Mojom: Add 'default' keyword for initializing structs to non-null value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | « no previous file | mojo/public/cpp/bindings/tests/sample_service_unittest.cc » ('j') | 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 "mojo/public/interfaces/bindings/tests/sample_service.mojom", 9 "mojo/public/interfaces/bindings/tests/sample_service.mojom",
10 "mojo/public/interfaces/bindings/tests/sample_import.mojom", 10 "mojo/public/interfaces/bindings/tests/sample_import.mojom",
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 expect(defaults.a10).toBe(1234); 116 expect(defaults.a10).toBe(1234);
117 expect(defaults.a11).toBe(true); 117 expect(defaults.a11).toBe(true);
118 expect(defaults.a12).toBe(false); 118 expect(defaults.a12).toBe(false);
119 expect(defaults.a13).toBe(123.25); 119 expect(defaults.a13).toBe(123.25);
120 expect(defaults.a14).toBe(1234567890.123); 120 expect(defaults.a14).toBe(1234567890.123);
121 expect(defaults.a15).toBe(1E10); 121 expect(defaults.a15).toBe(1E10);
122 expect(defaults.a16).toBe(-1.2E+20); 122 expect(defaults.a16).toBe(-1.2E+20);
123 expect(defaults.a17).toBe(1.23E-20); 123 expect(defaults.a17).toBe(1.23E-20);
124 expect(defaults.a20).toBe(sample.Bar.Type.TYPE_BOTH); 124 expect(defaults.a20).toBe(sample.Bar.Type.TYPE_BOTH);
125 expect(defaults.a21).toBeNull(); 125 expect(defaults.a21).toBeNull();
126 expect(defaults.a22).toBeNull(); 126 expect(defaults.a22).toBeTruthy();
127 expect(defaults.a22.shape).toBe(imported.Shape.SHAPE_RECTANGLE);
128 expect(defaults.a22.color).toBe(imported2.Color.COLOR_BLACK);
127 // TODO(vtl): crbug.com/375845 129 // TODO(vtl): crbug.com/375845
128 // expect(defaults.a21).toBeNull(); 130 // expect(defaults.a21).toBeNull();
129 // expect(defaults.a22).toBeNull(); 131 // expect(defaults.a22).toBeNull();
130 } 132 }
131 133
132 function ServiceImpl() { 134 function ServiceImpl() {
133 } 135 }
134 136
135 ServiceImpl.prototype = Object.create(sample.ServiceStub.prototype); 137 ServiceImpl.prototype = Object.create(sample.ServiceStub.prototype);
136 138
(...skipping 21 matching lines...) Expand all
158 var serviceProxy = new sample.ServiceProxy(receiver); 160 var serviceProxy = new sample.ServiceProxy(receiver);
159 161
160 checkDefaultValues(); 162 checkDefaultValues();
161 163
162 var foo = makeFoo(); 164 var foo = makeFoo();
163 checkFoo(foo); 165 checkFoo(foo);
164 166
165 var port = 10; 167 var port = 10;
166 serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.BAZ_EXTRA, port); 168 serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.BAZ_EXTRA, port);
167 }); 169 });
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/sample_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698