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

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

Issue 6264013: Clean up net unit testing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-virtualize TestDelegate::OnResponseCompleted Created 9 years, 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
11 #include "net/base/mock_host_resolver.h" 11 #include "net/base/mock_host_resolver.h"
12 #include "net/base/net_log.h" 12 #include "net/base/net_log.h"
13 #include "net/base/net_log_unittest.h" 13 #include "net/base/net_log_unittest.h"
14 #include "net/base/test_completion_callback.h" 14 #include "net/base/test_completion_callback.h"
15 #include "net/socket/socket_test_util.h" 15 #include "net/socket/socket_test_util.h"
16 #include "net/socket_stream/socket_stream.h" 16 #include "net/socket_stream/socket_stream.h"
17 #include "net/url_request/url_request_unittest.h" 17 #include "net/url_request/url_request_test_util.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "testing/platform_test.h" 19 #include "testing/platform_test.h"
20 20
21 struct SocketStreamEvent { 21 struct SocketStreamEvent {
22 enum EventType { 22 enum EventType {
23 EVENT_CONNECTED, EVENT_SENT_DATA, EVENT_RECEIVED_DATA, EVENT_CLOSE, 23 EVENT_CONNECTED, EVENT_SENT_DATA, EVENT_RECEIVED_DATA, EVENT_CLOSE,
24 EVENT_AUTH_REQUIRED, 24 EVENT_AUTH_REQUIRED,
25 }; 25 };
26 26
27 SocketStreamEvent(EventType type, net::SocketStream* socket_stream, 27 SocketStreamEvent(EventType type, net::SocketStream* socket_stream,
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 EXPECT_EQ(3U, events.size()); 347 EXPECT_EQ(3U, events.size());
348 348
349 EXPECT_EQ(SocketStreamEvent::EVENT_AUTH_REQUIRED, events[0].event_type); 349 EXPECT_EQ(SocketStreamEvent::EVENT_AUTH_REQUIRED, events[0].event_type);
350 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type); 350 EXPECT_EQ(SocketStreamEvent::EVENT_CONNECTED, events[1].event_type);
351 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[2].event_type); 351 EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[2].event_type);
352 352
353 // TODO(eroman): Add back NetLogTest here... 353 // TODO(eroman): Add back NetLogTest here...
354 } 354 }
355 355
356 } // namespace net 356 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698