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

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

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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.cc ('k') | net/spdy/spdy_proxy_client_socket.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 <cmath> 5 #include <cmath>
6 #include <memory> 6 #include <memory>
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 12 matching lines...) Expand all
23 #include "net/base/proxy_delegate.h" 23 #include "net/base/proxy_delegate.h"
24 #include "net/base/request_priority.h" 24 #include "net/base/request_priority.h"
25 #include "net/base/test_proxy_delegate.h" 25 #include "net/base/test_proxy_delegate.h"
26 #include "net/base/upload_bytes_element_reader.h" 26 #include "net/base/upload_bytes_element_reader.h"
27 #include "net/base/upload_file_element_reader.h" 27 #include "net/base/upload_file_element_reader.h"
28 #include "net/http/http_auth_scheme.h" 28 #include "net/http/http_auth_scheme.h"
29 #include "net/http/http_network_session_peer.h" 29 #include "net/http/http_network_session_peer.h"
30 #include "net/http/http_network_transaction.h" 30 #include "net/http/http_network_transaction.h"
31 #include "net/http/http_server_properties.h" 31 #include "net/http/http_server_properties.h"
32 #include "net/http/http_transaction_test_util.h" 32 #include "net/http/http_transaction_test_util.h"
33 #include "net/log/net_log_event_type.h"
33 #include "net/log/test_net_log.h" 34 #include "net/log/test_net_log.h"
34 #include "net/log/test_net_log_entry.h" 35 #include "net/log/test_net_log_entry.h"
35 #include "net/log/test_net_log_util.h" 36 #include "net/log/test_net_log_util.h"
36 #include "net/proxy/proxy_server.h" 37 #include "net/proxy/proxy_server.h"
37 #include "net/socket/client_socket_pool_base.h" 38 #include "net/socket/client_socket_pool_base.h"
38 #include "net/socket/next_proto.h" 39 #include "net/socket/next_proto.h"
39 #include "net/spdy/buffered_spdy_framer.h" 40 #include "net/spdy/buffered_spdy_framer.h"
40 #include "net/spdy/spdy_http_stream.h" 41 #include "net/spdy/spdy_http_stream.h"
41 #include "net/spdy/spdy_http_utils.h" 42 #include "net/spdy/spdy_http_utils.h"
42 #include "net/spdy/spdy_session.h" 43 #include "net/spdy/spdy_session.h"
(...skipping 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3254 3255
3255 // Check that the NetLog was filled reasonably. 3256 // Check that the NetLog was filled reasonably.
3256 // This test is intentionally non-specific about the exact ordering of the 3257 // This test is intentionally non-specific about the exact ordering of the
3257 // log; instead we just check to make sure that certain events exist, and that 3258 // log; instead we just check to make sure that certain events exist, and that
3258 // they are in the right order. 3259 // they are in the right order.
3259 TestNetLogEntry::List entries; 3260 TestNetLogEntry::List entries;
3260 log.GetEntries(&entries); 3261 log.GetEntries(&entries);
3261 3262
3262 EXPECT_LT(0u, entries.size()); 3263 EXPECT_LT(0u, entries.size());
3263 int pos = 0; 3264 int pos = 0;
3264 pos = ExpectLogContainsSomewhere(entries, 0, 3265 pos = ExpectLogContainsSomewhere(
3265 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, 3266 entries, 0, NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST,
3266 NetLog::PHASE_BEGIN); 3267 NetLogEventPhase::BEGIN);
3268 pos = ExpectLogContainsSomewhere(
3269 entries, pos + 1, NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST,
3270 NetLogEventPhase::END);
3271 pos = ExpectLogContainsSomewhere(
3272 entries, pos + 1, NetLogEventType::HTTP_TRANSACTION_READ_HEADERS,
3273 NetLogEventPhase::BEGIN);
3274 pos = ExpectLogContainsSomewhere(
3275 entries, pos + 1, NetLogEventType::HTTP_TRANSACTION_READ_HEADERS,
3276 NetLogEventPhase::END);
3267 pos = ExpectLogContainsSomewhere(entries, pos + 1, 3277 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3268 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST, 3278 NetLogEventType::HTTP_TRANSACTION_READ_BODY,
3269 NetLog::PHASE_END); 3279 NetLogEventPhase::BEGIN);
3270 pos = ExpectLogContainsSomewhere(entries, pos + 1, 3280 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3271 NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS, 3281 NetLogEventType::HTTP_TRANSACTION_READ_BODY,
3272 NetLog::PHASE_BEGIN); 3282 NetLogEventPhase::END);
3273 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3274 NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS,
3275 NetLog::PHASE_END);
3276 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3277 NetLog::TYPE_HTTP_TRANSACTION_READ_BODY,
3278 NetLog::PHASE_BEGIN);
3279 pos = ExpectLogContainsSomewhere(entries, pos + 1,
3280 NetLog::TYPE_HTTP_TRANSACTION_READ_BODY,
3281 NetLog::PHASE_END);
3282 3283
3283 // Check that we logged all the headers correctly 3284 // Check that we logged all the headers correctly
3284 pos = ExpectLogContainsSomewhere( 3285 pos = ExpectLogContainsSomewhere(entries, 0,
3285 entries, 0, NetLog::TYPE_HTTP2_SESSION_SEND_HEADERS, NetLog::PHASE_NONE); 3286 NetLogEventType::HTTP2_SESSION_SEND_HEADERS,
3287 NetLogEventPhase::NONE);
3286 3288
3287 base::ListValue* header_list; 3289 base::ListValue* header_list;
3288 ASSERT_TRUE(entries[pos].params.get()); 3290 ASSERT_TRUE(entries[pos].params.get());
3289 ASSERT_TRUE(entries[pos].params->GetList("headers", &header_list)); 3291 ASSERT_TRUE(entries[pos].params->GetList("headers", &header_list));
3290 3292
3291 std::vector<std::string> expected; 3293 std::vector<std::string> expected;
3292 expected.push_back(std::string(spdy_util_.GetHostKey()) + 3294 expected.push_back(std::string(spdy_util_.GetHostKey()) +
3293 ": www.example.org"); 3295 ": www.example.org");
3294 expected.push_back(std::string(spdy_util_.GetPathKey()) + ": /"); 3296 expected.push_back(std::string(spdy_util_.GetPathKey()) + ": /");
3295 expected.push_back(std::string(spdy_util_.GetSchemeKey()) + ": " + 3297 expected.push_back(std::string(spdy_util_.GetSchemeKey()) + ": " +
(...skipping 2930 matching lines...) Expand 10 before | Expand all | Expand 10 after
6226 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 6228 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
6227 std::unique_ptr<SSLSocketDataProvider> ssl_provider( 6229 std::unique_ptr<SSLSocketDataProvider> ssl_provider(
6228 new SSLSocketDataProvider(ASYNC, OK)); 6230 new SSLSocketDataProvider(ASYNC, OK));
6229 // Set to TLS_RSA_WITH_NULL_MD5 6231 // Set to TLS_RSA_WITH_NULL_MD5
6230 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 6232 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
6231 6233
6232 RunTLSUsageCheckTest(std::move(ssl_provider)); 6234 RunTLSUsageCheckTest(std::move(ssl_provider));
6233 } 6235 }
6234 6236
6235 } // namespace net 6237 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_stream.cc ('k') | net/spdy/spdy_proxy_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698