OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <math.h> // ceil | 5 #include <math.h> // ceil |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "net/base/client_socket_factory.h" | 8 #include "net/base/client_socket_factory.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/socket_test_util.h" | 10 #include "net/base/socket_test_util.h" |
(...skipping 2580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2591 EXPECT_EQ(-1, trans->header_buf_http_offset_); | 2591 EXPECT_EQ(-1, trans->header_buf_http_offset_); |
2592 EXPECT_EQ(-1, trans->response_body_length_); | 2592 EXPECT_EQ(-1, trans->response_body_length_); |
2593 EXPECT_EQ(0, trans->response_body_read_); | 2593 EXPECT_EQ(0, trans->response_body_read_); |
2594 EXPECT_EQ(NULL, trans->read_buf_.get()); | 2594 EXPECT_EQ(NULL, trans->read_buf_.get()); |
2595 EXPECT_EQ(0, trans->read_buf_len_); | 2595 EXPECT_EQ(0, trans->read_buf_len_); |
2596 EXPECT_EQ("", trans->request_headers_->headers_); | 2596 EXPECT_EQ("", trans->request_headers_->headers_); |
2597 EXPECT_EQ(0U, trans->request_headers_bytes_sent_); | 2597 EXPECT_EQ(0U, trans->request_headers_bytes_sent_); |
2598 EXPECT_EQ(NULL, trans->response_.auth_challenge.get()); | 2598 EXPECT_EQ(NULL, trans->response_.auth_challenge.get()); |
2599 EXPECT_EQ(NULL, trans->response_.headers.get()); | 2599 EXPECT_EQ(NULL, trans->response_.headers.get()); |
2600 EXPECT_EQ(false, trans->response_.was_cached); | 2600 EXPECT_EQ(false, trans->response_.was_cached); |
2601 EXPECT_EQ(base::kInvalidPlatformFileValue, | |
2602 trans->response_.response_data_file); | |
2603 EXPECT_EQ(0, trans->response_.ssl_info.cert_status); | 2601 EXPECT_EQ(0, trans->response_.ssl_info.cert_status); |
2604 EXPECT_FALSE(trans->response_.vary_data.is_valid()); | 2602 EXPECT_FALSE(trans->response_.vary_data.is_valid()); |
2605 } | 2603 } |
2606 | 2604 |
2607 // Test HTTPS connections to a site with a bad certificate | 2605 // Test HTTPS connections to a site with a bad certificate |
2608 TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificate) { | 2606 TEST_F(HttpNetworkTransactionTest, HTTPSBadCertificate) { |
2609 scoped_ptr<ProxyService> proxy_service(CreateNullProxyService()); | 2607 scoped_ptr<ProxyService> proxy_service(CreateNullProxyService()); |
2610 scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction( | 2608 scoped_ptr<HttpTransaction> trans(new HttpNetworkTransaction( |
2611 CreateSession(proxy_service.get()), &mock_socket_factory_)); | 2609 CreateSession(proxy_service.get()), &mock_socket_factory_)); |
2612 | 2610 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3038 TestCompletionCallback callback; | 3036 TestCompletionCallback callback; |
3039 | 3037 |
3040 int rv = trans->Start(&request, &callback); | 3038 int rv = trans->Start(&request, &callback); |
3041 EXPECT_EQ(ERR_IO_PENDING, rv); | 3039 EXPECT_EQ(ERR_IO_PENDING, rv); |
3042 | 3040 |
3043 rv = callback.WaitForResult(); | 3041 rv = callback.WaitForResult(); |
3044 EXPECT_EQ(OK, rv); | 3042 EXPECT_EQ(OK, rv); |
3045 } | 3043 } |
3046 | 3044 |
3047 } // namespace net | 3045 } // namespace net |
OLD | NEW |