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

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

Issue 1808963004: Adding macro to enable changing SSL library (Part 1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove remoting_nacl change. Created 4 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
« no previous file with comments | « net/test/net_test_suite.cc ('k') | net/url_request/url_request_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 "net/url_request/url_fetcher_impl.h" 5 #include "net/url_request/url_fetcher_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 24 matching lines...) Expand all
35 #include "net/base/upload_file_element_reader.h" 35 #include "net/base/upload_file_element_reader.h"
36 #include "net/dns/mock_host_resolver.h" 36 #include "net/dns/mock_host_resolver.h"
37 #include "net/http/http_response_headers.h" 37 #include "net/http/http_response_headers.h"
38 #include "net/test/embedded_test_server/embedded_test_server.h" 38 #include "net/test/embedded_test_server/embedded_test_server.h"
39 #include "net/url_request/url_fetcher_delegate.h" 39 #include "net/url_request/url_fetcher_delegate.h"
40 #include "net/url_request/url_request_context_getter.h" 40 #include "net/url_request/url_request_context_getter.h"
41 #include "net/url_request/url_request_test_util.h" 41 #include "net/url_request/url_request_test_util.h"
42 #include "net/url_request/url_request_throttler_manager.h" 42 #include "net/url_request/url_request_throttler_manager.h"
43 #include "testing/gtest/include/gtest/gtest.h" 43 #include "testing/gtest/include/gtest/gtest.h"
44 44
45 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 45 #if defined(USE_NSS_VERIFIER)
46 #include "net/cert_net/nss_ocsp.h" 46 #include "net/cert_net/nss_ocsp.h"
47 #endif 47 #endif
48 48
49 namespace net { 49 namespace net {
50 50
51 using base::Time; 51 using base::Time;
52 using base::TimeDelta; 52 using base::TimeDelta;
53 53
54 // TODO(eroman): Add a regression test for http://crbug.com/40505. 54 // TODO(eroman): Add a regression test for http://crbug.com/40505.
55 55
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 void SetUp() override { 415 void SetUp() override {
416 SetUpServer(); 416 SetUpServer();
417 ASSERT_TRUE(test_server_->Start()); 417 ASSERT_TRUE(test_server_->Start());
418 418
419 // URL that will hang when lookups reach the host resolver. 419 // URL that will hang when lookups reach the host resolver.
420 hanging_url_ = GURL(base::StringPrintf( 420 hanging_url_ = GURL(base::StringPrintf(
421 "http://example.com:%d%s", test_server_->host_port_pair().port(), 421 "http://example.com:%d%s", test_server_->host_port_pair().port(),
422 kDefaultResponsePath)); 422 kDefaultResponsePath));
423 ASSERT_TRUE(hanging_url_.is_valid()); 423 ASSERT_TRUE(hanging_url_.is_valid());
424 424
425 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 425 #if defined(USE_NSS_VERIFIER)
426 crypto::EnsureNSSInit(); 426 crypto::EnsureNSSInit();
427 EnsureNSSHttpIOInit(); 427 EnsureNSSHttpIOInit();
428 #endif 428 #endif
429 } 429 }
430 430
431 void TearDown() override { 431 void TearDown() override {
432 #if defined(USE_NSS_CERTS) || defined(OS_IOS) 432 #if defined(USE_NSS_VERIFIER)
433 ShutdownNSSHttpIO(); 433 ShutdownNSSHttpIO();
434 #endif 434 #endif
435 } 435 }
436 436
437 // Initializes |test_server_| without starting it. Allows subclasses to use 437 // Initializes |test_server_| without starting it. Allows subclasses to use
438 // their own server configuration. 438 // their own server configuration.
439 virtual void SetUpServer() { 439 virtual void SetUpServer() {
440 test_server_.reset(new EmbeddedTestServer); 440 test_server_.reset(new EmbeddedTestServer);
441 test_server_->AddDefaultHandlers(base::FilePath(kDocRoot)); 441 test_server_->AddDefaultHandlers(base::FilePath(kDocRoot));
442 } 442 }
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode()); 1427 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode());
1428 EXPECT_TRUE(delegate.fetcher()->GetCookies().empty()); 1428 EXPECT_TRUE(delegate.fetcher()->GetCookies().empty());
1429 std::string data; 1429 std::string data;
1430 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data)); 1430 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data));
1431 EXPECT_TRUE(data.empty()); 1431 EXPECT_TRUE(data.empty());
1432 } 1432 }
1433 1433
1434 } // namespace 1434 } // namespace
1435 1435
1436 } // namespace net 1436 } // namespace net
OLDNEW
« no previous file with comments | « net/test/net_test_suite.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698