| Index: net/test/channel_id_test_util.cc
|
| diff --git a/net/test/channel_id_test_util.cc b/net/test/channel_id_test_util.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..77007f2a879dee13009f7ba9b15911d1f5788494
|
| --- /dev/null
|
| +++ b/net/test/channel_id_test_util.cc
|
| @@ -0,0 +1,25 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "net/test/channel_id_test_util.h"
|
| +
|
| +#include <string>
|
| +
|
| +#include "crypto/ec_private_key.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace net {
|
| +
|
| +::testing::AssertionResult KeysEqual(crypto::ECPrivateKey* key1,
|
| + crypto::ECPrivateKey* key2) {
|
| + std::string public_key1, public_key2;
|
| + EXPECT_TRUE(key1 && key1->ExportRawPublicKey(&public_key1));
|
| + EXPECT_TRUE(key2 && key2->ExportRawPublicKey(&public_key2));
|
| + if (public_key1 == public_key2)
|
| + return ::testing::AssertionSuccess();
|
| + else
|
| + return ::testing::AssertionFailure();
|
| +}
|
| +
|
| +} // namespace net
|
|
|