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

Side by Side Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 1084533002: Rename NetLogLogger and CapturingNetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename NetLogLogger and CapturingNetLog(removed compiler error for chromeOS) Created 5 years, 8 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
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('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) 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after
3661 MockWrite writes[] = { CreateMockWrite(*req) }; 3661 MockWrite writes[] = { CreateMockWrite(*req) };
3662 3662
3663 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); 3663 scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1));
3664 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); 3664 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true));
3665 MockRead reads[] = { 3665 MockRead reads[] = {
3666 CreateMockRead(*resp), 3666 CreateMockRead(*resp),
3667 CreateMockRead(*body), 3667 CreateMockRead(*body),
3668 MockRead(ASYNC, 0, 0) // EOF 3668 MockRead(ASYNC, 0, 0) // EOF
3669 }; 3669 };
3670 3670
3671 CapturingBoundNetLog log; 3671 BoundTestNetLog log;
3672 3672
3673 DelayedSocketData data(1, reads, arraysize(reads), 3673 DelayedSocketData data(1, reads, arraysize(reads),
3674 writes, arraysize(writes)); 3674 writes, arraysize(writes));
3675 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(), 3675 NormalSpdyTransactionHelper helper(CreateGetRequestWithUserAgent(),
3676 DEFAULT_PRIORITY, 3676 DEFAULT_PRIORITY,
3677 log.bound(), GetParam(), NULL); 3677 log.bound(), GetParam(), NULL);
3678 helper.RunToCompletion(&data); 3678 helper.RunToCompletion(&data);
3679 TransactionHelperResult out = helper.output(); 3679 TransactionHelperResult out = helper.output();
3680 EXPECT_EQ(OK, out.rv); 3680 EXPECT_EQ(OK, out.rv);
3681 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line); 3681 EXPECT_EQ("HTTP/1.1 200 OK", out.status_line);
3682 EXPECT_EQ("hello!", out.response_data); 3682 EXPECT_EQ("hello!", out.response_data);
3683 3683
3684 // Check that the NetLog was filled reasonably. 3684 // Check that the NetLog was filled reasonably.
3685 // This test is intentionally non-specific about the exact ordering of the 3685 // This test is intentionally non-specific about the exact ordering of the
3686 // log; instead we just check to make sure that certain events exist, and that 3686 // log; instead we just check to make sure that certain events exist, and that
3687 // they are in the right order. 3687 // they are in the right order.
3688 CapturingNetLog::CapturedEntryList entries; 3688 TestNetLog::CapturedEntryList entries;
3689 log.GetEntries(&entries); 3689 log.GetEntries(&entries);
3690 3690
3691 EXPECT_LT(0u, entries.size()); 3691 EXPECT_LT(0u, entries.size());
3692 int pos = 0; 3692 int pos = 0;
3693 pos = ExpectLogContainsSomewhere(entries, 0, 3693 pos = ExpectLogContainsSomewhere(entries, 0,
3694 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, 3694 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST,
3695 NetLog::PHASE_BEGIN); 3695 NetLog::PHASE_BEGIN);
3696 pos = ExpectLogContainsSomewhere(entries, pos + 1, 3696 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3697 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, 3697 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST,
3698 NetLog::PHASE_END); 3698 NetLog::PHASE_END);
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
6707 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 6707 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
6708 scoped_ptr<SSLSocketDataProvider> ssl_provider( 6708 scoped_ptr<SSLSocketDataProvider> ssl_provider(
6709 new SSLSocketDataProvider(ASYNC, OK)); 6709 new SSLSocketDataProvider(ASYNC, OK));
6710 // Set to TLS_RSA_WITH_NULL_MD5 6710 // Set to TLS_RSA_WITH_NULL_MD5
6711 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 6711 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
6712 6712
6713 RunTLSUsageCheckTest(ssl_provider.Pass()); 6713 RunTLSUsageCheckTest(ssl_provider.Pass());
6714 } 6714 }
6715 6715
6716 } // namespace net 6716 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698