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 "google_apis/gcm/engine/connection_handler_impl.h" | 5 #include "google_apis/gcm/engine/connection_handler_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 std::string result; | 99 std::string result; |
100 mcs_proto::DataMessageStanza data_message; | 100 mcs_proto::DataMessageStanza data_message; |
101 data_message.set_from(from); | 101 data_message.set_from(from); |
102 data_message.set_category(category); | 102 data_message.set_category(category); |
103 return data_message.SerializeAsString(); | 103 return data_message.SerializeAsString(); |
104 } | 104 } |
105 | 105 |
106 class GCMConnectionHandlerImplTest : public testing::Test { | 106 class GCMConnectionHandlerImplTest : public testing::Test { |
107 public: | 107 public: |
108 GCMConnectionHandlerImplTest(); | 108 GCMConnectionHandlerImplTest(); |
109 virtual ~GCMConnectionHandlerImplTest(); | 109 ~GCMConnectionHandlerImplTest() override; |
110 | 110 |
111 net::StreamSocket* BuildSocket(const ReadList& read_list, | 111 net::StreamSocket* BuildSocket(const ReadList& read_list, |
112 const WriteList& write_list); | 112 const WriteList& write_list); |
113 | 113 |
114 // Pump |message_loop_|, resetting |run_loop_| after completion. | 114 // Pump |message_loop_|, resetting |run_loop_| after completion. |
115 void PumpLoop(); | 115 void PumpLoop(); |
116 | 116 |
117 ConnectionHandlerImpl* connection_handler() { | 117 ConnectionHandlerImpl* connection_handler() { |
118 return connection_handler_.get(); | 118 return connection_handler_.get(); |
119 } | 119 } |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 WaitForMessage(); // The login send. | 800 WaitForMessage(); // The login send. |
801 WaitForMessage(); // The login response. | 801 WaitForMessage(); // The login response. |
802 WaitForMessage(); // The data message. | 802 WaitForMessage(); // The data message. |
803 ASSERT_TRUE(received_message.get()); | 803 ASSERT_TRUE(received_message.get()); |
804 EXPECT_EQ(data_message_proto, received_message->SerializeAsString()); | 804 EXPECT_EQ(data_message_proto, received_message->SerializeAsString()); |
805 EXPECT_EQ(net::OK, last_error()); | 805 EXPECT_EQ(net::OK, last_error()); |
806 } | 806 } |
807 | 807 |
808 } // namespace | 808 } // namespace |
809 } // namespace gcm | 809 } // namespace gcm |
OLD | NEW |