OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/host_status_sender.h" | 5 #include "remoting/host/host_status_sender.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/base/logging.h" | 10 #include "remoting/base/logging.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 const char kStanzaId[] = "123"; | 34 const char kStanzaId[] = "123"; |
35 | 35 |
36 const HostExitCodes kTestExitCode = kInvalidHostConfigurationExitCode; | 36 const HostExitCodes kTestExitCode = kInvalidHostConfigurationExitCode; |
37 const char kTestExitCodeString[] = "INVALID_HOST_CONFIGURATION"; | 37 const char kTestExitCodeString[] = "INVALID_HOST_CONFIGURATION"; |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 class HostStatusSenderTest | 41 class HostStatusSenderTest |
42 : public testing::Test { | 42 : public testing::Test { |
43 protected: | 43 protected: |
44 virtual void SetUp() OVERRIDE { | 44 virtual void SetUp() override { |
45 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); | 45 key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); |
46 ASSERT_TRUE(key_pair_.get()); | 46 ASSERT_TRUE(key_pair_.get()); |
47 | 47 |
48 host_status_sender_.reset(new HostStatusSender( | 48 host_status_sender_.reset(new HostStatusSender( |
49 kHostId, &signal_strategy_, key_pair_, kTestBotJid)); | 49 kHostId, &signal_strategy_, key_pair_, kTestBotJid)); |
50 } | 50 } |
51 | 51 |
52 virtual void TearDown() OVERRIDE { | 52 virtual void TearDown() override { |
53 host_status_sender_.reset(); | 53 host_status_sender_.reset(); |
54 } | 54 } |
55 | 55 |
56 void ValidateHostStatusStanza(XmlElement* stanza, | 56 void ValidateHostStatusStanza(XmlElement* stanza, |
57 HostStatusSender::HostStatus status); | 57 HostStatusSender::HostStatus status); |
58 | 58 |
59 void ValidateSignature( | 59 void ValidateSignature( |
60 XmlElement* signature, HostStatusSender::HostStatus status); | 60 XmlElement* signature, HostStatusSender::HostStatus status); |
61 | 61 |
62 MockSignalStrategy signal_strategy_; | 62 MockSignalStrategy signal_strategy_; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair); | 188 scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair); |
189 ASSERT_TRUE(key_pair.get()); | 189 ASSERT_TRUE(key_pair.get()); |
190 | 190 |
191 std::string expected_signature = | 191 std::string expected_signature = |
192 key_pair->SignMessage(message); | 192 key_pair->SignMessage(message); |
193 EXPECT_EQ(expected_signature, signature->BodyText()); | 193 EXPECT_EQ(expected_signature, signature->BodyText()); |
194 } | 194 } |
195 | 195 |
196 } // namespace remoting | 196 } // namespace remoting |
OLD | NEW |