Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 expect(foo.name).toBe("Fooby"); | 97 expect(foo.name).toBe("Fooby"); |
| 98 expect(foo.a).toBeTruthy(); | 98 expect(foo.a).toBeTruthy(); |
| 99 expect(foo.data).toBeNull(); | 99 expect(foo.data).toBeNull(); |
| 100 | 100 |
| 101 var defaults = new sample.DefaultsTest(); | 101 var defaults = new sample.DefaultsTest(); |
| 102 expect(defaults.a0).toBe(-12); | 102 expect(defaults.a0).toBe(-12); |
| 103 expect(defaults.a1).toBe(sample.kTwelve); | 103 expect(defaults.a1).toBe(sample.kTwelve); |
| 104 expect(defaults.a2).toBe(1234); | 104 expect(defaults.a2).toBe(1234); |
| 105 expect(defaults.a3).toBe(34567); | 105 expect(defaults.a3).toBe(34567); |
| 106 expect(defaults.a4).toBe(123456); | 106 expect(defaults.a4).toBe(123456); |
| 107 // TODO(vtl): crbug.com/375522 | 107 expect(defaults.a5).toBe(3456789012); |
| 108 // expect(defaults.a5).toBe(3456789012); | |
| 109 expect(defaults.a6).toBe(111111111111); | 108 expect(defaults.a6).toBe(111111111111); |
| 110 // TODO(vtl): crbug.com/375522 (Also, can we get exact values for large | 109 // JS doesn't have a 64 bit integer type so this is just checking that the |
|
viettrungluu
2014/07/15 16:08:26
Partly/vaguely implied by my parenthetical comment
| |
| 111 // int64/uint64's in JS?) | 110 // expected and actual values have the same closest double value. |
| 112 // expect(defaults.a7).toBe(9999999999999999999); | 111 expect(defaults.a7).toBe(9999999999999999999); |
| 113 expect(defaults.a8).toBe(0x12345); | 112 expect(defaults.a8).toBe(0x12345); |
| 114 expect(defaults.a9).toBe(-0x12345); | 113 expect(defaults.a9).toBe(-0x12345); |
| 115 expect(defaults.a10).toBe(1234); | 114 expect(defaults.a10).toBe(1234); |
| 116 expect(defaults.a11).toBe(true); | 115 expect(defaults.a11).toBe(true); |
| 117 expect(defaults.a12).toBe(false); | 116 expect(defaults.a12).toBe(false); |
| 118 expect(defaults.a13).toBe(123.25); | 117 expect(defaults.a13).toBe(123.25); |
| 119 expect(defaults.a14).toBe(1234567890.123); | 118 expect(defaults.a14).toBe(1234567890.123); |
| 120 expect(defaults.a15).toBe(1E10); | 119 expect(defaults.a15).toBe(1E10); |
| 121 expect(defaults.a16).toBe(-1.2E+20); | 120 expect(defaults.a16).toBe(-1.2E+20); |
| 122 expect(defaults.a17).toBe(1.23E-20); | 121 expect(defaults.a17).toBe(1.23E-20); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 var serviceProxy = new sample.ServiceProxy(receiver); | 156 var serviceProxy = new sample.ServiceProxy(receiver); |
| 158 | 157 |
| 159 checkDefaultValues(); | 158 checkDefaultValues(); |
| 160 | 159 |
| 161 var foo = makeFoo(); | 160 var foo = makeFoo(); |
| 162 checkFoo(foo); | 161 checkFoo(foo); |
| 163 | 162 |
| 164 var port = 10; | 163 var port = 10; |
| 165 serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.BAZ_EXTRA, port); | 164 serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.BAZ_EXTRA, port); |
| 166 }); | 165 }); |
| OLD | NEW |