Do not use testing::EqualsProto in quic_crypto_server_config_test.cc, since it's not available in Chromium.
gfe-relnote: (n/a) Cosmetic test change.
(This CL partially reverts cl/240628307)
PiperOrigin-RevId: 240975844
Change-Id: I78a1c1e28fa0d1d28ecf02d62bfb64f58b3e451f
diff --git a/quic/core/crypto/quic_crypto_server_config_test.cc b/quic/core/crypto/quic_crypto_server_config_test.cc
index 2de5b7a..b3f8f77 100644
--- a/quic/core/crypto/quic_crypto_server_config_test.cc
+++ b/quic/core/crypto/quic_crypto_server_config_test.cc
@@ -9,7 +9,6 @@
#include <memory>
#include <string>
-#include "testing/gmock/include/gmock/gmock.h"
#include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
@@ -26,9 +25,18 @@
namespace quic {
namespace test {
-using ::testing::EqualsProto;
using ::testing::Not;
+// NOTE: This matcher depends on the wire format of serialzied protocol buffers,
+// which may change in the future.
+// Switch to ::testing::EqualsProto once it is available in Chromium.
+MATCHER_P(SerializedProtoEquals, message, "") {
+ std::string expected_serialized, actual_serialized;
+ message.SerializeToString(&expected_serialized);
+ arg.SerializeToString(&actual_serialized);
+ return expected_serialized == actual_serialized;
+}
+
class QuicCryptoServerConfigTest : public QuicTest {};
TEST_F(QuicCryptoServerConfigTest, ServerConfig) {
@@ -263,11 +271,11 @@
CachedNetworkParameters cached_network_params_output;
EXPECT_THAT(cached_network_params_output,
- Not(EqualsProto(cached_network_params_input)));
+ Not(SerializedProtoEquals(cached_network_params_input)));
ValidateSourceAddressTokens(kPrimary, token4_with_cached_network_params, ip4_,
&cached_network_params_output);
EXPECT_THAT(cached_network_params_output,
- EqualsProto(cached_network_params_input));
+ SerializedProtoEquals(cached_network_params_input));
}
// Test the ability for a source address token to be valid for multiple