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

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

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing more nits. Created 4 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
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 26 matching lines...) Expand all
37 #include "net/base/upload_file_element_reader.h" 37 #include "net/base/upload_file_element_reader.h"
38 #include "net/dns/mock_host_resolver.h" 38 #include "net/dns/mock_host_resolver.h"
39 #include "net/http/http_response_headers.h" 39 #include "net/http/http_response_headers.h"
40 #include "net/test/embedded_test_server/embedded_test_server.h" 40 #include "net/test/embedded_test_server/embedded_test_server.h"
41 #include "net/url_request/url_fetcher_delegate.h" 41 #include "net/url_request/url_fetcher_delegate.h"
42 #include "net/url_request/url_request_context_getter.h" 42 #include "net/url_request/url_request_context_getter.h"
43 #include "net/url_request/url_request_test_util.h" 43 #include "net/url_request/url_request_test_util.h"
44 #include "net/url_request/url_request_throttler_manager.h" 44 #include "net/url_request/url_request_throttler_manager.h"
45 #include "testing/gtest/include/gtest/gtest.h" 45 #include "testing/gtest/include/gtest/gtest.h"
46 46
47 #if defined(USE_NSS_VERIFIER) 47 #if defined(USE_NSS_CERTS)
48 #include "net/cert_net/nss_ocsp.h" 48 #include "net/cert_net/nss_ocsp.h"
49 #endif 49 #endif
50 50
51 namespace net { 51 namespace net {
52 52
53 using base::Time; 53 using base::Time;
54 using base::TimeDelta; 54 using base::TimeDelta;
55 55
56 // TODO(eroman): Add a regression test for http://crbug.com/40505. 56 // TODO(eroman): Add a regression test for http://crbug.com/40505.
57 57
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void SetUp() override { 417 void SetUp() override {
418 SetUpServer(); 418 SetUpServer();
419 ASSERT_TRUE(test_server_->Start()); 419 ASSERT_TRUE(test_server_->Start());
420 420
421 // URL that will hang when lookups reach the host resolver. 421 // URL that will hang when lookups reach the host resolver.
422 hanging_url_ = GURL(base::StringPrintf( 422 hanging_url_ = GURL(base::StringPrintf(
423 "http://example.com:%d%s", test_server_->host_port_pair().port(), 423 "http://example.com:%d%s", test_server_->host_port_pair().port(),
424 kDefaultResponsePath)); 424 kDefaultResponsePath));
425 ASSERT_TRUE(hanging_url_.is_valid()); 425 ASSERT_TRUE(hanging_url_.is_valid());
426 426
427 #if defined(USE_NSS_VERIFIER) 427 #if defined(USE_NSS_CERTS)
428 crypto::EnsureNSSInit(); 428 crypto::EnsureNSSInit();
429 EnsureNSSHttpIOInit(); 429 EnsureNSSHttpIOInit();
430 #endif 430 #endif
431 } 431 }
432 432
433 void TearDown() override { 433 void TearDown() override {
434 #if defined(USE_NSS_VERIFIER) 434 #if defined(USE_NSS_CERTS)
435 ShutdownNSSHttpIO(); 435 ShutdownNSSHttpIO();
436 #endif 436 #endif
437 } 437 }
438 438
439 // Initializes |test_server_| without starting it. Allows subclasses to use 439 // Initializes |test_server_| without starting it. Allows subclasses to use
440 // their own server configuration. 440 // their own server configuration.
441 virtual void SetUpServer() { 441 virtual void SetUpServer() {
442 test_server_.reset(new EmbeddedTestServer); 442 test_server_.reset(new EmbeddedTestServer);
443 test_server_->AddDefaultHandlers(base::FilePath(kDocRoot)); 443 test_server_->AddDefaultHandlers(base::FilePath(kDocRoot));
444 } 444 }
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode()); 1522 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode());
1523 EXPECT_TRUE(delegate.fetcher()->GetCookies().empty()); 1523 EXPECT_TRUE(delegate.fetcher()->GetCookies().empty());
1524 std::string data; 1524 std::string data;
1525 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data)); 1525 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data));
1526 EXPECT_TRUE(data.empty()); 1526 EXPECT_TRUE(data.empty());
1527 } 1527 }
1528 1528
1529 } // namespace 1529 } // namespace
1530 1530
1531 } // namespace net 1531 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698