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/it2me/it2me_native_messaging_host.h" | 5 #include "remoting/host/it2me/it2me_native_messaging_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 context, task_runner, observer, xmpp_server_config, directory_bot_jid); | 159 context, task_runner, observer, xmpp_server_config, directory_bot_jid); |
160 } | 160 } |
161 | 161 |
162 private: | 162 private: |
163 DISALLOW_COPY_AND_ASSIGN(MockIt2MeHostFactory); | 163 DISALLOW_COPY_AND_ASSIGN(MockIt2MeHostFactory); |
164 }; // MockIt2MeHostFactory | 164 }; // MockIt2MeHostFactory |
165 | 165 |
166 class It2MeNativeMessagingHostTest : public testing::Test { | 166 class It2MeNativeMessagingHostTest : public testing::Test { |
167 public: | 167 public: |
168 It2MeNativeMessagingHostTest() {} | 168 It2MeNativeMessagingHostTest() {} |
169 virtual ~It2MeNativeMessagingHostTest() {} | 169 ~It2MeNativeMessagingHostTest() override {} |
170 | 170 |
171 virtual void SetUp() override; | 171 void SetUp() override; |
172 virtual void TearDown() override; | 172 void TearDown() override; |
173 | 173 |
174 protected: | 174 protected: |
175 scoped_ptr<base::DictionaryValue> ReadMessageFromOutputPipe(); | 175 scoped_ptr<base::DictionaryValue> ReadMessageFromOutputPipe(); |
176 void WriteMessageToInputPipe(const base::Value& message); | 176 void WriteMessageToInputPipe(const base::Value& message); |
177 | 177 |
178 void VerifyHelloResponse(int request_id); | 178 void VerifyHelloResponse(int request_id); |
179 void VerifyErrorResponse(); | 179 void VerifyErrorResponse(); |
180 void VerifyConnectResponses(int request_id); | 180 void VerifyConnectResponses(int request_id); |
181 void VerifyDisconnectResponses(int request_id); | 181 void VerifyDisconnectResponses(int request_id); |
182 | 182 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 554 |
555 // Verify rejection if type is unrecognized. | 555 // Verify rejection if type is unrecognized. |
556 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { | 556 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { |
557 base::DictionaryValue message; | 557 base::DictionaryValue message; |
558 message.SetString("type", "xxx"); | 558 message.SetString("type", "xxx"); |
559 TestBadRequest(message, true); | 559 TestBadRequest(message, true); |
560 } | 560 } |
561 | 561 |
562 } // namespace remoting | 562 } // namespace remoting |
563 | 563 |
OLD | NEW |