Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / net / test / channel_id_test_util.cc
blob77007f2a879dee13009f7ba9b15911d1f5788494
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/test/channel_id_test_util.h"
7 #include <string>
9 #include "crypto/ec_private_key.h"
10 #include "testing/gtest/include/gtest/gtest.h"
12 namespace net {
14 ::testing::AssertionResult KeysEqual(crypto::ECPrivateKey* key1,
15 crypto::ECPrivateKey* key2) {
16 std::string public_key1, public_key2;
17 EXPECT_TRUE(key1 && key1->ExportRawPublicKey(&public_key1));
18 EXPECT_TRUE(key2 && key2->ExportRawPublicKey(&public_key2));
19 if (public_key1 == public_key2)
20 return ::testing::AssertionSuccess();
21 else
22 return ::testing::AssertionFailure();
25 } // namespace net