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

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

Issue 3141026: Reintegrate certificate selection in HttpNetworkTransaction DoLoop (Closed)
Patch Set: Address Wan-Teh's comments and rebase on top of trunk Created 10 years, 4 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
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | third_party/tlslite/README.chromium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | third_party/tlslite/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698