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

Side by Side Diff: net/socket_stream/socket_stream_unittest.cc

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket_stream/socket_stream.cc ('k') | net/spdy/spdy_network_transaction.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "net/base/load_log.h"
10 #include "net/base/load_log_unittest.h"
11 #include "net/base/mock_host_resolver.h" 9 #include "net/base/mock_host_resolver.h"
10 #include "net/base/net_log.h"
11 #include "net/base/net_log_unittest.h"
12 #include "net/base/test_completion_callback.h" 12 #include "net/base/test_completion_callback.h"
13 #include "net/socket/socket_test_util.h" 13 #include "net/socket/socket_test_util.h"
14 #include "net/socket_stream/socket_stream.h" 14 #include "net/socket_stream/socket_stream.h"
15 #include "net/url_request/url_request_unittest.h" 15 #include "net/url_request/url_request_unittest.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "testing/platform_test.h" 17 #include "testing/platform_test.h"
18 18
19 struct SocketStreamEvent { 19 struct SocketStreamEvent {
20 enum EventType { 20 enum EventType {
21 EVENT_CONNECTED, EVENT_SENT_DATA, EVENT_RECEIVED_DATA, EVENT_CLOSE, 21 EVENT_CONNECTED, EVENT_SENT_DATA, EVENT_RECEIVED_DATA, EVENT_CLOSE,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 callback.WaitForResult(); 205 callback.WaitForResult();
206 206
207 const std::vector<SocketStreamEvent>& events = delegate->GetSeenEvents(); 207 const std::vector<SocketStreamEvent>& events = delegate->GetSeenEvents();
208 EXPECT_EQ(3U, events.size()); 208 EXPECT_EQ(3U, events.size());
209 209
210 EXPECT_EQ(SocketStreamEvent::EVENT_AUTH_REQUIRED, events[0].event_type); 210 EXPECT_EQ(SocketStreamEvent::EVENT_AUTH_REQUIRED, events[0].event_type);
211 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type); 211 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type);
212 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[2].event_type); 212 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[2].event_type);
213 213
214 // The first and last entries of the LoadLog should be for 214 // TODO(eroman): Add back NetLogTest here...
215 // SOCKET_STREAM_CONNECT.
216 EXPECT_TRUE(LogContainsBeginEvent(
217 *socket_stream->load_log(), 0, LoadLog::TYPE_SOCKET_STREAM_CONNECT));
218 EXPECT_TRUE(LogContainsEndEvent(
219 *socket_stream->load_log(), -1, LoadLog::TYPE_SOCKET_STREAM_CONNECT));
220 } 215 }
221 216
222 } // namespace net 217 } // namespace net
OLDNEW
« no previous file with comments | « net/socket_stream/socket_stream.cc ('k') | net/spdy/spdy_network_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698