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

Unified Diff: third_party/protobuf/js/binary/proto_test.js

Issue 2590803003: Revert "third_party/protobuf: Update to HEAD (83d681ee2c)" (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/js/binary/encoder.js ('k') | third_party/protobuf/js/binary/reader.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/js/binary/proto_test.js
diff --git a/third_party/protobuf/js/binary/proto_test.js b/third_party/protobuf/js/binary/proto_test.js
index f86dc6455bb4896ba34b1484cc082db04858b823..14d0f42e9549b64389b7c85cb3f0cfc387377e53 100644
--- a/third_party/protobuf/js/binary/proto_test.js
+++ b/third_party/protobuf/js/binary/proto_test.js
@@ -32,7 +32,6 @@
goog.require('goog.crypt.base64');
goog.require('goog.testing.asserts');
-goog.require('jspb.BinaryWriter');
goog.require('jspb.Message');
// CommonJS-LoadFromFile: ../testbinary_pb proto.jspb.test
@@ -88,9 +87,6 @@ goog.require('proto.jspb.test.extendRepeatedStringList');
goog.require('proto.jspb.test.extendRepeatedUint32List');
goog.require('proto.jspb.test.extendRepeatedUint64List');
-// CommonJS-LoadFromFile: ../node_modules/google-protobuf/google/protobuf/any_pb proto.google.protobuf
-goog.require('proto.google.protobuf.Any');
-
var suite = {};
@@ -198,6 +194,8 @@ function bytesCompare(arr, expected) {
* @param {proto.jspb.test.TestAllTypes} copy
*/
function checkAllFields(original, copy) {
+ assertTrue(jspb.Message.equals(original, copy));
+
assertEquals(copy.getOptionalInt32(), -42);
assertEquals(copy.getOptionalInt64(), -0x7fffffff00000000);
assertEquals(copy.getOptionalUint32(), 0x80000000);
@@ -272,9 +270,6 @@ function checkAllFields(original, copy) {
assertElementsEquals(copy.getPackedRepeatedFloatList(), [1.5]);
assertElementsEquals(copy.getPackedRepeatedDoubleList(), [-1.5]);
-
- // Check last so we get more granular errors first.
- assertTrue(jspb.Message.equals(original, copy));
}
@@ -501,7 +496,7 @@ describe('protoBinaryTest', function() {
msg.setRepeatedBytesList([BYTES_B64, BYTES_B64]);
assertGetters();
- msg.setRepeatedBytesList([]);
+ msg.setRepeatedBytesList(null);
assertEquals(0, msg.getRepeatedBytesList().length);
assertEquals(0, msg.getRepeatedBytesList_asB64().length);
assertEquals(0, msg.getRepeatedBytesList_asU8().length);
@@ -630,36 +625,4 @@ describe('protoBinaryTest', function() {
var decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded);
checkExtensions(decoded);
});
-
- /**
- * Tests that unknown extensions don't cause deserialization failure.
- */
- it('testUnknownExtension', function() {
- var msg = new proto.jspb.test.TestExtendable();
- fillExtensions(msg);
- var writer = new jspb.BinaryWriter();
- writer.writeBool((1 << 29) - 1, true);
- proto.jspb.test.TestExtendable.serializeBinaryToWriter(msg, writer);
- var encoded = writer.getResultBuffer();
- var decoded = proto.jspb.test.TestExtendable.deserializeBinary(encoded);
- checkExtensions(decoded);
- });
-
- it('testAnyWellKnownType', function() {
- var any = new proto.google.protobuf.Any();
- var msg = new proto.jspb.test.TestAllTypes();
-
- fillAllFields(msg);
-
- any.pack(msg.serializeBinary(), 'jspb.test.TestAllTypes');
-
- assertEquals('type.googleapis.com/jspb.test.TestAllTypes',
- any.getTypeUrl());
-
- var msg2 = any.unpack(
- proto.jspb.test.TestAllTypes.deserializeBinary,
- 'jspb.test.TestAllTypes');
-
- checkAllFields(msg, msg2);
- });
});
« no previous file with comments | « third_party/protobuf/js/binary/encoder.js ('k') | third_party/protobuf/js/binary/reader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698