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

Unified Diff: remoting/host/register_support_host_request_unittest.cc

Issue 12316083: Move HostKeyPair into protocol::KeyPair. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 9 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
« no previous file with comments | « remoting/host/register_support_host_request.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/register_support_host_request_unittest.cc
diff --git a/remoting/host/register_support_host_request_unittest.cc b/remoting/host/register_support_host_request_unittest.cc
index 81b5c42a27fcdc9d5c04171b37ec1330bf347528..cd5da6e7bbaf35e87c40581a51ac76c51b58dcde 100644
--- a/remoting/host/register_support_host_request_unittest.cc
+++ b/remoting/host/register_support_host_request_unittest.cc
@@ -10,9 +10,9 @@
#include "base/observer_list.h"
#include "base/string_number_conversions.h"
#include "remoting/base/constants.h"
-#include "remoting/host/host_key_pair.h"
+#include "remoting/base/rsa_key_pair.h"
+#include "remoting/base/test_rsa_key_pair.h"
#include "remoting/host/in_memory_host_config.h"
-#include "remoting/host/test_key_pair.h"
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -58,7 +58,8 @@ class RegisterSupportHostRequestTest : public testing::Test {
public:
protected:
virtual void SetUp() {
- ASSERT_TRUE(key_pair_.LoadFromString(kTestHostKeyPair));
+ key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair);
+ ASSERT_TRUE(key_pair_);
EXPECT_CALL(signal_strategy_, AddListener(NotNull()))
.WillRepeatedly(AddListener(&signal_strategy_listeners_));
@@ -71,7 +72,7 @@ class RegisterSupportHostRequestTest : public testing::Test {
MessageLoop message_loop_;
MockSignalStrategy signal_strategy_;
ObserverList<SignalStrategy::Listener, true> signal_strategy_listeners_;
- HostKeyPair key_pair_;
+ scoped_refptr<RsaKeyPair> key_pair_;
MockCallback callback_;
};
@@ -80,7 +81,7 @@ TEST_F(RegisterSupportHostRequestTest, Send) {
int64 start_time = static_cast<int64>(base::Time::Now().ToDoubleT());
scoped_ptr<RegisterSupportHostRequest> request(
- new RegisterSupportHostRequest(&signal_strategy_, &key_pair_,
+ new RegisterSupportHostRequest(&signal_strategy_, key_pair_,
kTestBotJid,
base::Bind(&MockCallback::OnResponse,
base::Unretained(&callback_))));
@@ -118,10 +119,11 @@ TEST_F(RegisterSupportHostRequestTest, Send) {
EXPECT_LE(start_time, time);
EXPECT_GE(now, time);
- HostKeyPair key_pair;
- key_pair.LoadFromString(kTestHostKeyPair);
+ scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair);
+ ASSERT_TRUE(key_pair);
+
std::string expected_signature =
- key_pair.GetSignature(std::string(kTestJid) + ' ' + time_str);
+ key_pair->SignMessage(std::string(kTestJid) + ' ' + time_str);
EXPECT_EQ(expected_signature, signature->BodyText());
// Generate response and verify that callback is called.
« no previous file with comments | « remoting/host/register_support_host_request.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698