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

Unified Diff: net/test/channel_id_test_util.cc

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mixplaced close paren Created 5 years, 7 months 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
« net/test/channel_id_test_util.h ('K') | « net/test/channel_id_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0d64f0601b4379afaef53487061cc6bec5b8c0bc
--- /dev/null
+++ b/net/test/channel_id_test_util.cc
@@ -0,0 +1,33 @@
+// 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 {
+
+void ExpectKeysEqual(crypto::ECPrivateKey* key1, crypto::ECPrivateKey* key2) {
+ ASSERT_TRUE(key1);
+ ASSERT_TRUE(key2);
+ std::string public_key1, public_key2;
+ EXPECT_TRUE(key1->ExportRawPublicKey(&public_key1));
+ EXPECT_TRUE(key2->ExportRawPublicKey(&public_key2));
+ EXPECT_EQ(public_key1, public_key2);
+}
+
+void ExpectKeysNotEqual(crypto::ECPrivateKey* key1,
+ crypto::ECPrivateKey* key2) {
+ ASSERT_TRUE(key1);
+ ASSERT_TRUE(key2);
+ std::string public_key1, public_key2;
+ EXPECT_TRUE(key1->ExportRawPublicKey(&public_key1));
+ EXPECT_TRUE(key2->ExportRawPublicKey(&public_key2));
+ EXPECT_NE(public_key1, public_key2);
+}
+
+} // namespace net
« net/test/channel_id_test_util.h ('K') | « net/test/channel_id_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698