| OLD | NEW |
| 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 |
| 11 | 11 |
| 12 #include <stdint.h> | 12 #include <stdint.h> |
| 13 | 13 |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 #include <limits> |
| 15 | 16 |
| 16 #include "base/basictypes.h" | |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
| 20 #include "base/files/file_util.h" | 20 #include "base/files/file_util.h" |
| 21 #include "base/files/scoped_temp_dir.h" | 21 #include "base/files/scoped_temp_dir.h" |
| 22 #include "base/format_macros.h" | 22 #include "base/format_macros.h" |
| 23 #include "base/json/json_reader.h" | 23 #include "base/json/json_reader.h" |
| 24 #include "base/location.h" | 24 #include "base/location.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 new UploadBytesElementReader(data, strlen(data))); | 295 new UploadBytesElementReader(data, strlen(data))); |
| 296 return ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0); | 296 return ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0); |
| 297 } | 297 } |
| 298 | 298 |
| 299 // Verify that the SSLInfo of a successful SSL connection has valid values. | 299 // Verify that the SSLInfo of a successful SSL connection has valid values. |
| 300 void CheckSSLInfo(const SSLInfo& ssl_info) { | 300 void CheckSSLInfo(const SSLInfo& ssl_info) { |
| 301 // -1 means unknown. 0 means no encryption. | 301 // -1 means unknown. 0 means no encryption. |
| 302 EXPECT_GT(ssl_info.security_bits, 0); | 302 EXPECT_GT(ssl_info.security_bits, 0); |
| 303 | 303 |
| 304 // The cipher suite TLS_NULL_WITH_NULL_NULL (0) must not be negotiated. | 304 // The cipher suite TLS_NULL_WITH_NULL_NULL (0) must not be negotiated. |
| 305 uint16 cipher_suite = SSLConnectionStatusToCipherSuite( | 305 uint16_t cipher_suite = |
| 306 ssl_info.connection_status); | 306 SSLConnectionStatusToCipherSuite(ssl_info.connection_status); |
| 307 EXPECT_NE(0U, cipher_suite); | 307 EXPECT_NE(0U, cipher_suite); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void CheckFullRequestHeaders(const HttpRequestHeaders& headers, | 310 void CheckFullRequestHeaders(const HttpRequestHeaders& headers, |
| 311 const GURL& host_url) { | 311 const GURL& host_url) { |
| 312 std::string sent_value; | 312 std::string sent_value; |
| 313 | 313 |
| 314 EXPECT_TRUE(headers.GetHeader("Host", &sent_value)); | 314 EXPECT_TRUE(headers.GetHeader("Host", &sent_value)); |
| 315 EXPECT_EQ(GetHostAndOptionalPort(host_url), sent_value); | 315 EXPECT_EQ(GetHostAndOptionalPort(host_url), sent_value); |
| 316 | 316 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 TestDelegate d; | 807 TestDelegate d; |
| 808 { | 808 { |
| 809 scoped_ptr<URLRequest> r( | 809 scoped_ptr<URLRequest> r( |
| 810 default_context_.CreateRequest(app_url, DEFAULT_PRIORITY, &d)); | 810 default_context_.CreateRequest(app_url, DEFAULT_PRIORITY, &d)); |
| 811 | 811 |
| 812 r->Start(); | 812 r->Start(); |
| 813 EXPECT_TRUE(r->is_pending()); | 813 EXPECT_TRUE(r->is_pending()); |
| 814 | 814 |
| 815 base::RunLoop().Run(); | 815 base::RunLoop().Run(); |
| 816 | 816 |
| 817 int64 file_size = -1; | 817 int64_t file_size = -1; |
| 818 EXPECT_TRUE(base::GetFileSize(app_path, &file_size)); | 818 EXPECT_TRUE(base::GetFileSize(app_path, &file_size)); |
| 819 | 819 |
| 820 EXPECT_TRUE(!r->is_pending()); | 820 EXPECT_TRUE(!r->is_pending()); |
| 821 EXPECT_EQ(1, d.response_started_count()); | 821 EXPECT_EQ(1, d.response_started_count()); |
| 822 EXPECT_FALSE(d.received_data_before_response()); | 822 EXPECT_FALSE(d.received_data_before_response()); |
| 823 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); | 823 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); |
| 824 EXPECT_EQ("", r->GetSocketAddress().host()); | 824 EXPECT_EQ("", r->GetSocketAddress().host()); |
| 825 EXPECT_EQ(0, r->GetSocketAddress().port()); | 825 EXPECT_EQ(0, r->GetSocketAddress().port()); |
| 826 | 826 |
| 827 HttpRequestHeaders headers; | 827 HttpRequestHeaders headers; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 851 TEST_F(URLRequestTest, FileTestFullSpecifiedRange) { | 851 TEST_F(URLRequestTest, FileTestFullSpecifiedRange) { |
| 852 const size_t buffer_size = 4000; | 852 const size_t buffer_size = 4000; |
| 853 scoped_ptr<char[]> buffer(new char[buffer_size]); | 853 scoped_ptr<char[]> buffer(new char[buffer_size]); |
| 854 FillBuffer(buffer.get(), buffer_size); | 854 FillBuffer(buffer.get(), buffer_size); |
| 855 | 855 |
| 856 base::FilePath temp_path; | 856 base::FilePath temp_path; |
| 857 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); | 857 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); |
| 858 GURL temp_url = FilePathToFileURL(temp_path); | 858 GURL temp_url = FilePathToFileURL(temp_path); |
| 859 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); | 859 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); |
| 860 | 860 |
| 861 int64 file_size; | 861 int64_t file_size; |
| 862 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); | 862 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); |
| 863 | 863 |
| 864 const size_t first_byte_position = 500; | 864 const size_t first_byte_position = 500; |
| 865 const size_t last_byte_position = buffer_size - first_byte_position; | 865 const size_t last_byte_position = buffer_size - first_byte_position; |
| 866 const size_t content_length = last_byte_position - first_byte_position + 1; | 866 const size_t content_length = last_byte_position - first_byte_position + 1; |
| 867 std::string partial_buffer_string(buffer.get() + first_byte_position, | 867 std::string partial_buffer_string(buffer.get() + first_byte_position, |
| 868 buffer.get() + last_byte_position + 1); | 868 buffer.get() + last_byte_position + 1); |
| 869 | 869 |
| 870 TestDelegate d; | 870 TestDelegate d; |
| 871 { | 871 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 896 TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) { | 896 TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) { |
| 897 const size_t buffer_size = 4000; | 897 const size_t buffer_size = 4000; |
| 898 scoped_ptr<char[]> buffer(new char[buffer_size]); | 898 scoped_ptr<char[]> buffer(new char[buffer_size]); |
| 899 FillBuffer(buffer.get(), buffer_size); | 899 FillBuffer(buffer.get(), buffer_size); |
| 900 | 900 |
| 901 base::FilePath temp_path; | 901 base::FilePath temp_path; |
| 902 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); | 902 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); |
| 903 GURL temp_url = FilePathToFileURL(temp_path); | 903 GURL temp_url = FilePathToFileURL(temp_path); |
| 904 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); | 904 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); |
| 905 | 905 |
| 906 int64 file_size; | 906 int64_t file_size; |
| 907 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); | 907 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); |
| 908 | 908 |
| 909 const size_t first_byte_position = 500; | 909 const size_t first_byte_position = 500; |
| 910 const size_t last_byte_position = buffer_size - 1; | 910 const size_t last_byte_position = buffer_size - 1; |
| 911 const size_t content_length = last_byte_position - first_byte_position + 1; | 911 const size_t content_length = last_byte_position - first_byte_position + 1; |
| 912 std::string partial_buffer_string(buffer.get() + first_byte_position, | 912 std::string partial_buffer_string(buffer.get() + first_byte_position, |
| 913 buffer.get() + last_byte_position + 1); | 913 buffer.get() + last_byte_position + 1); |
| 914 | 914 |
| 915 TestDelegate d; | 915 TestDelegate d; |
| 916 { | 916 { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 940 TEST_F(URLRequestTest, FileTestMultipleRanges) { | 940 TEST_F(URLRequestTest, FileTestMultipleRanges) { |
| 941 const size_t buffer_size = 400000; | 941 const size_t buffer_size = 400000; |
| 942 scoped_ptr<char[]> buffer(new char[buffer_size]); | 942 scoped_ptr<char[]> buffer(new char[buffer_size]); |
| 943 FillBuffer(buffer.get(), buffer_size); | 943 FillBuffer(buffer.get(), buffer_size); |
| 944 | 944 |
| 945 base::FilePath temp_path; | 945 base::FilePath temp_path; |
| 946 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); | 946 EXPECT_TRUE(base::CreateTemporaryFile(&temp_path)); |
| 947 GURL temp_url = FilePathToFileURL(temp_path); | 947 GURL temp_url = FilePathToFileURL(temp_path); |
| 948 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); | 948 EXPECT_TRUE(base::WriteFile(temp_path, buffer.get(), buffer_size)); |
| 949 | 949 |
| 950 int64 file_size; | 950 int64_t file_size; |
| 951 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); | 951 EXPECT_TRUE(base::GetFileSize(temp_path, &file_size)); |
| 952 | 952 |
| 953 TestDelegate d; | 953 TestDelegate d; |
| 954 { | 954 { |
| 955 scoped_ptr<URLRequest> r( | 955 scoped_ptr<URLRequest> r( |
| 956 default_context_.CreateRequest(temp_url, DEFAULT_PRIORITY, &d)); | 956 default_context_.CreateRequest(temp_url, DEFAULT_PRIORITY, &d)); |
| 957 | 957 |
| 958 HttpRequestHeaders headers; | 958 HttpRequestHeaders headers; |
| 959 headers.SetHeader(HttpRequestHeaders::kRange, "bytes=0-0,10-200,200-300"); | 959 headers.SetHeader(HttpRequestHeaders::kRange, "bytes=0-0,10-200,200-300"); |
| 960 r->SetExtraRequestHeaders(headers); | 960 r->SetExtraRequestHeaders(headers); |
| (...skipping 4586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5547 base::FilePath dir; | 5547 base::FilePath dir; |
| 5548 PathService::Get(base::DIR_EXE, &dir); | 5548 PathService::Get(base::DIR_EXE, &dir); |
| 5549 base::SetCurrentDirectory(dir); | 5549 base::SetCurrentDirectory(dir); |
| 5550 | 5550 |
| 5551 std::vector<scoped_ptr<UploadElementReader>> element_readers; | 5551 std::vector<scoped_ptr<UploadElementReader>> element_readers; |
| 5552 | 5552 |
| 5553 base::FilePath path; | 5553 base::FilePath path; |
| 5554 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 5554 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 5555 path = path.Append(kTestFilePath); | 5555 path = path.Append(kTestFilePath); |
| 5556 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); | 5556 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); |
| 5557 element_readers.push_back(make_scoped_ptr( | 5557 element_readers.push_back(make_scoped_ptr(new UploadFileElementReader( |
| 5558 new UploadFileElementReader(base::ThreadTaskRunnerHandle::Get().get(), | 5558 base::ThreadTaskRunnerHandle::Get().get(), path, 0, |
| 5559 path, 0, kuint64max, base::Time()))); | 5559 std::numeric_limits<uint64_t>::max(), base::Time()))); |
| 5560 r->set_upload(make_scoped_ptr<UploadDataStream>( | 5560 r->set_upload(make_scoped_ptr<UploadDataStream>( |
| 5561 new ElementsUploadDataStream(std::move(element_readers), 0))); | 5561 new ElementsUploadDataStream(std::move(element_readers), 0))); |
| 5562 | 5562 |
| 5563 r->Start(); | 5563 r->Start(); |
| 5564 EXPECT_TRUE(r->is_pending()); | 5564 EXPECT_TRUE(r->is_pending()); |
| 5565 | 5565 |
| 5566 base::RunLoop().Run(); | 5566 base::RunLoop().Run(); |
| 5567 | 5567 |
| 5568 int64 size64 = 0; | 5568 int64_t size64 = 0; |
| 5569 ASSERT_EQ(true, base::GetFileSize(path, &size64)); | 5569 ASSERT_EQ(true, base::GetFileSize(path, &size64)); |
| 5570 ASSERT_LE(size64, std::numeric_limits<int>::max()); | 5570 ASSERT_LE(size64, std::numeric_limits<int>::max()); |
| 5571 int size = static_cast<int>(size64); | 5571 int size = static_cast<int>(size64); |
| 5572 scoped_ptr<char[]> buf(new char[size]); | 5572 scoped_ptr<char[]> buf(new char[size]); |
| 5573 | 5573 |
| 5574 ASSERT_EQ(size, base::ReadFile(path, buf.get(), size)); | 5574 ASSERT_EQ(size, base::ReadFile(path, buf.get(), size)); |
| 5575 | 5575 |
| 5576 ASSERT_EQ(1, d.response_started_count()) | 5576 ASSERT_EQ(1, d.response_started_count()) |
| 5577 << "request failed: " << r->status().status() | 5577 << "request failed: " << r->status().status() |
| 5578 << ", error: " << r->status().error(); | 5578 << ", error: " << r->status().error(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5592 scoped_ptr<URLRequest> r(default_context_.CreateRequest( | 5592 scoped_ptr<URLRequest> r(default_context_.CreateRequest( |
| 5593 http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d)); | 5593 http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d)); |
| 5594 r->set_method("POST"); | 5594 r->set_method("POST"); |
| 5595 | 5595 |
| 5596 std::vector<scoped_ptr<UploadElementReader>> element_readers; | 5596 std::vector<scoped_ptr<UploadElementReader>> element_readers; |
| 5597 | 5597 |
| 5598 element_readers.push_back(make_scoped_ptr(new UploadFileElementReader( | 5598 element_readers.push_back(make_scoped_ptr(new UploadFileElementReader( |
| 5599 base::ThreadTaskRunnerHandle::Get().get(), | 5599 base::ThreadTaskRunnerHandle::Get().get(), |
| 5600 base::FilePath(FILE_PATH_LITERAL( | 5600 base::FilePath(FILE_PATH_LITERAL( |
| 5601 "c:\\path\\to\\non\\existant\\file.randomness.12345")), | 5601 "c:\\path\\to\\non\\existant\\file.randomness.12345")), |
| 5602 0, kuint64max, base::Time()))); | 5602 0, std::numeric_limits<uint64_t>::max(), base::Time()))); |
| 5603 r->set_upload(make_scoped_ptr<UploadDataStream>( | 5603 r->set_upload(make_scoped_ptr<UploadDataStream>( |
| 5604 new ElementsUploadDataStream(std::move(element_readers), 0))); | 5604 new ElementsUploadDataStream(std::move(element_readers), 0))); |
| 5605 | 5605 |
| 5606 r->Start(); | 5606 r->Start(); |
| 5607 EXPECT_TRUE(r->is_pending()); | 5607 EXPECT_TRUE(r->is_pending()); |
| 5608 | 5608 |
| 5609 base::RunLoop().Run(); | 5609 base::RunLoop().Run(); |
| 5610 | 5610 |
| 5611 EXPECT_TRUE(d.request_failed()); | 5611 EXPECT_TRUE(d.request_failed()); |
| 5612 EXPECT_FALSE(d.received_data_before_response()); | 5612 EXPECT_FALSE(d.received_data_before_response()); |
| (...skipping 2916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8529 TestSSLConfigService(bool ev_enabled, | 8529 TestSSLConfigService(bool ev_enabled, |
| 8530 bool online_rev_checking, | 8530 bool online_rev_checking, |
| 8531 bool rev_checking_required_local_anchors) | 8531 bool rev_checking_required_local_anchors) |
| 8532 : ev_enabled_(ev_enabled), | 8532 : ev_enabled_(ev_enabled), |
| 8533 online_rev_checking_(online_rev_checking), | 8533 online_rev_checking_(online_rev_checking), |
| 8534 rev_checking_required_local_anchors_( | 8534 rev_checking_required_local_anchors_( |
| 8535 rev_checking_required_local_anchors), | 8535 rev_checking_required_local_anchors), |
| 8536 min_version_(kDefaultSSLVersionMin), | 8536 min_version_(kDefaultSSLVersionMin), |
| 8537 fallback_min_version_(kDefaultSSLVersionFallbackMin) {} | 8537 fallback_min_version_(kDefaultSSLVersionFallbackMin) {} |
| 8538 | 8538 |
| 8539 void set_min_version(uint16 version) { | 8539 void set_min_version(uint16_t version) { min_version_ = version; } |
| 8540 min_version_ = version; | |
| 8541 } | |
| 8542 | 8540 |
| 8543 void set_fallback_min_version(uint16 version) { | 8541 void set_fallback_min_version(uint16_t version) { |
| 8544 fallback_min_version_ = version; | 8542 fallback_min_version_ = version; |
| 8545 } | 8543 } |
| 8546 | 8544 |
| 8547 // SSLConfigService: | 8545 // SSLConfigService: |
| 8548 void GetSSLConfig(SSLConfig* config) override { | 8546 void GetSSLConfig(SSLConfig* config) override { |
| 8549 *config = SSLConfig(); | 8547 *config = SSLConfig(); |
| 8550 config->rev_checking_enabled = online_rev_checking_; | 8548 config->rev_checking_enabled = online_rev_checking_; |
| 8551 config->verify_ev_cert = ev_enabled_; | 8549 config->verify_ev_cert = ev_enabled_; |
| 8552 config->rev_checking_required_local_anchors = | 8550 config->rev_checking_required_local_anchors = |
| 8553 rev_checking_required_local_anchors_; | 8551 rev_checking_required_local_anchors_; |
| 8554 if (fallback_min_version_) { | 8552 if (fallback_min_version_) { |
| 8555 config->version_fallback_min = fallback_min_version_; | 8553 config->version_fallback_min = fallback_min_version_; |
| 8556 } | 8554 } |
| 8557 if (min_version_) { | 8555 if (min_version_) { |
| 8558 config->version_min = min_version_; | 8556 config->version_min = min_version_; |
| 8559 } | 8557 } |
| 8560 } | 8558 } |
| 8561 | 8559 |
| 8562 protected: | 8560 protected: |
| 8563 ~TestSSLConfigService() override {} | 8561 ~TestSSLConfigService() override {} |
| 8564 | 8562 |
| 8565 private: | 8563 private: |
| 8566 const bool ev_enabled_; | 8564 const bool ev_enabled_; |
| 8567 const bool online_rev_checking_; | 8565 const bool online_rev_checking_; |
| 8568 const bool rev_checking_required_local_anchors_; | 8566 const bool rev_checking_required_local_anchors_; |
| 8569 uint16 min_version_; | 8567 uint16_t min_version_; |
| 8570 uint16 fallback_min_version_; | 8568 uint16_t fallback_min_version_; |
| 8571 }; | 8569 }; |
| 8572 | 8570 |
| 8573 class FallbackTestURLRequestContext : public TestURLRequestContext { | 8571 class FallbackTestURLRequestContext : public TestURLRequestContext { |
| 8574 public: | 8572 public: |
| 8575 explicit FallbackTestURLRequestContext(bool delay_initialization) | 8573 explicit FallbackTestURLRequestContext(bool delay_initialization) |
| 8576 : TestURLRequestContext(delay_initialization) {} | 8574 : TestURLRequestContext(delay_initialization) {} |
| 8577 | 8575 |
| 8578 void set_fallback_min_version(uint16 version) { | 8576 void set_fallback_min_version(uint16_t version) { |
| 8579 TestSSLConfigService *ssl_config_service = | 8577 TestSSLConfigService *ssl_config_service = |
| 8580 new TestSSLConfigService(true /* check for EV */, | 8578 new TestSSLConfigService(true /* check for EV */, |
| 8581 false /* online revocation checking */, | 8579 false /* online revocation checking */, |
| 8582 false /* require rev. checking for local | 8580 false /* require rev. checking for local |
| 8583 anchors */); | 8581 anchors */); |
| 8584 ssl_config_service->set_fallback_min_version(version); | 8582 ssl_config_service->set_fallback_min_version(version); |
| 8585 set_ssl_config_service(ssl_config_service); | 8583 set_ssl_config_service(ssl_config_service); |
| 8586 } | 8584 } |
| 8587 }; | 8585 }; |
| 8588 | 8586 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 8603 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 8601 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 8604 ASSERT_TRUE(test_server.Start()); | 8602 ASSERT_TRUE(test_server.Start()); |
| 8605 | 8603 |
| 8606 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, | 8604 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, |
| 8607 &delegate_); | 8605 &delegate_); |
| 8608 request_->Start(); | 8606 request_->Start(); |
| 8609 | 8607 |
| 8610 base::RunLoop().Run(); | 8608 base::RunLoop().Run(); |
| 8611 } | 8609 } |
| 8612 | 8610 |
| 8613 void set_fallback_min_version(uint16 version) { | 8611 void set_fallback_min_version(uint16_t version) { |
| 8614 context_.set_fallback_min_version(version); | 8612 context_.set_fallback_min_version(version); |
| 8615 } | 8613 } |
| 8616 | 8614 |
| 8617 void ExpectConnection(int version) { | 8615 void ExpectConnection(int version) { |
| 8618 EXPECT_EQ(1, delegate_.response_started_count()); | 8616 EXPECT_EQ(1, delegate_.response_started_count()); |
| 8619 EXPECT_NE(0, delegate_.bytes_received()); | 8617 EXPECT_NE(0, delegate_.bytes_received()); |
| 8620 EXPECT_EQ(version, SSLConnectionStatusToVersion( | 8618 EXPECT_EQ(version, SSLConnectionStatusToVersion( |
| 8621 request_->ssl_info().connection_status)); | 8619 request_->ssl_info().connection_status)); |
| 8622 EXPECT_TRUE(request_->ssl_info().connection_status & | 8620 EXPECT_TRUE(request_->ssl_info().connection_status & |
| 8623 SSL_CONNECTION_VERSION_FALLBACK); | 8621 SSL_CONNECTION_VERSION_FALLBACK); |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9799 | 9797 |
| 9800 req->Start(); | 9798 req->Start(); |
| 9801 req->Cancel(); | 9799 req->Cancel(); |
| 9802 job->DetachRequest(); | 9800 job->DetachRequest(); |
| 9803 base::RunLoop().RunUntilIdle(); | 9801 base::RunLoop().RunUntilIdle(); |
| 9804 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 9802 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
| 9805 EXPECT_EQ(0, d.received_redirect_count()); | 9803 EXPECT_EQ(0, d.received_redirect_count()); |
| 9806 } | 9804 } |
| 9807 | 9805 |
| 9808 } // namespace net | 9806 } // namespace net |
| OLD | NEW |