| 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 "gin/test/expect", | 6 "gin/test/expect", |
| 7 "mojo/public/interfaces/bindings/tests/rect.mojom", | 7 "mojo/public/interfaces/bindings/tests/rect.mojom", |
| 8 "mojo/public/interfaces/bindings/tests/test_structs.mojom", | 8 "mojo/public/interfaces/bindings/tests/test_structs.mojom", |
| 9 "mojo/public/js/codec", | 9 "mojo/public/js/codec", |
| 10 "mojo/public/js/validator", | 10 "mojo/public/js/validator", |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 f1: new Map([["a", null], ["b", ["c", "d"]]]), | 149 f1: new Map([["a", null], ["b", ["c", "d"]]]), |
| 150 // array<string?>> | 150 // array<string?>> |
| 151 f2: new Map([["a", [null]], ["b", [null, "d"]]]), | 151 f2: new Map([["a", [null]], ["b", [null, "d"]]]), |
| 152 // array<string,2>> | 152 // array<string,2>> |
| 153 f3: new Map([["a", ["1", "2"]], ["b", ["1", "2"]]]), | 153 f3: new Map([["a", ["1", "2"]], ["b", ["1", "2"]]]), |
| 154 // array<array<string, 1>?> | 154 // array<array<string, 1>?> |
| 155 f4: new Map([["a", [["1"]]], ["b", [null]]]), | 155 f4: new Map([["a", [["1"]]], ["b", [null]]]), |
| 156 // array<array<string, 2>, 1>> | 156 // array<array<string, 2>, 1>> |
| 157 f5: new Map([["a", [["1", "2"]]]]), | 157 f5: new Map([["a", [["1", "2"]]]]), |
| 158 // map<string, Rect?> | 158 // map<string, Rect?> |
| 159 /* | |
| 160 Disabled until the Java bindings work correctly. | |
| 161 f6: new Map([["a", null]]), | 159 f6: new Map([["a", null]]), |
| 162 // map<string, map<string, string>> | 160 // map<string, map<string, string>> |
| 163 f7: new Map([["a", new Map([["b", "c"]])]]), | 161 f7: new Map([["a", new Map([["b", "c"]])]]), |
| 164 // map<string, array<map<string, string>>> | 162 // map<string, array<map<string, string>>> |
| 165 f8: new Map([["a", [new Map([["b", "c"]])]]]), | 163 f8: new Map([["a", [new Map([["b", "c"]])]]]), |
| 166 */ | |
| 167 }); | 164 }); |
| 168 var decodedStruct = structEncodeDecode(mapFieldsStruct); | 165 var decodedStruct = structEncodeDecode(mapFieldsStruct); |
| 169 expect(decodedStruct.f0).toEqual(mapFieldsStruct.f0); | 166 expect(decodedStruct.f0).toEqual(mapFieldsStruct.f0); |
| 170 expect(decodedStruct.f1).toEqual(mapFieldsStruct.f1); | 167 expect(decodedStruct.f1).toEqual(mapFieldsStruct.f1); |
| 171 expect(decodedStruct.f2).toEqual(mapFieldsStruct.f2); | 168 expect(decodedStruct.f2).toEqual(mapFieldsStruct.f2); |
| 172 expect(decodedStruct.f3).toEqual(mapFieldsStruct.f3); | 169 expect(decodedStruct.f3).toEqual(mapFieldsStruct.f3); |
| 173 expect(decodedStruct.f4).toEqual(mapFieldsStruct.f4); | 170 expect(decodedStruct.f4).toEqual(mapFieldsStruct.f4); |
| 174 expect(decodedStruct.f5).toEqual(mapFieldsStruct.f5); | 171 expect(decodedStruct.f5).toEqual(mapFieldsStruct.f5); |
| 175 /* | |
| 176 Disabled until the Java bindings work correctly. | |
| 177 expect(decodedStruct.f6).toEqual(mapFieldsStruct.f6); | 172 expect(decodedStruct.f6).toEqual(mapFieldsStruct.f6); |
| 178 expect(decodedStruct.f7).toEqual(mapFieldsStruct.f7); | 173 expect(decodedStruct.f7).toEqual(mapFieldsStruct.f7); |
| 179 expect(decodedStruct.f8).toEqual(mapFieldsStruct.f8); | 174 expect(decodedStruct.f8).toEqual(mapFieldsStruct.f8); |
| 180 */ | |
| 181 } | 175 } |
| 182 | 176 |
| 183 testConstructors(); | 177 testConstructors(); |
| 184 testNoDefaultFieldValues(); | 178 testNoDefaultFieldValues(); |
| 185 testDefaultFieldValues(); | 179 testDefaultFieldValues(); |
| 186 testScopedConstants(); | 180 testScopedConstants(); |
| 187 testMapKeyTypes(); | 181 testMapKeyTypes(); |
| 188 testMapValueTypes(); | 182 testMapValueTypes(); |
| 189 this.result = "PASS"; | 183 this.result = "PASS"; |
| 190 }); | 184 }); |
| OLD | NEW |