OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/socket_stream/socket_stream.h" | 5 #include "net/socket_stream/socket_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "net/base/auth.h" | 14 #include "net/base/auth.h" |
15 #include "net/base/net_log.h" | 15 #include "net/base/net_log.h" |
16 #include "net/base/net_log_unittest.h" | 16 #include "net/base/net_log_unittest.h" |
17 #include "net/base/test_completion_callback.h" | 17 #include "net/base/test_completion_callback.h" |
18 #include "net/dns/mock_host_resolver.h" | 18 #include "net/dns/mock_host_resolver.h" |
19 #include "net/http/http_network_session.h" | 19 #include "net/http/http_network_session.h" |
20 #include "net/proxy/proxy_service.h" | 20 #include "net/proxy/proxy_service.h" |
21 #include "net/socket/socket_test_util.h" | 21 #include "net/socket/socket_test_util.h" |
22 #include "net/url_request/url_request_test_util.h" | 22 #include "net/url_request/url_request_test_util.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "testing/platform_test.h" | 24 #include "testing/platform_test.h" |
25 | 25 |
| 26 using base::ASCIIToUTF16; |
| 27 |
26 namespace net { | 28 namespace net { |
27 | 29 |
28 namespace { | 30 namespace { |
29 | 31 |
30 struct SocketStreamEvent { | 32 struct SocketStreamEvent { |
31 enum EventType { | 33 enum EventType { |
32 EVENT_START_OPEN_CONNECTION, EVENT_CONNECTED, EVENT_SENT_DATA, | 34 EVENT_START_OPEN_CONNECTION, EVENT_CONNECTED, EVENT_SENT_DATA, |
33 EVENT_RECEIVED_DATA, EVENT_CLOSE, EVENT_AUTH_REQUIRED, EVENT_ERROR, | 35 EVENT_RECEIVED_DATA, EVENT_CLOSE, EVENT_AUTH_REQUIRED, EVENT_ERROR, |
34 }; | 36 }; |
35 | 37 |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 | 1042 |
1041 EXPECT_EQ(SocketStreamEvent::EVENT_START_OPEN_CONNECTION, | 1043 EXPECT_EQ(SocketStreamEvent::EVENT_START_OPEN_CONNECTION, |
1042 events[0].event_type); | 1044 events[0].event_type); |
1043 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type); | 1045 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type); |
1044 EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[2].event_type); | 1046 EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[2].event_type); |
1045 EXPECT_EQ(SocketStreamEvent::EVENT_RECEIVED_DATA, events[3].event_type); | 1047 EXPECT_EQ(SocketStreamEvent::EVENT_RECEIVED_DATA, events[3].event_type); |
1046 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[4].event_type); | 1048 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[4].event_type); |
1047 } | 1049 } |
1048 | 1050 |
1049 } // namespace net | 1051 } // namespace net |
OLD | NEW |