|
30 | 30 |
|
31 | 31 | goog.require('goog.testing.asserts');
|
32 | 32 | goog.require('goog.userAgent');
|
| 33 | + |
| 34 | +// CommonJS-LoadFromFile: testbinary_pb proto.jspb.test |
33 | 35 | goog.require('proto.jspb.test.MapValueEnum');
|
34 | 36 | goog.require('proto.jspb.test.MapValueMessage');
|
35 |
| -goog.require('proto.jspb.test.MapValueMessageNoBinary'); |
36 | 37 | goog.require('proto.jspb.test.TestMapFields');
|
| 38 | + |
| 39 | +// CommonJS-LoadFromFile: test_pb proto.jspb.test |
| 40 | +goog.require('proto.jspb.test.MapValueMessageNoBinary'); |
37 | 41 | goog.require('proto.jspb.test.TestMapFieldsNoBinary');
|
38 | 42 |
|
39 | 43 | /**
|
@@ -258,64 +262,6 @@ function makeTests(msgInfo, submessageCtor, suffix) {
|
258 | 262 | });
|
259 | 263 | }
|
260 | 264 |
|
261 |
| - |
262 |
| - /** |
263 |
| - * Tests serialization and deserialization in JSPB format. |
264 |
| - */ |
265 |
| - it('testJSPBFormat' + suffix, function() { |
266 |
| - var msg = new msgInfo.constructor(); |
267 |
| - fillMapFields(msg); |
268 |
| - var serialized = msg.serialize(); |
269 |
| - var decoded = msgInfo.deserialize(serialized); |
270 |
| - checkMapFields(decoded); |
271 |
| - }); |
272 |
| - |
273 |
| - /** |
274 |
| - * Tests serialization and deserialization in JSPB format, when there is |
275 |
| - * a submessage that also contains map entries. This tests recursive |
276 |
| - * sync. |
277 |
| - */ |
278 |
| - it('testJSPBFormatNested' + suffix, function() { |
279 |
| - var submsg = new msgInfo.constructor(); |
280 |
| - var mapValue = new msgInfo.constructor(); |
281 |
| - var msg = new msgInfo.constructor(); |
282 |
| - |
283 |
| - msg.getMapStringTestmapfieldsMap().set('test', mapValue); |
284 |
| - msg.setTestMapFields(submsg); |
285 |
| - |
286 |
| - fillMapFields(submsg); |
287 |
| - fillMapFields(msg); |
288 |
| - fillMapFields(mapValue); |
289 |
| - |
290 |
| - var serialized = msg.serialize(); |
291 |
| - |
292 |
| - var decoded = msgInfo.deserialize(serialized); |
293 |
| - checkMapFields(decoded); |
294 |
| - |
295 |
| - var decodedSubmsg = decoded.getTestMapFields(); |
296 |
| - assertNotNull(decodedSubmsg); |
297 |
| - checkMapFields(decodedSubmsg); |
298 |
| - |
299 |
| - var decodedMapValue = decoded.getMapStringTestmapfieldsMap().get('test'); |
300 |
| - assertNotNull(decodedMapValue); |
301 |
| - checkMapFields(decodedMapValue); |
302 |
| - }); |
303 |
| - |
304 |
| - /** |
305 |
| - * Tests toObject()/fromObject(). |
306 |
| - */ |
307 |
| - it('testToFromObject' + suffix, function() { |
308 |
| - var msg = new msgInfo.constructor(); |
309 |
| - fillMapFields(msg); |
310 |
| - var obj = msg.toObject(); |
311 |
| - var decoded = msgInfo.fromObject(obj); |
312 |
| - checkMapFields(decoded); |
313 |
| - obj = msgInfo.deserialize(msg.serialize()).toObject(); |
314 |
| - decoded = msgInfo.fromObject(obj); |
315 |
| - checkMapFields(decoded); |
316 |
| - }); |
317 |
| - |
318 |
| - |
319 | 265 | /**
|
320 | 266 | * Exercises the lazy map<->underlying array sync.
|
321 | 267 | */
|
@@ -346,14 +292,10 @@ function makeTests(msgInfo, submessageCtor, suffix) {
|
346 | 292 | describe('mapsTest', function() {
|
347 | 293 | makeTests({
|
348 | 294 | constructor: proto.jspb.test.TestMapFields,
|
349 |
| - fromObject: proto.jspb.test.TestMapFields.fromObject, |
350 |
| - deserialize: proto.jspb.test.TestMapFields.deserialize, |
351 | 295 | deserializeBinary: proto.jspb.test.TestMapFields.deserializeBinary
|
352 | 296 | }, proto.jspb.test.MapValueMessage, "_Binary");
|
353 | 297 | makeTests({
|
354 | 298 | constructor: proto.jspb.test.TestMapFieldsNoBinary,
|
355 |
| - fromObject: proto.jspb.test.TestMapFieldsNoBinary.fromObject, |
356 |
| - deserialize: proto.jspb.test.TestMapFieldsNoBinary.deserialize, |
357 | 299 | deserializeBinary: null
|
358 | 300 | }, proto.jspb.test.MapValueMessageNoBinary, "_NoBinary");
|
359 | 301 | });
|
0 commit comments