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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 7 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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 6338 matching lines...) Expand 10 before | Expand all | Expand 10 after
6349 params.ssl_config_service = default_context_.ssl_config_service(); 6349 params.ssl_config_service = default_context_.ssl_config_service();
6350 params.http_auth_handler_factory = 6350 params.http_auth_handler_factory =
6351 default_context_.http_auth_handler_factory(); 6351 default_context_.http_auth_handler_factory();
6352 params.network_delegate = &default_network_delegate_; 6352 params.network_delegate = &default_network_delegate_;
6353 params.http_server_properties = default_context_.http_server_properties(); 6353 params.http_server_properties = default_context_.http_server_properties();
6354 scoped_ptr<HttpNetworkLayer> network_layer( 6354 scoped_ptr<HttpNetworkLayer> network_layer(
6355 new HttpNetworkLayer(new HttpNetworkSession(params))); 6355 new HttpNetworkLayer(new HttpNetworkSession(params)));
6356 network_layer->OnSuspend(); 6356 network_layer->OnSuspend();
6357 6357
6358 HttpCache http_cache(network_layer.release(), default_context_.net_log(), 6358 HttpCache http_cache(network_layer.release(), default_context_.net_log(),
6359 HttpCache::DefaultBackend::InMemory(0)); 6359 HttpCache::DefaultBackend::InMemory(0), false);
6360 6360
6361 TestURLRequestContext context(true); 6361 TestURLRequestContext context(true);
6362 context.set_http_transaction_factory(&http_cache); 6362 context.set_http_transaction_factory(&http_cache);
6363 context.Init(); 6363 context.Init();
6364 6364
6365 TestDelegate d; 6365 TestDelegate d;
6366 URLRequest req(GURL("http://127.0.0.1/"), 6366 URLRequest req(GURL("http://127.0.0.1/"),
6367 DEFAULT_PRIORITY, 6367 DEFAULT_PRIORITY,
6368 &d, 6368 &d,
6369 &context); 6369 &context);
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
7994 7994
7995 EXPECT_FALSE(r.is_pending()); 7995 EXPECT_FALSE(r.is_pending());
7996 EXPECT_EQ(1, d->response_started_count()); 7996 EXPECT_EQ(1, d->response_started_count());
7997 EXPECT_FALSE(d->received_data_before_response()); 7997 EXPECT_FALSE(d->received_data_before_response());
7998 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 7998 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
7999 } 7999 }
8000 } 8000 }
8001 #endif // !defined(DISABLE_FTP_SUPPORT) 8001 #endif // !defined(DISABLE_FTP_SUPPORT)
8002 8002
8003 } // namespace net 8003 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698