| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 TestURLRequest r(test_server.GetURL(""), &d); | 460 TestURLRequest r(test_server.GetURL(""), &d); |
| 461 | 461 |
| 462 r.Start(); | 462 r.Start(); |
| 463 EXPECT_TRUE(r.is_pending()); | 463 EXPECT_TRUE(r.is_pending()); |
| 464 | 464 |
| 465 MessageLoop::current()->Run(); | 465 MessageLoop::current()->Run(); |
| 466 | 466 |
| 467 EXPECT_EQ(1, d.on_certificate_requested_count()); | 467 EXPECT_EQ(1, d.on_certificate_requested_count()); |
| 468 EXPECT_FALSE(d.received_data_before_response()); | 468 EXPECT_FALSE(d.received_data_before_response()); |
| 469 EXPECT_EQ(0, d.bytes_received()); | 469 EXPECT_EQ(0, d.bytes_received()); |
| 470 |
| 471 // Send no certificate. |
| 472 // TODO(davidben): Get temporary client cert import (with keys) working on |
| 473 // all platforms so we can test sending a cert as well. |
| 474 r.ContinueWithCertificate(NULL); |
| 475 |
| 476 MessageLoop::current()->Run(); |
| 477 |
| 478 EXPECT_EQ(1, d.response_started_count()); |
| 479 EXPECT_FALSE(d.received_data_before_response()); |
| 480 EXPECT_NE(0, d.bytes_received()); |
| 470 } | 481 } |
| 471 } | 482 } |
| 472 | 483 |
| 473 TEST_F(URLRequestTestHTTP, CancelTest) { | 484 TEST_F(URLRequestTestHTTP, CancelTest) { |
| 474 TestDelegate d; | 485 TestDelegate d; |
| 475 { | 486 { |
| 476 TestURLRequest r(GURL("http://www.google.com/"), &d); | 487 TestURLRequest r(GURL("http://www.google.com/"), &d); |
| 477 | 488 |
| 478 r.Start(); | 489 r.Start(); |
| 479 EXPECT_TRUE(r.is_pending()); | 490 EXPECT_TRUE(r.is_pending()); |
| (...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2646 TestURLRequest | 2657 TestURLRequest |
| 2647 req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), &d); | 2658 req(test_server_.GetURL("echoheaderoverride?Accept-Charset"), &d); |
| 2648 req.set_context(new TestURLRequestContext()); | 2659 req.set_context(new TestURLRequestContext()); |
| 2649 net::HttpRequestHeaders headers; | 2660 net::HttpRequestHeaders headers; |
| 2650 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r"); | 2661 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r"); |
| 2651 req.SetExtraRequestHeaders(headers); | 2662 req.SetExtraRequestHeaders(headers); |
| 2652 req.Start(); | 2663 req.Start(); |
| 2653 MessageLoop::current()->Run(); | 2664 MessageLoop::current()->Run(); |
| 2654 EXPECT_EQ(std::string("koi-8r"), d.data_received()); | 2665 EXPECT_EQ(std::string("koi-8r"), d.data_received()); |
| 2655 } | 2666 } |
| OLD | NEW |