Chromium Code Reviews| 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 "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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1514 TEST_F(URLFetcherBadHTTPSTest, BadHTTPS) { | 1514 TEST_F(URLFetcherBadHTTPSTest, BadHTTPS) { |
| 1515 WaitingURLFetcherDelegate delegate; | 1515 WaitingURLFetcherDelegate delegate; |
| 1516 delegate.CreateFetcher(test_server_->GetURL(kDefaultResponsePath), | 1516 delegate.CreateFetcher(test_server_->GetURL(kDefaultResponsePath), |
| 1517 URLFetcher::GET, CreateSameThreadContextGetter()); | 1517 URLFetcher::GET, CreateSameThreadContextGetter()); |
| 1518 delegate.StartFetcherAndWait(); | 1518 delegate.StartFetcherAndWait(); |
| 1519 | 1519 |
| 1520 EXPECT_EQ(URLRequestStatus::CANCELED, | 1520 EXPECT_EQ(URLRequestStatus::CANCELED, |
| 1521 delegate.fetcher()->GetStatus().status()); | 1521 delegate.fetcher()->GetStatus().status()); |
| 1522 EXPECT_EQ(ERR_ABORTED, delegate.fetcher()->GetStatus().error()); | 1522 EXPECT_EQ(ERR_ABORTED, delegate.fetcher()->GetStatus().error()); |
| 1523 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode()); | 1523 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode()); |
| 1524 EXPECT_TRUE(delegate.fetcher()->GetCookies().empty()); | 1524 EXPECT_FALSE(delegate.fetcher()->GetResponseHeaders()); |
|
martijnc
2016/06/07 21:17:12
Because the request is expected to fail it has no
| |
| 1525 std::string data; | 1525 std::string data; |
| 1526 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data)); | 1526 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data)); |
| 1527 EXPECT_TRUE(data.empty()); | 1527 EXPECT_TRUE(data.empty()); |
| 1528 } | 1528 } |
| 1529 | 1529 |
| 1530 } // namespace | 1530 } // namespace |
| 1531 | 1531 |
| 1532 } // namespace net | 1532 } // namespace net |
| OLD | NEW |